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:
Alexandra Iordache
2020-09-09 12:41:08 +03:00
committed by Laura Loghin
parent 2d3bb056ce
commit 265df53b5c
+3 -1
View File
@@ -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')