Skip to content

Commit 69b3f7f

Browse files
committed
Add workaround for running hpy tests under jacoco
1 parent 2136524 commit 69b3f7f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

mx.graalpython/downstream_tests.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,18 @@ def downstream_test_hpy(graalpy, testdir=None, args=None, env=None, check=True,
7676
hpy_test_root = hpy_root / "test"
7777
venv = testdir / 'hpy_venv'
7878
run([graalpy, "-m", "venv", str(venv)])
79+
if graalpy.endswith('.sh'):
80+
# Workaround jacoco launcher creating broken venv
81+
venv_launcher_path = venv / "bin" / "graalpy.sh"
82+
launcher = venv_launcher_path.read_text()
83+
venv_launcher_path.unlink()
84+
launcher = launcher.replace(
85+
'--python.Executable=',
86+
f'--python.Executable={venv_launcher_path.absolute()} --python.BaseExecutable=',
87+
)
88+
venv_launcher_path.write_text(launcher)
89+
venv_launcher_path.chmod(0o755)
90+
run([str(venv_launcher_path), '-m', 'ensurepip', '--default-pip'])
7991
run_in_venv(venv, ["pip", "install", "pytest", "pytest-xdist", "pytest-rerunfailures!=16.0", "filelock"])
8092
env = env or os.environ.copy()
8193
env["SETUPTOOLS_SCM_PRETEND_VERSION"] = "0.9.0"

0 commit comments

Comments
 (0)