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

Handle jsonlines being mixed with other output #351

Open
epage opened this issue Jul 23, 2024 · 5 comments
Open

Handle jsonlines being mixed with other output #351

epage opened this issue Jul 23, 2024 · 5 comments
Labels
A-snapbox Area: snapbox package enhancement Improve the expected

Comments

@epage
Copy link
Contributor

epage commented Jul 23, 2024

Cargo needs this for testing cargo test. This was found while testing the fix for #348.

@epage epage added enhancement Improve the expected A-snapbox Area: snapbox package labels Jul 23, 2024
@weihanglo
Copy link

Could you point out the specific tests needing this?

@epage
Copy link
Contributor Author

epage commented Jul 24, 2024

https://github.com/rust-lang/cargo/blob/7f2079838ac6e0a3cb05b1b9dac4401a76572855/tests/testsuite/test.rs#L4365-L4420

We could look into other ways of solving that but I hadn't yet

  • Could we pass --no-run?
  • We could read the output and do our own filtering before doing a direct call to assert_e2e().eq

@weihanglo
Copy link

--no-run seems like a viable solution for Cargo. In an ideal world everything should be JSON under --message-forma=json. I don't really think snapbox is responsible for this misfortune.

epage added a commit to epage/cargo that referenced this issue Jul 24, 2024
Rather than blocking on assert-rs/snapbox#351, we can get away with
`--no-run` for what this test is covering.
@epage
Copy link
Contributor Author

epage commented Jul 24, 2024

I don't really think snapbox is responsible for this misfortune.

If only the world was so clean.

For example, I was looking at cargo's compilation for other reasons and cargo emits json on stderr and we only parse lines starting as { as json, forwarding the rest on to stderr.

@epage
Copy link
Contributor Author

epage commented Aug 14, 2024

rust-lang/cargo#14297 dropped the priority of this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-snapbox Area: snapbox package enhancement Improve the expected
Projects
None yet
Development

No branches or pull requests

2 participants