Skip to content

Commit

Permalink
testing: ensure we provide the test dir to pytest
Browse files Browse the repository at this point in the history
The RPM and vmcore test runners omitted the "tests" directoy. This meant
that pytest was searching the entire working directory for tests. This
is fine in CI tests, because there isn't much extra data in the git
checkout. But for local/developer test runs, this is a problem, because
the "testdata" directory contains lots of extra data, including
extracted RPMs which have some python code. This causes errors when
pytest attempts to collect and run tests from those files.

The heavyvm and litevm tests already provide the tests/ directory as a
command line argument.

Orabug: 37307170
Signed-off-by: Stephen Brennan <[email protected]>
  • Loading branch information
brenns10 committed Nov 21, 2024
1 parent 95b1a4f commit 61704f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions testing/rpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def do_test(ident: str, args: List[str], ctf: bool = False) -> str:
sys.executable,
"-m",
"pytest",
"tests/",
]
if ctf:
cmd.append("--ctf")
Expand Down
1 change: 1 addition & 0 deletions testing/vmcore/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def should_run_vmcore(name: str) -> bool:
sys.executable,
"-m",
"pytest",
"tests/",
f"--vmcore={core_name}",
f"--vmcore-dir={str(CORE_DIR)}",
f"--junitxml={xml_run.name}",
Expand Down

0 comments on commit 61704f2

Please sign in to comment.