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
16 changes: 8 additions & 8 deletions test/e2e-scenario/framework-tests/e2e-assertion-modules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function allPlannedAssertionGroupIds(): Set<string> {
}

describe("assertion modules", () => {
it("test_should_define_onboarding_assertions_in_modules", () => {
it("should define onboarding assertions in modules", () => {
const onboardingGroups = assertionRegistry.groups.filter((group) => group.phase === "onboarding");
const stepIds = new Set(onboardingGroups.flatMap((group) => group.steps.map((step) => step.id)));

Expand All @@ -49,7 +49,7 @@ describe("assertion modules", () => {
}
});

it("test_should_map_every_old_validation_suite_to_canonical_assertion_group", () => {
it("should map every old validation suite to canonical assertion group", () => {
const suites = loadYaml(SUITES_PATH).suites as AnyRecord;

for (const suiteId of Object.keys(suites)) {
Expand All @@ -60,7 +60,7 @@ describe("assertion modules", () => {
}
});

it("test_should_keep_snapshot_suite_distinct_from_snapshot_lifecycle", () => {
it("should keep snapshot suite distinct from snapshot lifecycle", () => {
const snapshot = assertionGroupForSuite("snapshot");
const snapshotLifecycle = assertionGroupForSuite("snapshot-lifecycle");

Expand All @@ -73,20 +73,20 @@ describe("assertion modules", () => {
]);
});

it("test_should_require_each_assertion_group_to_have_steps", () => {
it("should require each assertion group to have steps", () => {
const emptyGroup: AssertionGroup = { id: "empty", phase: "runtime", steps: [] };

expect(() => validateAssertionGroups([...assertionRegistry.groups, emptyGroup], E2E_DIR)).toThrow(/empty/);
});

it("test_should_require_each_assertion_group_to_be_used_by_a_scenario_plan", () => {
it("should require each assertion group to be used by a scenario plan", () => {
const planned = allPlannedAssertionGroupIds();
const unused = assertionRegistry.groups.map((group) => group.id).filter((id) => !planned.has(id));

expect(unused, `unused assertion groups: ${unused.join(", ")}`).toEqual([]);
});

it("test_should_fail_when_assertion_step_references_missing_script", () => {
it("should fail when assertion step references missing script", () => {
const badGroup: AssertionGroup = {
id: "bad.missing-script",
phase: "runtime",
Expand All @@ -103,7 +103,7 @@ describe("assertion modules", () => {
expect(() => validateAssertionGroups([badGroup], E2E_DIR)).toThrow(/does-not-exist/);
});

it("test_should_fail_when_retry_attempts_lack_classifier", () => {
it("should fail when retry attempts lack classifier", () => {
const badGroup: AssertionGroup = {
id: "bad.retry",
phase: "runtime",
Expand All @@ -121,7 +121,7 @@ describe("assertion modules", () => {
expect(() => validateAssertionGroups([badGroup], E2E_DIR)).toThrow(/classifier|retry/i);
});

it("test_should_block_complete_status_for_manual_classification_steps", () => {
it("should block complete status for manual classification steps", () => {
expect(() => validateAssertionGroups(assertionRegistry.groups, E2E_DIR)).not.toThrow(/needs-manual-classification/);
expect(assertionRegistry.groups.every((group) => group.migrationStatus === "complete")).toBe(true);
});
Expand Down
6 changes: 3 additions & 3 deletions test/e2e-scenario/framework-tests/e2e-context-helper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function runBash(script: string, env: Record<string, string> = {}): SpawnSyncRet
}

describe("E2E context helper (runtime/lib/context.sh)", () => {
it("context_should_write_and_source_values", () => {
it("context helper writes and sources values", () => {
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "e2e-ctx-"));
try {
const script = `
Expand All @@ -43,7 +43,7 @@ describe("E2E context helper (runtime/lib/context.sh)", () => {
}
});

it("context_require_should_fail_for_missing_value", () => {
it("context require fails for missing values", () => {
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "e2e-ctx-"));
try {
const script = `
Expand All @@ -61,7 +61,7 @@ describe("E2E context helper (runtime/lib/context.sh)", () => {
}
});

it("context_dump_should_redact_sensitive_values", () => {
it("context dump redacts sensitive values", () => {
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "e2e-ctx-"));
try {
const script = `
Expand Down
14 changes: 7 additions & 7 deletions test/e2e-scenario/framework-tests/e2e-convention-lint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,53 +51,53 @@ describe("Phase 1.G convention lint", () => {
fs.rmSync(tmp, { recursive: true, force: true });
});

it("lint_should_flag_step_that_reexports_noninteractive_env", () => {
it("flags steps that reexport noninteractive env", () => {
writeStep(tmp, "00-bad.sh", 'export DEBIAN_FRONTEND=noninteractive\necho hi');
const r = runTsx(LINT_BIN, ["--root", tmp]);
expect(r.status).not.toBe(0);
expect(r.stdout + r.stderr).toMatch(/00-bad\.sh/);
expect(r.stdout + r.stderr).toMatch(/DEBIAN_FRONTEND|non.?interactive/i);
});

it("lint_should_flag_step_that_registers_own_trap", () => {
it("flags steps that register their own trap", () => {
writeStep(tmp, "00-trap.sh", 'trap cleanup EXIT');
const r = runTsx(LINT_BIN, ["--root", tmp]);
expect(r.status).not.toBe(0);
expect(r.stdout + r.stderr).toMatch(/00-trap\.sh/);
expect(r.stdout + r.stderr).toMatch(/trap/i);
});

it("lint_should_flag_step_that_calls_section", () => {
it("flags steps that call section", () => {
writeStep(tmp, "00-section.sh", 'section "Phase 3: X"');
const r = runTsx(LINT_BIN, ["--root", tmp]);
expect(r.status).not.toBe(0);
expect(r.stdout + r.stderr).toMatch(/00-section\.sh/);
expect(r.stdout + r.stderr).toMatch(/section/i);
});

it("lint_should_flag_step_writing_to_tmp_log_path", () => {
it("flags steps that write to a tmp log path", () => {
writeStep(tmp, "00-tmplog.sh", 'echo hi > /tmp/foo.log');
const r = runTsx(LINT_BIN, ["--root", tmp]);
expect(r.status).not.toBe(0);
expect(r.stdout + r.stderr).toMatch(/00-tmplog\.sh/);
expect(r.stdout + r.stderr).toMatch(/\/tmp.*\.log|E2E_CONTEXT_DIR/);
});

it("lint_should_flag_nonstandard_repo_root_discovery_pattern", () => {
it("flags nonstandard repo root discovery patterns", () => {
writeStep(tmp, "00-reporoot.sh", 'REPO_ROOT="$(git rev-parse --show-toplevel)"');
const r = runTsx(LINT_BIN, ["--root", tmp]);
expect(r.status).not.toBe(0);
expect(r.stdout + r.stderr).toMatch(/repo.?root|git rev-parse/i);
});

it("lint_should_not_require_legacy_scripts_to_update_parity_map", () => {
it("does not require legacy scripts to update the parity map", () => {
writeLegacy(tmp, "test-new-thing.sh", '# legacy script\npass "something"');
const r = runTsx(LINT_BIN, ["--root", tmp]);
expect(r.status, r.stdout + r.stderr).toBe(0);
});


it("lint_should_pass_on_current_repo_state", () => {
it("passes on the current repo state", () => {
const r = runTsx(LINT_BIN);
expect(r.status, r.stdout + r.stderr).toBe(0);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe("compiler emits state-validation phase actions from expected-state regi
]);
});

it("compiler hard-errors on a scenario referencing an unknown expected_state id", () => {
it("compiler fails hard on a scenario referencing an unknown expected-state ID", () => {
expect(() =>
compileRunPlans([
{
Expand Down
Loading
Loading