From 7d52ae3eed5372feb359fd49ecab32bd6d95cb30 Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Sun, 8 Mar 2026 21:41:48 +0530 Subject: [PATCH 1/7] systemtests: fix Python bindings version ignored due to tutorial venv (fixes #584) --- changelog-entries/584.md | 1 + tools/tests/component-templates/fenics-adapter.yaml | 2 ++ tools/tests/component-templates/nutils-adapter.yaml | 2 ++ tools/tests/component-templates/python-bindings.yaml | 2 ++ tools/tests/dockerfiles/ubuntu_2404/Dockerfile | 8 +++++++- 5 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 changelog-entries/584.md diff --git a/changelog-entries/584.md b/changelog-entries/584.md new file mode 100644 index 000000000..9cdbe4078 --- /dev/null +++ b/changelog-entries/584.md @@ -0,0 +1 @@ +- Fix Python bindings version being ignored in system tests: permanently activate `/home/precice/venv` in the `python_bindings` Docker stage via `VIRTUAL_ENV` and `PATH` env vars, and set `PRECICE_TUTORIALS_NO_VENV=1` in `python-bindings` and `fenics-adapter` component templates so tutorial run scripts skip creating their own venv and use the version installed by the Docker image (fixes #584). diff --git a/tools/tests/component-templates/fenics-adapter.yaml b/tools/tests/component-templates/fenics-adapter.yaml index 220a52525..d8ddaa4ee 100644 --- a/tools/tests/component-templates/fenics-adapter.yaml +++ b/tools/tests/component-templates/fenics-adapter.yaml @@ -5,6 +5,8 @@ build: - {{key}}={{value}} {% endfor %} target: fenics_adapter +environment: + - PRECICE_TUTORIALS_NO_VENV=1 depends_on: prepare: condition: service_completed_successfully diff --git a/tools/tests/component-templates/nutils-adapter.yaml b/tools/tests/component-templates/nutils-adapter.yaml index 5893c65a7..0cc3eabeb 100644 --- a/tools/tests/component-templates/nutils-adapter.yaml +++ b/tools/tests/component-templates/nutils-adapter.yaml @@ -5,6 +5,8 @@ build: - {{key}}={{value}} {% endfor %} target: nutils_adapter +environment: + - PRECICE_TUTORIALS_NO_VENV=1 depends_on: prepare: condition: service_completed_successfully diff --git a/tools/tests/component-templates/python-bindings.yaml b/tools/tests/component-templates/python-bindings.yaml index 3cd65d274..8cf409492 100644 --- a/tools/tests/component-templates/python-bindings.yaml +++ b/tools/tests/component-templates/python-bindings.yaml @@ -5,6 +5,8 @@ build: - {{key}}={{value}} {% endfor %} target: python_bindings +environment: + - PRECICE_TUTORIALS_NO_VENV=1 depends_on: prepare: condition: service_completed_successfully diff --git a/tools/tests/dockerfiles/ubuntu_2404/Dockerfile b/tools/tests/dockerfiles/ubuntu_2404/Dockerfile index 8e067fbda..98c24c446 100644 --- a/tools/tests/dockerfiles/ubuntu_2404/Dockerfile +++ b/tools/tests/dockerfiles/ubuntu_2404/Dockerfile @@ -91,7 +91,9 @@ WORKDIR /home/precice RUN python3 -m venv /home/precice/venv && \ . /home/precice/venv/bin/activate && \ pip3 install git+https://github.com/precice/python-bindings.git@${PYTHON_BINDINGS_REF} && \ - pip3 install matplotlib + pip3 install matplotlib +ENV VIRTUAL_ENV="/home/precice/venv" +ENV PATH="/home/precice/venv/bin:$PATH" FROM precice_dependecies AS fenics_adapter COPY --from=python_bindings /home/precice/.local /home/precice/.local @@ -105,6 +107,8 @@ ARG FENICS_ADAPTER_REF RUN python3 -m venv --system-site-packages /home/precice/venv && \ . /home/precice/venv/bin/activate && \ pip3 install git+https://github.com/precice/fenics-adapter.git@${FENICS_ADAPTER_REF} +ENV VIRTUAL_ENV="/home/precice/venv" +ENV PATH="/home/precice/venv/bin:$PATH" FROM precice_dependecies AS nutils_adapter @@ -114,6 +118,8 @@ USER precice RUN python3 -m venv /home/precice/venv && \ . /home/precice/venv/bin/activate && \ pip3 install nutils +ENV VIRTUAL_ENV="/home/precice/venv" +ENV PATH="/home/precice/venv/bin:$PATH" FROM precice_dependecies AS calculix_adapter From ad161eda342eaa9ce9dc06c50e4e9b5fc9479b2f Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Mon, 9 Mar 2026 00:35:38 +0530 Subject: [PATCH 2/7] systemtests: add precice import sanity check when PRECICE_TUTORIALS_NO_VENV is set --- tools/tests/component-templates/fenics-adapter.yaml | 3 ++- tools/tests/component-templates/nutils-adapter.yaml | 3 ++- tools/tests/component-templates/python-bindings.yaml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/tests/component-templates/fenics-adapter.yaml b/tools/tests/component-templates/fenics-adapter.yaml index d8ddaa4ee..9061e17fe 100644 --- a/tools/tests/component-templates/fenics-adapter.yaml +++ b/tools/tests/component-templates/fenics-adapter.yaml @@ -13,6 +13,7 @@ depends_on: volumes: - {{ run_directory }}:/runs command: > - /bin/bash -c "id && + /bin/bash -c "id && + [ -n "$$PRECICE_TUTORIALS_NO_VENV" ] && (python3 -c 'import precice' || { echo 'ERROR: PRECICE_TUTORIALS_NO_VENV set but precice not importable. Check Docker image.'; exit 1; }) ; cd '/runs/{{ tutorial_folder }}/{{ case_folder }}' && {{ run }} | tee system-tests_{{ case_folder }}.log 2>&1" diff --git a/tools/tests/component-templates/nutils-adapter.yaml b/tools/tests/component-templates/nutils-adapter.yaml index 0cc3eabeb..4ead16627 100644 --- a/tools/tests/component-templates/nutils-adapter.yaml +++ b/tools/tests/component-templates/nutils-adapter.yaml @@ -13,6 +13,7 @@ depends_on: volumes: - {{ run_directory }}:/runs command: > - /bin/bash -c "id && + /bin/bash -c "id && + [ -n "$$PRECICE_TUTORIALS_NO_VENV" ] && (python3 -c 'import precice' || { echo 'ERROR: PRECICE_TUTORIALS_NO_VENV set but precice not importable. Check Docker image.'; exit 1; }) ; cd '/runs/{{ tutorial_folder }}/{{ case_folder }}' && {{ run }} | tee system-tests_{{ case_folder }}.log 2>&1" diff --git a/tools/tests/component-templates/python-bindings.yaml b/tools/tests/component-templates/python-bindings.yaml index 8cf409492..9b8b75848 100644 --- a/tools/tests/component-templates/python-bindings.yaml +++ b/tools/tests/component-templates/python-bindings.yaml @@ -13,6 +13,7 @@ depends_on: volumes: - {{ run_directory }}:/runs command: > - /bin/bash -c "id && + /bin/bash -c "id && + [ -n "$$PRECICE_TUTORIALS_NO_VENV" ] && (python3 -c 'import precice' || { echo 'ERROR: PRECICE_TUTORIALS_NO_VENV set but precice not importable. Check Docker image.'; exit 1; }) ; cd '/runs/{{ tutorial_folder }}/{{ case_folder }}' && {{ run }} | tee system-tests_{{ case_folder }}.log 2>&1" From a24e9a58f181bcdb545df6cf3ceb46176a40e17b Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Mon, 9 Mar 2026 00:39:55 +0530 Subject: [PATCH 3/7] systemtests: set PRECICE_TUTORIALS_NO_VENV in su2-adapter template; fix --system-site-packages typo in fluid-su2 run.sh --- flow-over-heated-plate/fluid-su2/run.sh | 2 +- tools/tests/component-templates/su2-adapter.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/flow-over-heated-plate/fluid-su2/run.sh b/flow-over-heated-plate/fluid-su2/run.sh index db3ab8b76..4788f832b 100755 --- a/flow-over-heated-plate/fluid-su2/run.sh +++ b/flow-over-heated-plate/fluid-su2/run.sh @@ -6,7 +6,7 @@ exec > >(tee --append "$LOGFILE") 2>&1 if [ ! -v PRECICE_TUTORIALS_NO_VENV ] then - python3 -m venv --system-site-package .venv + python3 -m venv --system-site-packages .venv . .venv/bin/activate pip install -r requirements.txt && pip freeze > pip-installed-packages.log fi diff --git a/tools/tests/component-templates/su2-adapter.yaml b/tools/tests/component-templates/su2-adapter.yaml index d466a949a..62096ce35 100644 --- a/tools/tests/component-templates/su2-adapter.yaml +++ b/tools/tests/component-templates/su2-adapter.yaml @@ -5,6 +5,8 @@ build: - {{key}}={{value}} {% endfor %} target: su2_adapter +environment: + - PRECICE_TUTORIALS_NO_VENV=1 depends_on: prepare: condition: service_completed_successfully From cc03099c584166ff2c87dc3bd6cd1af74e8243af Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Mon, 9 Mar 2026 00:40:53 +0530 Subject: [PATCH 4/7] fix: update changelog entry to reflect all changes in #584 fix --- changelog-entries/584.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog-entries/584.md b/changelog-entries/584.md index 9cdbe4078..ba4b3b72a 100644 --- a/changelog-entries/584.md +++ b/changelog-entries/584.md @@ -1 +1 @@ -- Fix Python bindings version being ignored in system tests: permanently activate `/home/precice/venv` in the `python_bindings` Docker stage via `VIRTUAL_ENV` and `PATH` env vars, and set `PRECICE_TUTORIALS_NO_VENV=1` in `python-bindings` and `fenics-adapter` component templates so tutorial run scripts skip creating their own venv and use the version installed by the Docker image (fixes #584). +- Fix Python bindings version being ignored in system tests: permanently activate `/home/precice/venv` in the `python_bindings`, `fenics_adapter`, and `nutils_adapter` Docker stages via `VIRTUAL_ENV` and `PATH` env vars; set `PRECICE_TUTORIALS_NO_VENV=1` in `python-bindings`, `fenics-adapter`, `nutils-adapter`, and `su2-adapter` component templates so tutorial run scripts skip creating their own venv and use the version installed by the Docker image; add a sanity check that fails fast if precice is not importable when the escape hatch is set; fix `--system-site-packages` typo in `flow-over-heated-plate/fluid-su2/run.sh` (fixes #584). From 9153bd355d1bc5e302c5785eb1e6a5113c98753c Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Mon, 9 Mar 2026 19:20:20 +0530 Subject: [PATCH 5/7] Add sanity check for precice importability when PRECICE_TUTORIALS_NO_VENV is set --- tools/tests/component-templates/fenics-adapter.yaml | 2 +- tools/tests/component-templates/nutils-adapter.yaml | 2 +- tools/tests/component-templates/python-bindings.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/tests/component-templates/fenics-adapter.yaml b/tools/tests/component-templates/fenics-adapter.yaml index 9061e17fe..c9c69225d 100644 --- a/tools/tests/component-templates/fenics-adapter.yaml +++ b/tools/tests/component-templates/fenics-adapter.yaml @@ -14,6 +14,6 @@ volumes: - {{ run_directory }}:/runs command: > /bin/bash -c "id && - [ -n "$$PRECICE_TUTORIALS_NO_VENV" ] && (python3 -c 'import precice' || { echo 'ERROR: PRECICE_TUTORIALS_NO_VENV set but precice not importable. Check Docker image.'; exit 1; }) ; + [ -n \"$$PRECICE_TUTORIALS_NO_VENV\" ] && (python3 -c 'import precice' || { echo 'ERROR: PRECICE_TUTORIALS_NO_VENV set but precice not importable. Check Docker image.'; exit 1; }) ; cd '/runs/{{ tutorial_folder }}/{{ case_folder }}' && {{ run }} | tee system-tests_{{ case_folder }}.log 2>&1" diff --git a/tools/tests/component-templates/nutils-adapter.yaml b/tools/tests/component-templates/nutils-adapter.yaml index 4ead16627..3f95501b4 100644 --- a/tools/tests/component-templates/nutils-adapter.yaml +++ b/tools/tests/component-templates/nutils-adapter.yaml @@ -14,6 +14,6 @@ volumes: - {{ run_directory }}:/runs command: > /bin/bash -c "id && - [ -n "$$PRECICE_TUTORIALS_NO_VENV" ] && (python3 -c 'import precice' || { echo 'ERROR: PRECICE_TUTORIALS_NO_VENV set but precice not importable. Check Docker image.'; exit 1; }) ; + [ -n \"$$PRECICE_TUTORIALS_NO_VENV\" ] && (python3 -c 'import precice' || { echo 'ERROR: PRECICE_TUTORIALS_NO_VENV set but precice not importable. Check Docker image.'; exit 1; }) ; cd '/runs/{{ tutorial_folder }}/{{ case_folder }}' && {{ run }} | tee system-tests_{{ case_folder }}.log 2>&1" diff --git a/tools/tests/component-templates/python-bindings.yaml b/tools/tests/component-templates/python-bindings.yaml index 9b8b75848..dca6cc558 100644 --- a/tools/tests/component-templates/python-bindings.yaml +++ b/tools/tests/component-templates/python-bindings.yaml @@ -14,6 +14,6 @@ volumes: - {{ run_directory }}:/runs command: > /bin/bash -c "id && - [ -n "$$PRECICE_TUTORIALS_NO_VENV" ] && (python3 -c 'import precice' || { echo 'ERROR: PRECICE_TUTORIALS_NO_VENV set but precice not importable. Check Docker image.'; exit 1; }) ; + [ -n \"$$PRECICE_TUTORIALS_NO_VENV\" ] && (python3 -c 'import precice' || { echo 'ERROR: PRECICE_TUTORIALS_NO_VENV set but precice not importable. Check Docker image.'; exit 1; }) ; cd '/runs/{{ tutorial_folder }}/{{ case_folder }}' && {{ run }} | tee system-tests_{{ case_folder }}.log 2>&1" From 00e12ea14adfa78c0053dd34ec09587752e13476 Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Mon, 9 Mar 2026 19:20:56 +0530 Subject: [PATCH 6/7] Update changelog to reflect su2-adapter and sanity check additions --- changelog-entries/584.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog-entries/584.md b/changelog-entries/584.md index ba4b3b72a..69df62ae7 100644 --- a/changelog-entries/584.md +++ b/changelog-entries/584.md @@ -1 +1 @@ -- Fix Python bindings version being ignored in system tests: permanently activate `/home/precice/venv` in the `python_bindings`, `fenics_adapter`, and `nutils_adapter` Docker stages via `VIRTUAL_ENV` and `PATH` env vars; set `PRECICE_TUTORIALS_NO_VENV=1` in `python-bindings`, `fenics-adapter`, `nutils-adapter`, and `su2-adapter` component templates so tutorial run scripts skip creating their own venv and use the version installed by the Docker image; add a sanity check that fails fast if precice is not importable when the escape hatch is set; fix `--system-site-packages` typo in `flow-over-heated-plate/fluid-su2/run.sh` (fixes #584). +- Fix Python bindings version being ignored in system tests: permanently activate `/home/precice/venv` in the `python_bindings`, `fenics_adapter`, and `nutils_adapter` Docker stages via `VIRTUAL_ENV` and `PATH` env vars; set `PRECICE_TUTORIALS_NO_VENV=1` in `python-bindings`, `fenics-adapter`, `nutils-adapter`, and `su2-adapter` component templates so tutorial run scripts skip creating their own venv; add a sanity check that fails fast if precice is not importable when the escape hatch is set (fixes #584). From fe393211007d210c4082d2e9c4ff012fe4773806 Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Sun, 15 Mar 2026 16:15:34 +0530 Subject: [PATCH 7/7] fix: align timeout constants with add-timeout-support; add precice sanity check to su2-adapter; fix semnantic typo --- tools/tests/component-templates/su2-adapter.yaml | 3 ++- tools/tests/components.yaml | 10 +++++----- tools/tests/systemtests/Systemtest.py | 8 ++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tools/tests/component-templates/su2-adapter.yaml b/tools/tests/component-templates/su2-adapter.yaml index 62096ce35..b46f4f39a 100644 --- a/tools/tests/component-templates/su2-adapter.yaml +++ b/tools/tests/component-templates/su2-adapter.yaml @@ -13,6 +13,7 @@ depends_on: volumes: - {{ run_directory }}:/runs command: > - /bin/bash -c "id && + /bin/bash -c "id && + [ -n \"$$PRECICE_TUTORIALS_NO_VENV\" ] && (python3 -c 'import precice' || { echo 'ERROR: PRECICE_TUTORIALS_NO_VENV set but precice not importable. Check Docker image.'; exit 1; }) ; cd '/runs/{{ tutorial_folder }}/{{ case_folder }}' && SU2_RUN="/home/precice/SU2_RUN/bin" PYTHONPATH="/home/precice/SU2_RUN/bin:$PYTHONPATH" {{ run }} | tee system-tests_{{ case_folder }}.log 2>&1" diff --git a/tools/tests/components.yaml b/tools/tests/components.yaml index bd29ba88f..d2c02bdb5 100644 --- a/tools/tests/components.yaml +++ b/tools/tests/components.yaml @@ -32,7 +32,7 @@ python-bindings: description: Tutorial git reference to use default: "master" PYTHON_BINDINGS_REF: - semnantic: Git ref of the Python bindings to use + description: Git ref of the Python bindings to use default: "master" openfoam-adapter: @@ -75,10 +75,10 @@ fenics-adapter: description: Tutorial git reference to use default: "master" PYTHON_BINDINGS_REF: - semnantic: Git ref of the Python bindings to use + description: Git ref of the Python bindings to use default: "master" FENICS_ADAPTER_REF: - semnantic: Git ref of the fenics adapter to use + description: Git ref of the fenics adapter to use default: "master" nutils-adapter: @@ -98,7 +98,7 @@ nutils-adapter: description: Tutorial git reference to use default: "master" PYTHON_BINDINGS_REF: - semnantic: Git ref of the Python bindings to use + description: Git ref of the Python bindings to use default: "master" calculix-adapter: @@ -190,7 +190,7 @@ dumux-adapter: description: Version of DuMux to use default: "3.7" DUMUX_ADAPTER_REF: - semnantic: Git ref of the dumux adapter to use + description: Git ref of the dumux adapter to use default: "main" micro-manager: diff --git a/tools/tests/systemtests/Systemtest.py b/tools/tests/systemtests/Systemtest.py index 6abc5a029..b70ebee48 100644 --- a/tools/tests/systemtests/Systemtest.py +++ b/tools/tests/systemtests/Systemtest.py @@ -19,7 +19,7 @@ import os -GLOBAL_TIMEOUT = 900 +BUILD_TIMEOUT = 900 SHORT_TIMEOUT = 10 @@ -394,7 +394,7 @@ def _run_field_compare(self): cwd=self.system_test_dir) try: - stdout, stderr = process.communicate(timeout=GLOBAL_TIMEOUT) + stdout, stderr = process.communicate(timeout=self.timeout) except KeyboardInterrupt as k: process.kill() raise KeyboardInterrupt from k @@ -439,7 +439,7 @@ def _build_docker(self): cwd=self.system_test_dir) try: - stdout, stderr = process.communicate(timeout=GLOBAL_TIMEOUT) + stdout, stderr = process.communicate(timeout=BUILD_TIMEOUT) except KeyboardInterrupt as k: process.kill() # process.send_signal(9) @@ -483,7 +483,7 @@ def _run_tutorial(self): cwd=self.system_test_dir) try: - stdout, stderr = process.communicate(timeout=GLOBAL_TIMEOUT) + stdout, stderr = process.communicate(timeout=self.timeout) except KeyboardInterrupt as k: process.kill() # process.send_signal(9)