Skip to content

fix(parser_cli): keep text display fixture diagnostics-agnostic#301

Open
shahan-khatchadourian-anchorage wants to merge 1 commit into
mainfrom
shahankhatch/fix-stagex-cli-text-diagnostics
Open

fix(parser_cli): keep text display fixture diagnostics-agnostic#301
shahan-khatchadourian-anchorage wants to merge 1 commit into
mainfrom
shahankhatch/fix-stagex-cli-text-diagnostics

Conversation

@shahan-khatchadourian-anchorage
Copy link
Copy Markdown
Contributor

Summary

  • Stagex's parser_cli build runs cargo test --no-default-features --features solana, which disables the default diagnostics feature. The post-feat: attested transaction lint diagnostics in SignablePayload #228 solana-text.display.expected baked in the new Diagnostic { ... } blocks, so when the binary ran without diagnostics emitted, the actual output diverged from the fixture and test_cli_with_fixtures failed inside the container (visible on main's most recent stagex job for 1e4fe64).
  • Mirror the separation the JSON path already enforces: display fixtures contain only display fields; diagnostics are tested via the diagnostics fixture. The text path now strips Diagnostic { ... }, blocks from the Debug dump before comparing (gated on the diagnostics feature).

Test plan

  • cd src && cargo test -p parser_cli (default features: diagnostics on) — 8 tests pass
  • cd src && cargo test -p parser_cli --no-default-features --features solana (stagex config) — 3 tests pass
  • Confirm green stagex run on this PR

🤖 Generated with Claude Code

The stagex parser_cli build runs `cargo test --no-default-features
--features solana`, which disables the default `diagnostics` feature. The
post-#228 `solana-text.display.expected` had the new `Diagnostic { ... }`
blocks baked in, so the actual binary output (no diagnostics emitted)
diverged from the fixture and the test failed inside the container.

Restore the same separation the JSON path already enforces: the display
fixture covers only display fields, the diagnostics fixture covers only
diagnostics. Strip `Diagnostic { ... }` blocks from the text Debug dump
before comparing, gated on the `diagnostics` feature.

Tested both `cargo test -p parser_cli` (default features) and
`cargo test -p parser_cli --no-default-features --features solana`
(stagex config); both pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 14, 2026 18:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates parser_cli integration tests so text/human display fixtures remain stable when the diagnostics feature is disabled (e.g., Stagex running --no-default-features --features solana). This aligns the text fixture comparison behavior with the existing JSON path, where diagnostics are already filtered out for display assertions.

Changes:

  • Removed Diagnostic { ... } entries from the Solana text display expected fixture.
  • Updated the CLI fixture test to strip Diagnostic { ... }, blocks from actual {:#?} (Debug) output before comparing against display fixtures (only when diagnostics is enabled).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/parser/cli/tests/fixtures/solana-text.display.expected Removes baked-in diagnostic blocks so the display fixture reflects only display fields.
src/parser/cli/tests/cli_test.rs Filters diagnostics out of non-JSON (Debug/text) output during fixture comparison when diagnostics is enabled.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fuzz proptest stagex Trigger stagex OCI image build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants