diff --git a/sh/gh/setup.test.ts b/sh/gh/setup.test.ts index 90baf6a781a..4da7cd62312 100644 --- a/sh/gh/setup.test.ts +++ b/sh/gh/setup.test.ts @@ -31,8 +31,16 @@ for (const name of ["check"]) { const setup = job.steps.slice(scopeIndex + 1); expect(setup.some((step) => step.uses === "./.github/actions/nix")).toBe(true); expect(setup.some((step) => step.uses === "./.github/actions/rust-cache")).toBe(true); - expect(setup.at(-1)?.name).toBe(job.name); - for (const step of setup) { + expect(setup.filter((step) => step.run).at(-1)?.name).toBe(job.name); + const checkIndex = setup.findIndex((step) => step.name === job.name); + for (const [index, step] of setup.entries()) { + if (step.uses?.startsWith("actions/upload-artifact@")) { + expect(index).toBeGreaterThan(checkIndex); + expect(step.if?.replace(/^\$\{\{\s*|\s*\}\}$/g, "")).toBe( + "!cancelled() && steps.scope.outputs.rust == 'true'", + ); + continue; + } const output = step.uses === "./.github/actions/rust-cache" ? "rust" : "needed"; const hosted = step.uses === "./.github/actions/nix" ? " && runner.environment != 'self-hosted'" : ""; expect(step.if).toBe(`steps.scope.outputs.${output} == 'true'${hosted}`); diff --git a/sh/rs/select.test.py b/sh/rs/select.test.py index 7d7f9bee0cf..a38bf0cef3c 100644 --- a/sh/rs/select.test.py +++ b/sh/rs/select.test.py @@ -114,8 +114,8 @@ def trace(self, owner, *args): def test_tokio_keeps_extremes_and_crypto_contracts(self): boundary = self.trace("tokio") exhaustive = self.trace("tokio", "--all") - self.assertEqual(sum(call.startswith("clippy ") for call in boundary), 2) - self.assertEqual(sum(call.startswith("clippy ") for call in exhaustive), 10) + self.assertEqual(sum(call.startswith("clippy ") for call in boundary), 3) + self.assertEqual(sum(call.startswith("clippy ") for call in exhaustive), 12) self.assertEqual([call for call in boundary if not call.startswith("clippy ")], [call for call in exhaustive if not call.startswith("clippy ")])