diff --git a/tools/tests/docker-compose.field_compare.template.yaml b/tools/tests/docker-compose.field_compare.template.yaml index 8a789b109..941f0eab0 100644 --- a/tools/tests/docker-compose.field_compare.template.yaml +++ b/tools/tests/docker-compose.field_compare.template.yaml @@ -1,9 +1,13 @@ services: field-compare: - build: https://github.com/dglaeser/fieldcompare-action.git # use the docker container provided by fieldcompare + build: + context: {{ dockerfile_context }} + target: fieldcompare volumes: - {{ run_directory }}:/runs - command: - - /runs/{{ tutorial_folder }}/{{ precice_output_folder }} - - /runs/{{ tutorial_folder }}/{{ reference_output_folder }} - - "-rtol {{ tolerance }} --ignore-missing-reference-files --exclude-files reference-results-metadata.txt --ignore-unsupported-file-formats --diff" + command: > + /bin/bash -c "fieldcompare dir \ + --ignore-missing-reference-files --exclude-files reference-results-metadata.txt --ignore-unsupported-file-formats --diff \ + -rtol {{ tolerance }} \ + /runs/{{ tutorial_folder }}/{{ precice_output_folder }} \ + /runs/{{ tutorial_folder }}/{{ reference_output_folder }}" diff --git a/tools/tests/dockerfiles/ubuntu_2404/Dockerfile b/tools/tests/dockerfiles/ubuntu_2404/Dockerfile index 64f31db33..7cb218a7d 100644 --- a/tools/tests/dockerfiles/ubuntu_2404/Dockerfile +++ b/tools/tests/dockerfiles/ubuntu_2404/Dockerfile @@ -569,7 +569,7 @@ RUN cd /home/precice/aste && \ WORKDIR /home/precice -FROM solids4foam/solids4foam:v2.3-openfoam-v2412-latest as solids4foam +FROM solids4foam/solids4foam:v2.3-openfoam-v2412-latest AS solids4foam ARG PRECICE_UID=1000 ARG PRECICE_GID=1000 @@ -625,4 +625,7 @@ RUN git clone https://github.com/precice/openfoam-adapter.git &&\ cd openfoam-adapter && \ if [ -n "${OPENFOAM_ADAPTER_PR}" ]; then git fetch origin pull/${OPENFOAM_ADAPTER_PR}/head; fi && \ git checkout ${OPENFOAM_ADAPTER_REF} && \ - /usr/bin/openfoam2412 ./Allwmake -j $(nproc) \ No newline at end of file + /usr/bin/openfoam2412 ./Allwmake -j $(nproc) + +FROM python:3.14 AS fieldcompare +RUN pip install fieldcompare[all]==0.5.0 \ No newline at end of file diff --git a/tools/tests/systemtests/Systemtest.py b/tools/tests/systemtests/Systemtest.py index ff21b6796..f756b3ef8 100644 --- a/tools/tests/systemtests/Systemtest.py +++ b/tools/tests/systemtests/Systemtest.py @@ -399,6 +399,13 @@ def __get_field_compare_compose_file(self): 'precice_output_folder': PRECICE_REL_OUTPUT_DIR, 'reference_output_folder': PRECICE_REL_REFERENCE_DIR + "/" + self.reference_result.path.name.replace(".tar.gz", ""), 'tolerance': self.tolerance, + # The dockerfile_context value inside the templates is only + # used as a build context path and does not need to be + # absolute – it will be resolved relative to the system test + # directory. + 'dockerfile_context': ( + Path("..") / "tools" / "tests" / "dockerfiles" / Path(self.params_to_use.get("PLATFORM")) + ), } jinja_env = Environment(loader=FileSystemLoader(PRECICE_TESTS_DIR)) template = jinja_env.get_template(