Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

term.svg files require two SNAPSHOTS=overwrite runs to be rendered properly #257

Closed
epage opened this issue Feb 19, 2024 · 1 comment
Closed
Labels
A-snapbox Area: snapbox package bug Not as expected

Comments

@epage
Copy link
Contributor

epage commented Feb 19, 2024

The first run loads the expected value, which is an error, and loses track of the intended data format. We then write out the actual value blindly. The second run loads the value as an SVG (which isn't an SVG but we don't validate) and so we coerce the actual to an SVG and write it out

@epage epage added bug Not as expected A-snapbox Area: snapbox package labels Feb 19, 2024
@epage
Copy link
Contributor Author

epage commented Feb 22, 2024

Should be fixed in snapbox-v0.5.3

@epage epage closed this as completed Feb 22, 2024
bors added a commit to rust-lang/cargo that referenced this issue Feb 23, 2024
test(cli): Verify terminal styling

### What does this PR try to resolve?

This uses a new feature from snapbox that let's us render terminal styling in SVG files.  This let's us see / visualize ANSI escape codes, including in github's UI (will render images, including side-by-side images for diffs).

### How should we test and review this PR?

Potential concerns
- assert-rs/snapbox#257: If the snapshot file doesn't exist, you need to `SNAPSHOTS=overwrite` twice
- #9012: because we narrow the enabling of colors to cargo via `CARGO_TERM_COLOR`, clap doesn't know about it and those are rendered without color
- File size: `du -ch tests` reported 13MB before and after
- Loss of information: this doesn't yet include links but we already weren't snapshotting these
- Unconditionally turning on styling and snapshotting for it for all "ui" tests
- Too many SVGs in one PR can negatively affect github's UI

### Additional information
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-snapbox Area: snapbox package bug Not as expected
Projects
None yet
Development

No branches or pull requests

1 participant