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

[WIP] Remove subprocess usage from discovery #301

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mtreinish
Copy link
Owner

This commit removes the usage of subprocess from the discovery/list test
phase in TestProcessor. Previously to get a list of tests from discovery
we would subprocess out to a new python interpreter calling the subunit
runner with the list command and capture stdout from process and parse
that sububit stream to get the test ids. However, this was not strictly
necessary as we're not doing anything in parallel, so we should be able
to just call the subunit_runner directly inline and use an in memory
buffer instead of stdout. This has the advantage of not interfering
with sys.stdout, in the previous method if anything besides the
subunit_runner was printing to stdout it would cause a parser error
because of the non-subunit data mixed into the stream.

This commit removes the usage of subprocess from the discovery/list test
phase in TestProcessor. Previously to get a list of tests from discovery
we would subprocess out to a new python interpreter calling the subunit
runner with the list command and capture stdout from process and parse
that sububit stream to get the test ids. However, this was not strictly
necessary as we're not doing anything in parallel, so we should be able
to just call the subunit_runner directly inline and use an in memory
buffer instead of stdout. This has the advantage of not interfering
with sys.stdout, in the previous method if anything besides the
subunit_runner was printing to stdout it would cause a parser error
because of the non-subunit data mixed into the stream.
@mtreinish mtreinish changed the title Remove subprocess usage from discovery [WIP] Remove subprocess usage from discovery Feb 22, 2021
@mtreinish mtreinish added the on hold When a PR is blocked and should not be merged label Feb 22, 2021
@mtreinish
Copy link
Owner Author

This is still failing some tests, it looks like there is an issue when calling from a function with the import paths that we'll need to debug first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold When a PR is blocked and should not be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant