Skip to content

Feat/junit xml output#473

Open
nonso7 wants to merge 5 commits intoHyperSafeD:mainfrom
nonso7:feat/junit-xml-output
Open

Feat/junit xml output#473
nonso7 wants to merge 5 commits intoHyperSafeD:mainfrom
nonso7:feat/junit-xml-output

Conversation

@nonso7
Copy link
Copy Markdown
Contributor

@nonso7 nonso7 commented Mar 29, 2026

Summary

Describe the change, the motivation behind it, and any important implementation details.

Fixes #

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Maintenance or refactor

Testing

List the commands you ran and the scope of validation.

cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test -p sanctifier-core --all-features
cargo test -p sanctifier-cli
cd frontend && npm test

Checklist

  • I ran the relevant tests locally, or explained why they were not needed.
  • I updated documentation for any user-facing behavior changes.
  • I added or updated tests for the change when appropriate.
  • I added a changelog or release-notes entry when needed, or confirmed none is required.
  • I verified this branch is up to date with main and merge conflicts are resolved.

Closes #411

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

@nonso7 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

…ration (HyperSafeD#411)

Adds `sanctifier analyze --format junit` which emits a standards-compliant
JUnit XML document (testsuites/testsuite/testcase with <failure> elements)
mapping every security check category to a test suite. GitLab, CircleCI,
and GitHub CI can consume this file in their native test-report tabs.

Changes
-------
CLI (sanctifier-cli):
- New `junit` format branch in analyze::exec; suppresses branding logo
  (same as json) so output is machine-readable
- xml_escape() helper, junit_testsuite() builder, and print_junit_report()
  covering all 7 check categories (auth_gaps, symbol_issues, panic_issues,
  arithmetic_issues, storage_collisions, size_warnings, unsafe_patterns)
- Added missing [dev-dependencies]: assert_cmd, predicates, tempfile, regex
- Fixed field_reassign_with_default, too_many_arguments, unused vars,
  assert_eq!(bool, false), dead print_banner — all pre-existing Clippy errors

Core (sanctifier-core):
- Removed unused imports and dead code (has_attr, DEFAULT_APPROACHING_THRESHOLD)
- #[derive(Default)] on StorageVisitor and GasEstimator
- Simplified with_panic_guard → unwrap_or_default()
- Collapsed duplicate if-branches in classify_size()
- Fixed doc-comment and empty-line-after-doc warnings
- field_reassign_with_default in tests replaced with struct literal init
- Removed dead imports from integration_token_test.rs

Contracts:
- Prefixed unused `admin` variable in vulnerable-contract
- Applied rustfmt to kani-poc

CI (.github/workflows/rust.yml):
- Install cargo-nextest (taiki-e/install-action@nextest)
- Run tests with `cargo nextest run --profile ci` to emit JUnit XML
- Upload target/nextest/ci/junit.xml as artifact `junit-test-results`
  with `if: always()` so failures are still reported
- Scope clippy to `-p sanctifier-cli -p sanctifier-core` to exclude
  contract crates whose soroban testutils feature is incompatible with
  the host runner target

New files:
- .config/nextest.toml  — defines [profile.ci] with junit output path

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@nonso7 nonso7 force-pushed the feat/junit-xml-output branch from 2981225 to ea4cb26 Compare March 29, 2026 21:54
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.

[ci] Output JUnit XML (--format junit) for native CI tab integration

1 participant