Skip to content

test: fix weak assertions in compile/ir graph, output, and env tests#1064

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
test-reducer/ir-graph-output-env-478ef87cb80e55fe
Draft

test: fix weak assertions in compile/ir graph, output, and env tests#1064
github-actions[bot] wants to merge 1 commit into
mainfrom
test-reducer/ir-graph-output-env-478ef87cb80e55fe

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Test Suite Reduction: src/compile/ir/graph.rs, output.rs, env.rs

What was wrong

  • graph.rs / auto_is_output_flag_only_promotes_referenced_outputs: the outer if let PipelineBody::Jobs(jobs) = &p.body had no else branch. If the body variant somehow didn't match, every assert! inside would be silently skipped — a vacuous pass.

  • graph.rs / coalesce_children_contribute_edges: identical missing else { panic!() } on the same if let PipelineBody::Jobs pattern. All three assertions could be silently skipped.

  • graph.rs / cross_stage_duplicate_step_id_is_rejected: only checked msg.contains("duplicate StepId 'marker'"), omitting the "previously declared in" and "pipeline-wide unique" clauses that the equivalent cross_job_duplicate_step_id_is_rejected test asserts. A regression that dropped those message fragments would pass unnoticed.

  • output.rs / outputdecl_secret_marks_secret: only asserted d.is_secret. Did not verify d.name was stored correctly or that d.auto_is_output defaults to false for the secret() constructor — a bug that set auto_is_output = true or stored the name incorrectly would pass.

  • env.rs / coalesce_carries_typed_children: only asserted parts.len() == 2. Did not check child types or values; a reorder or wrong-variant implementation would silently pass the length check.

Changes

Test File Action Reason
auto_is_output_flag_only_promotes_referenced_outputs graph.rs Rewritten Add else { panic! } to outer if let
coalesce_children_contribute_edges graph.rs Rewritten Add else { panic! } to outer if let
cross_stage_duplicate_step_id_is_rejected graph.rs Rewritten Add missing "previously declared in" + "pipeline-wide unique" assertions
outputdecl_secret_marks_secret output.rs Rewritten Add name and auto_is_output assertions
coalesce_carries_typed_children env.rs Rewritten Replace len-only check with assert_eq! on each child

Verification

  • cargo test: all 2019 unit + 142 integration tests pass ✅
  • cargo clippy --all-targets --all-features: no warnings or errors ✅

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • spsprodeus21.vssps.visualstudio.com
  • spsprodweu4.vssps.visualstudio.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "spsprodeus21.vssps.visualstudio.com"
    - "spsprodweu4.vssps.visualstudio.com"

See Network Configuration for more information.

Generated by Test Reducer · 429.1 AIC · ⌖ 19.9 AIC · ⊞ 36.7K ·

- graph.rs / auto_is_output_flag_only_promotes_referenced_outputs: outer
  `if let PipelineBody::Jobs` had no `else` branch; all assertions were
  silently skipped if the body variant didn't match.  Add `else { panic! }`.

- graph.rs / coalesce_children_contribute_edges: same missing outer
  `else { panic! }`.

- graph.rs / cross_stage_duplicate_step_id_is_rejected: weaker than the
  matching cross-job test — only checked 'duplicate StepId', not the
  'previously declared in' and 'pipeline-wide unique' clauses.  Add the
  two missing assertions.

- output.rs / outputdecl_secret_marks_secret: only asserted `is_secret`;
  didn't verify `name` was stored correctly or that `auto_is_output`
  defaults to false for the secret constructor.  Add both checks.

- env.rs / coalesce_carries_typed_children: only asserted `parts.len()`;
  didn't verify child types or values.  Add direct `assert_eq!` on each
  child so a reorder or wrong-variant regression would be caught.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants