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

JSON output #1

Closed
LukasKalbertodt opened this issue Jul 23, 2018 · 6 comments · May be fixed by #34
Closed

JSON output #1

LukasKalbertodt opened this issue Jul 23, 2018 · 6 comments · May be fixed by #34

Comments

@LukasKalbertodt
Copy link
Owner

Currently, --format=json is not supported. This should change.

@janosimas
Copy link

Any plans for this?

@LukasKalbertodt
Copy link
Owner Author

I don't have plans to tackle this any time soon. What's your use case for it?

@janosimas
Copy link

I want to parse the output to use in a dashboard

@Dinnerbone
Copy link

We should stick to the same format as the official test harness uses to allow drop-in replacement for tools that rely on it (like IDEs) - rust-lang/rust#49359

@LukasKalbertodt
Copy link
Owner Author

I just read the tracking issue for this feature again and it seems like libtest's JSON output is not really all that great. And certainly not close to stabilization from what I can tell.

So I worry that adding this to libtest-mimic lots of maintenance work as the output has to be adjusted to the latest nightly or whatever. On the other hand, the output doesn't seem to have changed a lot. So maybe it's fine.

@LukasKalbertodt
Copy link
Owner Author

For reference, the output for tests/real/mixed_bag.rs is:

{ "type": "suite", "event": "started", "test_count": 8 }
{ "type": "test", "event": "started", "name": "blue" }
{ "type": "test", "event": "started", "name": "cat" }
{ "type": "test", "event": "started", "name": "cyan" }
{ "type": "test", "event": "started", "name": "dog" }
{ "type": "test", "event": "started", "name": "frog" }
{ "type": "test", "event": "started", "name": "owl" }
{ "type": "test", "event": "started", "name": "purple" }
{ "type": "test", "event": "started", "name": "red" }
{ "type": "test", "name": "cyan", "event": "ignored" }
{ "type": "test", "name": "cat", "event": "ok" }
{ "type": "test", "name": "frog", "event": "ignored" }
{ "type": "test", "name": "blue", "event": "failed", "stdout": "thread 'blue' panicked at 'sky fell down', mixed_bag.rs:32:5\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" }
{ "type": "test", "name": "owl", "event": "ignored" }
{ "type": "test", "name": "purple", "event": "ignored" }
{ "type": "test", "name": "dog", "event": "failed", "stdout": "thread 'dog' panicked at 'was not a good boy', mixed_bag.rs:11:5\n" }
{ "type": "test", "name": "red", "event": "ok" }
{ "type": "suite", "event": "failed", "passed": 2, "failed": 2, "ignored": 4, "measured": 0, "filtered_out": 0, "exec_time": 0.050418943 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants