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

Preserve Pytest's exit code with ./pants test #10632

Merged
merged 2 commits into from Aug 17, 2020

Conversation

Eric-Arellano
Copy link
Contributor

@Eric-Arellano Eric-Arellano commented Aug 16, 2020

This allows us to output the original exit code to the user, which is helpful because Pytest codes are significant.

This PR also fixes an issue with test --debug unintentionally running on conftest.py files. Per #10619, we special case that file to skip it.

[ci skip-rust]
[ci skip-build-wheels]

# 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]
@Eric-Arellano Eric-Arellano changed the title Preserve Pytest's exist code with ./pants test Preserve Pytest's exit code with ./pants test Aug 16, 2020
[ci skip-rust]
[ci skip-build-wheels]
@coveralls
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling 89c45e5 on Eric-Arellano:test-exit-code into daf80c4 on pantsbuild:master.

@Eric-Arellano Eric-Arellano merged commit 1e1190d into pantsbuild:master Aug 17, 2020
@Eric-Arellano Eric-Arellano deleted the test-exit-code branch August 17, 2020 18:13
@stuhood
Copy link
Sponsor Member

stuhood commented Aug 17, 2020

This looks good, although I do wonder whether the null object pattern here ("skipped" is playing the role of null) is the best fit. Would it be better to have an OptionalTestResult wrapper type here instead, to avoid complicating the internals of the type?

@Eric-Arellano
Copy link
Contributor Author

Oh, sorry I merged before seeing that review. There are further tweaks to the model for streaming tests to work, which I'm about to put up. Let's discuss there.

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

Successfully merging this pull request may close these issues.

None yet

3 participants