Most tutorials work as system tests by navigating into each and running ./run.sh.
However, some tutorials provide alternatives that we should also test, and which require running some script to modify configuration files before starting the simulation.
In the following tutorials:
we have a set-case.sh script, which we want to standardize. This script can take arguments. For example, ./set-case.sh 3d1d switches the precice-config.xml symlink to point to precice-config-3d-1d.xml.
It would be nice to be able to write the following in the [tests.yaml](https://github.com/precice/tutorials/blob/develop/tools/tests/tests.yaml:
water-hammer:
tutorials:
- &water-hammer_fluid1d-left-nutils_fluid3d-right-openfoam
path: water-hammer
case_combination:
- fluid1d-left-nutils
- fluid3d-right-openfoam
+ run-before: ./set-case.sh 1d3d
max_time: 0.05
reference_result: ./water-hammer/reference-results/fluid1d-left-nutils_fluid3d-right-openfoam.tar.gz
Note that, in this example, we define four participants in the metadata.yaml, but in reality, only two are needed to construct the case. We could rename the participants in metadata.yaml (only) to Left and Right.
While implementing this, it might be easy to also add a run-after, for any post-processing.
Most tutorials work as system tests by navigating into each and running
./run.sh.However, some tutorials provide alternatives that we should also test, and which require running some script to modify configuration files before starting the simulation.
In the following tutorials:
we have a
set-case.shscript, which we want to standardize. This script can take arguments. For example,./set-case.sh 3d1dswitches theprecice-config.xmlsymlink to point toprecice-config-3d-1d.xml.It would be nice to be able to write the following in the [
tests.yaml](https://github.com/precice/tutorials/blob/develop/tools/tests/tests.yaml:water-hammer: tutorials: - &water-hammer_fluid1d-left-nutils_fluid3d-right-openfoam path: water-hammer case_combination: - fluid1d-left-nutils - fluid3d-right-openfoam + run-before: ./set-case.sh 1d3d max_time: 0.05 reference_result: ./water-hammer/reference-results/fluid1d-left-nutils_fluid3d-right-openfoam.tar.gzNote that, in this example, we define four participants in the
metadata.yaml, but in reality, only two are needed to construct the case. We could rename the participants inmetadata.yaml(only) toLeftandRight.While implementing this, it might be easy to also add a
run-after, for any post-processing.