Skip to content

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

Merged
Eric-Arellano merged 2 commits intopantsbuild:masterfrom
Eric-Arellano:test-exit-code
Aug 17, 2020
Merged

Preserve Pytest's exit code with ./pants test#10632
Eric-Arellano merged 2 commits intopantsbuild:masterfrom
Eric-Arellano:test-exit-code

Conversation

@Eric-Arellano
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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.

3 participants