Skip to content

Add report regression coverage - #3

Merged
josediegorobles merged 2 commits into
mainfrom
codex/report-regressions
Jun 24, 2026
Merged

Add report regression coverage#3
josediegorobles merged 2 commits into
mainfrom
codex/report-regressions

Conversation

@josediegorobles

Copy link
Copy Markdown
Owner

Summary

  • add CLI regression tests that parse review-pack and policy-pack JSON output
  • assert stable schema versions and required report arrays using existing fixtures

Validation

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-features

Copilot AI review requested due to automatic review settings June 24, 2026 13:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds CLI-level regression tests that validate the JSON output from review-pack and policy-pack can be parsed and that key schema fields/arrays are present, using existing fixtures to lock in expected report structure.

Changes:

  • Added JSON-parse regression tests for review-pack output and required fields/arrays.
  • Added JSON-parse regression tests for policy-pack output and required fields/arrays.
  • Introduced serde_json::Value usage in CLI tests to validate report structure beyond substring matching.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/cli.rs Outdated
Comment on lines +143 to +160
let output = cmd
.args([
"review-pack",
"--input",
"tests/fixtures/review-packs/complete",
"--format",
"json",
])
.output()
.unwrap();

assert!(output.status.success());
let report: Value = serde_json::from_slice(&output.stdout).unwrap();

assert_eq!(report["schema_version"], "0.4");
assert!(report["artifacts_detected"].as_array().unwrap().len() >= 4);
assert!(!report["review_questions"].as_array().unwrap().is_empty());
}
Comment thread tests/cli.rs Outdated
Comment on lines +210 to +228
let output = cmd
.args([
"policy-pack",
"--input",
"tests/fixtures/policy-packs/multisig-timelock",
"--format",
"json",
])
.output()
.unwrap();

assert!(output.status.success());
let report: Value = serde_json::from_slice(&output.stdout).unwrap();

assert_eq!(report["schema_version"], "0.5");
assert_eq!(report["pack_type"], "policy_pack");
assert!(!report["evidence_documents"].as_array().unwrap().is_empty());
assert!(!report["missing_evidence"].as_array().unwrap().is_empty());
}
@josediegorobles
josediegorobles merged commit 50f3e94 into main Jun 24, 2026
1 check passed
@josediegorobles
josediegorobles deleted the codex/report-regressions branch June 24, 2026 14:35
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.

2 participants