From 4e59bca4aac45c194a342034074a5fc0ec4391cc Mon Sep 17 00:00:00 2001 From: Soeren Peters <peters@irmb.tu-bs.de> Date: Thu, 13 Apr 2023 14:02:14 +0000 Subject: [PATCH] Add fieldcompare and reference data. --- regression-tests/README.md | 5 ++++ regression-tests/driven_cavity_test.sh | 4 +++ .../driven_cavity_uniform_test.sh | 4 +++ regression-tests/regression-tests.sh | 28 ------------------- .../regression-tests-ci.yml.j2 | 1 + 5 files changed, 14 insertions(+), 28 deletions(-) create mode 100644 regression-tests/README.md delete mode 100755 regression-tests/regression-tests.sh diff --git a/regression-tests/README.md b/regression-tests/README.md new file mode 100644 index 000000000..adf89d802 --- /dev/null +++ b/regression-tests/README.md @@ -0,0 +1,5 @@ +# How to add a new regression test? +# 1. setup the specfic simulation and run it to create reference data. +# 2. fork https://github.com/irmb/test_data and create a pull request containing the reference data. +# 3. copy ./regression-tests/driven_cavity_test.sh and adjust the file accordingly to the new test scenario. +# 4. execute this file from here accordingly to #3. \ No newline at end of file diff --git a/regression-tests/driven_cavity_test.sh b/regression-tests/driven_cavity_test.sh index b8998e309..4fbe1a6fd 100755 --- a/regression-tests/driven_cavity_test.sh +++ b/regression-tests/driven_cavity_test.sh @@ -3,6 +3,10 @@ ################################# # Driven Cavity Regression Test ################################# +rm -r reference_data && mkdir -p reference_data +git clone --depth 1 --filter=blob:none --sparse https://github.com/irmb/test_data reference_data +cd reference_data +git sparse-checkout add regression_tests/gpu/DrivenCavity_2Levels # build VirtualFluids accordingly to our specific test scenario. # in this case adding -DUSER_APPS="apps/gpu/LBM/DrivenCavity to the cmake command is not necessary, because the DrivenCavity is added to VirtualFluids by default. diff --git a/regression-tests/driven_cavity_uniform_test.sh b/regression-tests/driven_cavity_uniform_test.sh index ae47c98af..94262af9e 100755 --- a/regression-tests/driven_cavity_uniform_test.sh +++ b/regression-tests/driven_cavity_uniform_test.sh @@ -3,6 +3,10 @@ ################################# # Driven Cavity Regression Test ################################# +rm -r reference_data && mkdir -p reference_data +git clone --depth 1 --filter=blob:none --sparse https://github.com/irmb/test_data reference_data +cd reference_data +git sparse-checkout add regression_tests/gpu/DrivenCavity_uniform # build VirtualFluids accordingly to our specific test scenario. # in this case adding -DUSER_APPS="apps/gpu/LBM/DrivenCavity to the cmake command is not necessary, because the DrivenCavity is added to VirtualFluids by default. diff --git a/regression-tests/regression-tests.sh b/regression-tests/regression-tests.sh deleted file mode 100755 index e4cb07c63..000000000 --- a/regression-tests/regression-tests.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -################################# -# VirtualFludis regression tests -################################# - - -# 1. Cloning the reference data from github -rm -r reference_data && mkdir -p reference_data -git clone https://github.com/irmb/test_data reference_data - -# 2. set up the python environnement -# by cloning our meshio patch and fieldcompare into a venv -python3 -m venv .venv -source .venv/bin/activate -pip install fieldcompare - -# 3. Running the specific tests -./regression-tests/driven_cavity_uniform_test.sh -./regression-tests/driven_cavity_test.sh - - - -# How to add a new regression test? -# 1. setup the specfic simulation and run it to create reference data. -# 2. fork https://github.com/irmb/test_data and create a pull request containing the reference data. -# 3. copy ./regression-tests/driven_cavity_test.sh and adjust the file accordingly to the new test scenario. -# 4. execute this file from here accordingly to #3. \ No newline at end of file diff --git a/utilities/ci-regression-tests/regression-tests-ci.yml.j2 b/utilities/ci-regression-tests/regression-tests-ci.yml.j2 index 000325a3e..0ec69187e 100644 --- a/utilities/ci-regression-tests/regression-tests-ci.yml.j2 +++ b/utilities/ci-regression-tests/regression-tests-ci.yml.j2 @@ -14,6 +14,7 @@ stages: before_script: - chmod +x ./regression-tests/* + - pip install fieldcompare {% for regression_test in regression_tests %} regression-test:{{ regression_test }}: -- GitLab