Skip to content

test(inspect): add CLI coverage for whatif classification and error path - #2059

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
test/whatif-cli-coverage-8bad21178b640e0a
Draft

test(inspect): add CLI coverage for whatif classification and error path#2059
github-actions[bot] wants to merge 1 commit into
mainfrom
test/whatif-cli-coverage-8bad21178b640e0a

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Test Gap Fixes

Test suite snapshot: 3208 unit/integration tests total; 11 tests in tests/inspect_integration.rs (was 8)

Added Coverage

Module Function/Path Why It Matters Test Added
src/inspect/cli.rs (dispatch_whatif) / src/inspect/whatif.rs End-to-end ado-aw whatif --fail <job> text output The whatif CLI subcommand had unit tests for the classifier logic but zero end-to-end coverage exercising the actual binary/CLI dispatch path (source parse → compile → summary → analyze → render). Verifies downstream jobs are correctly labeled runs_anyway/skipped from real compiled conditions. whatif_classifies_downstream_jobs_by_condition
src/inspect/cli.rs (dispatch_whatif --json) ado-aw whatif --json structured report schema Machine-readable output is a public contract consumed by other tooling (e.g. mcp-author); nothing previously asserted the JSON shape (failing_node.kind/id, classification values) survives the full CLI path. whatif_json_emits_structured_report
src/inspect/whatif.rs (resolve_failing_node error path) --fail <unknown-id> error handling The WhatIfError::UnknownFailId error path was untested at the CLI boundary — confirms the command fails non-zero with a clear message instead of panicking or silently succeeding. whatif_unknown_fail_id_errors

Validation

  • cargo test --test inspect_integration (11/11 passed)
  • cargo clippy --all-targets --all-features (no new warnings; pre-existing warning in create_work_item.rs unrelated to this change)

Scope

Only tests/inspect_integration.rs was modified; no production code changes.


This PR was created by the automated test gap finder. Previous run: 2026-08-24. Modules audited this cycle: src/inspect/cli.rs whatif CLI wiring.

Generated by Test Gap Finder · auto · 78.5 AIC · ⌖ 6.61 AIC · ⊞ 11.5K ·

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
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.

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