test: fix weak assertions in compile/ir graph, output, and env tests#1064
Draft
github-actions[bot] wants to merge 1 commit into
Draft
test: fix weak assertions in compile/ir graph, output, and env tests#1064github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Suite Reduction:
src/compile/ir/graph.rs,output.rs,env.rsWhat was wrong
graph.rs / auto_is_output_flag_only_promotes_referenced_outputs: the outerif let PipelineBody::Jobs(jobs) = &p.bodyhad noelsebranch. If the body variant somehow didn't match, everyassert!inside would be silently skipped — a vacuous pass.graph.rs / coalesce_children_contribute_edges: identical missingelse { panic!() }on the sameif let PipelineBody::Jobspattern. All three assertions could be silently skipped.graph.rs / cross_stage_duplicate_step_id_is_rejected: only checkedmsg.contains("duplicate StepId 'marker'"), omitting the"previously declared in"and"pipeline-wide unique"clauses that the equivalentcross_job_duplicate_step_id_is_rejectedtest asserts. A regression that dropped those message fragments would pass unnoticed.output.rs / outputdecl_secret_marks_secret: only assertedd.is_secret. Did not verifyd.namewas stored correctly or thatd.auto_is_outputdefaults tofalsefor thesecret()constructor — a bug that setauto_is_output = trueor stored the name incorrectly would pass.env.rs / coalesce_carries_typed_children: only assertedparts.len() == 2. Did not check child types or values; a reorder or wrong-variant implementation would silently pass the length check.Changes
auto_is_output_flag_only_promotes_referenced_outputselse { panic! }to outerif letcoalesce_children_contribute_edgeselse { panic! }to outerif letcross_stage_duplicate_step_id_is_rejected"previously declared in"+"pipeline-wide unique"assertionsoutputdecl_secret_marks_secretnameandauto_is_outputassertionscoalesce_carries_typed_childrenassert_eq!on each childVerification
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.comspsprodweu4.vssps.visualstudio.comSee Network Configuration for more information.