-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
Add duration and cache source to test output. #13889
Conversation
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
@riisi Thanks for this contribution! I think a lot of users will love this, and it helps demonstrate one of the major benefits of Pants. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @riisi! This looks great.
# TODO: What should be here? | ||
result_metadata=ProcessResultMetadata(None, "", 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I think that:
- this case of failed compilation (where the test process didn't even start)
- the case of a skipped test (
TestResult.skip
)
...could maybe both be joined into an explicit yellow "was skipped" state for the test. For now, it seems simple enough to make the result_metadata
optional (result_metadata: ProcessResultMetadata | None
), and to then render the skipped
sigil for tests with no metadata:
pants/src/python/pants/core/goals/lint.py
Lines 242 to 244 in 7e65826
if results.skipped: | |
sigil = console.sigil_skipped() | |
status = "skipped" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure how to replicate skipped tests for Python. I think in the case of using pytest.mark.skip
to skip a module, then pytest exits with non-0 code - I think this has been discussed in Slack before.
Haven't tested failed compilation yet.
Thanks for this @stuhood. I'll start taking a look now - internet access maybe a bit restricted over holiday period though. |
Co-authored-by: Stu Hood <stuhood@gmail.com>
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
Some mypy issues to fix - can look into this further. Pushed what I have for now. |
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
I've fixed the typing issues, and added output support for skipped tests. Thanks a lot for the contribution! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet! Thanks!
Fixes pantsbuild#13588. [ci skip-rust] [ci skip-build-wheels]
Thanks @stuhood ! 👏 |
…call to _format_test_summary follow up for pantsbuild#13889
Fixes #13588.
[ci skip-rust]
[ci skip-build-wheels]