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

Also report file names #47

Open
svenstaro opened this issue Apr 30, 2021 · 3 comments
Open

Also report file names #47

svenstaro opened this issue Apr 30, 2021 · 3 comments

Comments

@svenstaro
Copy link
Contributor

It would be neat if this tool could also extract the filenames of the thing that's being tested (in the case of integration tests). For example:

     Running unittests (target/debug/deps/generate_openapi_spec-e3bc6e08330e8181)
{ "type": "suite", "event": "started", "test_count": 0 }
{ "type": "suite", "event": "ok", "passed": 0, "failed": 0, "allowed_fail": 0, "ignored": 0, "measured": 0, "filtered_out": 0, "exec_time": 0.000019477 }
     Running tests/test_api_openapi.rs (target/debug/deps/test_api_openapi-53c722415f8c53df)
{ "type": "suite", "event": "started", "test_count": 1 }
{ "type": "test", "event": "started", "name": "read::can_read" }
{ "type": "test", "name": "read::can_read", "event": "ok" }
{ "type": "suite", "event": "ok", "passed": 1, "failed": 0, "allowed_fail": 0, "ignored": 0, "measured": 0, "filtered_out": 0, "exec_time": 0.06092743 }

As we can see, we can extract the filenames from that text. These would then end up in <testcase file=tests/test_api_openapi.rs/> which I think would be quite neat. GitLab can actually display those: https://gitlab.com/gitlab-org/gitlab/-/issues/119032

@kristof-mattei
Copy link

@svenstaro does that work when using --test-threads?

@svenstaro
Copy link
Contributor Author

Hm good question and I actually don't know.

@kristof-mattei
Copy link

kristof-mattei commented Feb 4, 2022

I was looking into the source code of cargo test to see if we can extend the json format one way or another to include this on the line itself, removing all ambiguity.

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

No branches or pull requests

2 participants