mirror of
https://github.com/rust-vmm/rust-vmm-ci.git
synced 2026-08-05 03:08:31 +00:00
Coverage test: keep stdin open
Pytest closes stdin by default, so any processes spawned from it won't have it. As some tests in various rust-vmm crates might need stdin to be open, we mock it with a (currently empty) byte stream, which we can extend in the future. Signed-off-by: Alexandra Iordache <aghecen@amazon.com>
This commit is contained in:
committed by
Laura Loghin
parent
2d3bb056ce
commit
265df53b5c
@@ -79,7 +79,9 @@ def _get_current_coverage(coverage_config):
|
||||
exclude_pattern
|
||||
)
|
||||
|
||||
subprocess.run(kcov_cmd, shell=True, check=True)
|
||||
# Pytest closes stdin by default, but some tests might need it to be open.
|
||||
# In the future, should the need arise, we can feed custom data to stdin.
|
||||
subprocess.run(kcov_cmd, shell=True, check=True, input=b'')
|
||||
|
||||
# Read the coverage reported by kcov.
|
||||
coverage_file = os.path.join(kcov_output_dir, 'index.js')
|
||||
|
||||
Reference in New Issue
Block a user