Skip to content

Commit edcb4a7

Browse files
test: fix vacuous assertions in compiler_tests.rs (section 5) (#1476)
Five tests in the 3700-4800 line range only called assert_valid_yaml with no additional content assertions, providing no regression value beyond a parse check. - test_standalone_pipeline_trigger_compiled_output_is_valid_yaml: add assertions on pipelines resource block, upstream name/project, and disabled CI/PR triggers. - test_skip_integrity_valid_yaml_standalone: add assertion that 'Verify pipeline integrity' is absent when --skip-integrity is passed. - test_skip_integrity_valid_yaml_1es: same fix for the 1ES fixture. - test_debug_pipeline_valid_yaml_standalone: add assertions that DEBUG="*" and 'Verify MCP backends' are present with --debug-pipeline. - test_debug_pipeline_valid_yaml_1es: same fix for the 1ES fixture. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 14a7f7c commit edcb4a7

1 file changed

Lines changed: 52 additions & 3 deletions

File tree

tests/compiler_tests.rs

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4345,11 +4345,31 @@ fn test_standalone_complete_agent_has_setup_and_teardown_jobs() {
43454345
);
43464346
}
43474347

4348-
/// Test that the pipeline-trigger fixture produces valid YAML
4348+
/// Test that the pipeline-trigger fixture produces valid YAML with correct structure
43494349
#[test]
43504350
fn test_standalone_pipeline_trigger_compiled_output_is_valid_yaml() {
43514351
let compiled = compile_fixture("pipeline-trigger-agent.md");
43524352
assert_valid_yaml(&compiled, "pipeline-trigger-agent.md");
4353+
4354+
// Verify pipeline resource block is present
4355+
assert!(
4356+
compiled.contains("pipelines:"),
4357+
"pipeline-trigger output should contain a pipelines resource block"
4358+
);
4359+
assert!(
4360+
compiled.contains("Build Pipeline"),
4361+
"pipeline-trigger output should reference the upstream pipeline by name"
4362+
);
4363+
assert!(
4364+
compiled.contains("OtherProject"),
4365+
"pipeline-trigger output should reference the upstream project"
4366+
);
4367+
// CI and PR triggers must be disabled — pipeline resource is the only trigger
4368+
assert!(
4369+
compiled.contains("trigger: none"),
4370+
"pipeline-trigger output should disable CI trigger"
4371+
);
4372+
assert!(compiled.contains("pr: none"), "pipeline-trigger output should disable PR trigger");
43534373
}
43544374

43554375
// ─── --skip-integrity flag tests ─────────────────────────────────────────
@@ -4381,17 +4401,27 @@ fn test_default_includes_integrity_step() {
43814401
);
43824402
}
43834403

4384-
/// Test that --skip-integrity produces valid YAML for both standalone and 1ES
4404+
/// Test that --skip-integrity produces valid YAML and removes the integrity check
4405+
/// for both standalone (complete-agent) and 1ES targets. The minimal-agent
4406+
/// fixture already covers the flag; these tests exercise the richer fixtures.
43854407
#[test]
43864408
fn test_skip_integrity_valid_yaml_standalone() {
43874409
let compiled = compile_fixture_with_flags("complete-agent.md", &["--skip-integrity"]);
43884410
assert_valid_yaml(&compiled, "complete-agent.md (skip-integrity)");
4411+
assert!(
4412+
!compiled.contains("Verify pipeline integrity"),
4413+
"complete-agent.md compiled with --skip-integrity should NOT contain the integrity check step"
4414+
);
43894415
}
43904416

43914417
#[test]
43924418
fn test_skip_integrity_valid_yaml_1es() {
43934419
let compiled = compile_fixture_with_flags("1es-test-agent.md", &["--skip-integrity"]);
43944420
assert_valid_yaml(&compiled, "1es-test-agent.md (skip-integrity)");
4421+
assert!(
4422+
!compiled.contains("Verify pipeline integrity"),
4423+
"1es-test-agent.md compiled with --skip-integrity should NOT contain the integrity check step"
4424+
);
43954425
}
43964426

43974427
// ─── --debug-pipeline flag tests ─────────────────────────────────────────
@@ -4446,17 +4476,36 @@ fn test_default_excludes_debug_diagnostics() {
44464476
);
44474477
}
44484478

4449-
/// Test that --debug-pipeline produces valid YAML for both targets
4479+
/// Test that --debug-pipeline produces valid YAML and includes debug diagnostics
4480+
/// for both standalone (complete-agent) and 1ES targets. The minimal-agent
4481+
/// fixture already covers the individual debug signals; these tests exercise
4482+
/// the richer fixtures to confirm no flag interaction regressions.
44504483
#[test]
44514484
fn test_debug_pipeline_valid_yaml_standalone() {
44524485
let compiled = compile_fixture_with_flags("complete-agent.md", &["--debug-pipeline"]);
44534486
assert_valid_yaml(&compiled, "complete-agent.md (debug-pipeline)");
4487+
assert!(
4488+
compiled.contains(r#"DEBUG="*""#),
4489+
"complete-agent.md compiled with --debug-pipeline should contain DEBUG=* env var"
4490+
);
4491+
assert!(
4492+
compiled.contains("Verify MCP backends"),
4493+
"complete-agent.md compiled with --debug-pipeline should contain probe step"
4494+
);
44544495
}
44554496

44564497
#[test]
44574498
fn test_debug_pipeline_valid_yaml_1es() {
44584499
let compiled = compile_fixture_with_flags("1es-test-agent.md", &["--debug-pipeline"]);
44594500
assert_valid_yaml(&compiled, "1es-test-agent.md (debug-pipeline)");
4501+
assert!(
4502+
compiled.contains(r#"DEBUG="*""#),
4503+
"1es-test-agent.md compiled with --debug-pipeline should contain DEBUG=* env var"
4504+
);
4505+
assert!(
4506+
compiled.contains("Verify MCP backends"),
4507+
"1es-test-agent.md compiled with --debug-pipeline should contain probe step"
4508+
);
44604509
}
44614510

44624511
/// Test that both flags can be combined

0 commit comments

Comments
 (0)