Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions sh/gh/setup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Comment thread
kixelated marked this conversation as resolved.
Resolved
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}`);
Expand Down
4 changes: 2 additions & 2 deletions sh/rs/select.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ")])

Expand Down
Loading