test: add coverage for trace --step CLI flag - #2161
Draft
github-actions[bot] wants to merge 1 commit into
Draft
github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Adds two end-to-end assertions to audit_pipeline_artifact_layouts_are_equivalent_end_to_end covering the previously-untested --step flag on the trace CLI subcommand: - trace --step <id-present-in-ir-graph> succeeds, returns a populated step/location/ upstream/downstream JSON section, and does not warn. - trace --step <unknown-id> still exits 0, prints the "requested step was not found in the local IR graph" warning on stderr, and omits the step section from JSON. Previously src/inspect/trace.rs only had unit-level coverage for the step-filtering path (build_trace_report(..., Some(step))); no test exercised the full CLI (dispatch_trace -> build_trace -> trace::render/JSON) with --step set. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
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 Gap Fixes
Test suite snapshot: ~1940 unit tests, ~315 integration tests, 55+ test fixtures
Added Coverage
src/inspect/trace.rs/src/inspect/cli.rs::dispatch_traceado-aw trace <build> --step <id>end-to-end CLI path--stepflag was only exercised via internal unit tests callingbuild_trace_report(..., Some(step))directly. No test drove the full CLI path (dispatch_trace→build_trace→ JSON/text rendering), so the "step found" success shape and the "step not found" warning-on-stderr behavior for an unknown step id were unverified end-to-end.audit_pipeline_artifact_layouts_are_equivalent_end_to_endintests/audit_it.rswith two new assertions: (1)trace --step threatAnalysis --jsonsucceeds with a populatedstep/location/upstream/downstreamJSON section and no missing-step warning, (2)trace --step does-not-exist --jsonstill exits 0, emits"requested step was not found in the local IR graph"on stderr, and the JSONstepfield isnull.Validation
cargo test --test audit_it(5 passed)cargo clippy --all-targets --all-features(clean)This PR was created by the automated test gap finder. Previous run: 2026-09-07. Modules audited this cycle: inspect/lint.rs, inspect/whatif.rs, inspect/catalog.rs, inspect/trace.rs, compile/imports/merge.rs. Only inspect/trace.rs surfaced a meaningful, test-only-fixable gap (the CLI
--steppath); the others already had adequate coverage.