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

Include crate/package name in cargo test -- --format=json output #13553

Closed
HKalbasi opened this issue Mar 6, 2024 · 1 comment
Closed

Include crate/package name in cargo test -- --format=json output #13553

HKalbasi opened this issue Mar 6, 2024 · 1 comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.

Comments

@HKalbasi
Copy link
Member

HKalbasi commented Mar 6, 2024

Problem

Currently, it is very hard (impossible?) to distinguish between events of tests with similar name in different crates in a cargo workspace cargo test -- --format=json output.

Proposed Solution

Include crate or package name inside the event. That is, current state:

{ "type": "suite", "event": "started", "test_count": 760 }
{ "type": "test", "event": "started", "name": "some_test" }
{ "type": "suite", "event": "ok", "passed": 1, "failed": 0, "ignored": 0, "measured": 0, "filtered_out": 0, "exec_time": 0.002828253 }
{ "type": "suite", "event": "started", "test_count": 760 }
{ "type": "test", "event": "started", "name": "some_test" }
{ "type": "suite", "event": "ok", "passed": 1, "failed": 0, "ignored": 0, "measured": 0, "filtered_out": 0, "exec_time": 0.002828253 }

becomes:

{ "crate": "crate1", "type": "suite", "event": "started", "test_count": 760 }
{ "crate": "crate1", "type": "test", "event": "started", "name": "some_test" }
{ "crate": "crate1", "type": "suite", "event": "ok", "passed": 1, "failed": 0, "ignored": 0, "measured": 0, "filtered_out": 0, "exec_time": 0.002828253 }
{ "crate": "crate2", "type": "suite", "event": "started", "test_count": 760 }
{ "crate": "crate2", "type": "test", "event": "started", "name": "some_test" }
{ "crate": "crate2", "type": "suite", "event": "ok", "passed": 1, "failed": 0, "ignored": 0, "measured": 0, "filtered_out": 0, "exec_time": 0.002828253 }

Notes

No response

@HKalbasi HKalbasi added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Mar 6, 2024
@weihanglo
Copy link
Member

Thanks for the report. This unstable JSON output is currently under re-design and experimental process. This will be implemented outside Cargo. (and it's never Cargo controling that. It's libtest inside rustc)

You can read the RFC 3558, and follow the tracking issue rust-lang/testing-devex-team#1.

Close in favor of rust-lang/testing-devex-team#1.

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

2 participants