Skip to content

Commit 3c2623a

Browse files
committed
Updated test helpers to force a cpu-benchmark rebuild,
via an ugly in-place rewrite of setup.py
1 parent 4557d0d commit 3c2623a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/test_helpers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ def _install_WfCommons_on_container(container):
4242
# Cleanup files from the host
4343
exit_code, output = container.exec_run("sudo /bin/rm -rf /tmp/WfCommons/build/", stdout=True, stderr=True)
4444
exit_code, output = container.exec_run("sudo /bin/rm -rf /tmp/WfCommons/*.egg-info/", stdout=True, stderr=True)
45+
# Clean up and force a rebuild of cpu-benchmark (because it may be compiled for the wrong architecture)
4546
exit_code, output = container.exec_run("sudo /bin/rm -rf /tmp/WfCommons/bin/cpu-benchmark.o", stdout=True,
4647
stderr=True)
4748
exit_code, output = container.exec_run("sudo /bin/rm -rf /tmp/WfCommons/bin/cpu-benchmark", stdout=True,
4849
stderr=True)
50+
exit_code, output = container.exec_run(r"sudo sed -i 's|if os.path.exists(cpu_benchmark_path):|if True:|' /tmp/WfCommons/setup.py")
4951

5052
# Install WfCommons on the container (to install wfbench and cpu-benchmark really)
51-
exit_code, output = container.exec_run("sudo python3 -m pip install . --break-system-packages",
53+
exit_code, output = container.exec_run("sudo python3 -m pip install -v . --break-system-packages",
5254
workdir="/tmp/WfCommons", stdout=True, stderr=True)
5355
if exit_code != 0:
5456
raise RuntimeError("Failed to install WfCommons on the container")
@@ -88,6 +90,7 @@ def _start_docker_container(backend, mounted_dir, working_dir, bin_dir, command=
8890
stdout=True, stderr=True)
8991
if exit_code != 0:
9092
raise RuntimeError("Failed to copy wfbench script to the bin directory")
93+
9194
exit_code, output = container.exec_run(["sh", "-c", "sudo cp -f `which cpu-benchmark` " + bin_dir],
9295
stdout=True, stderr=True)
9396
if exit_code != 0:

0 commit comments

Comments
 (0)