You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Added optional `source` blocks in `tests.yaml` so system tests can load tutorials from external git repositories or archives ([#732](https://github.com/precice/tutorials/pull/732)).
Copy file name to clipboardExpand all lines: tools/tests/README.md
+41-7Lines changed: 41 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ Workflow for the preCICE v3 release testing:
36
36
37
37
6. Download the build artifacts from Summary > runs.
38
38
39
-
- In there, you may want to check the `stdout.log` and `stderr.log` files.
39
+
- In there, you may want to check the `system-tests-stdout.log` and `system-tests-stderr.log` files.
40
40
- The produced results are in`precice-exports/`, the reference results in`reference-results-unpacked`.
41
41
- Compare using, e.g., ParaView or [fieldcompare](https://gitlab.com/dglaeser/fieldcompare): `fieldcompare dir precice-exports/ reference/`. The `--diff` option will give you `precice-exports/diff_*.vtu` files, while you can also try different tolerances with `-rtol` and `-atol`.
42
42
@@ -105,7 +105,9 @@ In this case, building and running seems to work out, but the tests fail because
105
105
106
106
The easiest way to debug a systemtest run is first to have a look at the output written into the action on GitHub.
107
107
If this does not provide enough hints, the next step is to download the generated `system_tests_run_<run_id>_<run_attempt>` artifact. Note that by default this will only be generated if the systemtests fail.
108
-
Inside the archive, a test-specific subfolder like `flow-over-heated-plate_fluid-openfoam-solid-fenics_2023-11-19-211723` contains two log files: a `stderr.log` and `stdout.log`. This can be a starting point for a further investigation.
108
+
Inside the archive, a test-specific subfolder like `flow-over-heated-plate_fluid-openfoam-solid-fenics_2023-11-19-211723` contains two log files: `system-tests-stderr.log` and `system-tests-stdout.log`. This can be a starting point fora further investigation. When fieldcompare runs with `--diff`, it writes VTK diff files under `precice-exports/`; if the comparison fails, those files are copied into a `diff-results/` subfolderin the same run directory (mirroring any subpaths under `precice-exports/`) so you can open them (e.g. in ParaView) to see where results differ from the reference. On successful comparisons, `diff-results/` is therefore absent.
109
+
110
+
For implicit-coupling runs, `precice-*-iterations.log` files are collected into `iterations-logs/` and compared by hash against archived reference copies (stored next to each reference `.tar.gz`in a `*.iterations-logs/` directory, or legacy `.iterations-hashes.json` sidecars). A mismatch fails the test.
109
111
110
112
## Adding new tests
111
113
@@ -118,6 +120,8 @@ In order for the systemtests to pick up the tutorial we need to define a `metada
118
120
To add a testsuite just open the `tests.yaml` file and use the output of `python print_case_combinations.py` to add the right case combinations you want to test. Note that you can specify a `reference_result` which is not yet present. The `generate_reference_data.py` will pick that up and create it for you.
119
121
Note that its important to carefully check the paths of the `reference_result`in order to not have typos in there. Also note that same cases in different testsuites should use the same `reference_result`.
120
122
123
+
To cap the preCICE simulation time for a specific test without editing `precice-config.xml`, add an optional `max_time` (positive float, overrides `<max-time>`) or `max_time_windows` (positive integer, overrides `<max-time-windows>`) field to the tutorial entry. Applies to both test runs and reference result generation.
124
+
121
125
### Generate reference results
122
126
123
127
Since we need data to compare against, you need to run `python generate_reference_data.py`. This process might take a while.
@@ -167,7 +171,7 @@ Metadata and workflow/script files:
167
171
- ...
168
172
- `dockerfiles/`
169
173
- Multi-stage build Dockerfiles that define how to build each component, in a layered approach
170
-
- `docker-compose.template.yaml`: Describes how to prepare each test (Docker Componse service template)
174
+
- `docker-compose.template.yaml`: Describes how to prepare each test (Docker Compose service template)
171
175
- `docker-compose.field_compare.template.yaml`: Describes how to compare results with fieldcompare (Docker Compose service template)
172
176
- `components.yaml`: Declares the available components and their parameters/options
173
177
- `reference_results.metadata.template`: Template for reporting the versions used to generate the reference results
@@ -231,9 +235,9 @@ cases:
231
235
Description:
232
236
233
237
- `name`: A human-readable, descriptive name
234
-
- `path`: Where the tutorial is located, relative to the tutorials repository
238
+
- `path`: Where the tutorial is located, relative to the tutorials repository (or the tutorial folder name for external sources)
235
239
- `url`: A web page with more information on the tutorial
236
-
- `participants`: A list of preCICE participants, typically corresponing to different domains of the simulation
240
+
- `participants`: A list of preCICE participants, typically corresponding to different domains of the simulation
237
241
- `cases`: A list of solver configuration directories. Each element of the list includes:
238
242
- `participant`: Which participant this solver case can serve as
239
243
- `directory`: Where the case directory is located, relative to the tutorial directory
@@ -279,7 +283,9 @@ This `openfoam-adapter` component has the following attributes:
279
283
280
284
Since the docker containers are still a bit mixed in terms of capabilities and support for different build_argument combinations the following rules apply:
281
285
282
-
- A build_argument ending in **_REF** means that it refers to a git commit-ish (like a tag or commit) beeing used to build the image. Its important to not use branch names here as we heavily rely on dockers build cache to speedup things. But since the input variable to the docker builder will not change, we might have wrong cache hits.
286
+
- A build argument ending in `_REF` refers to a git commit-ish (like a tag or commit) being used to build the image. It is important to not use branch names here as we heavily rely on Docker's build cache to speedup things. But since the input variable to the docker builder will not change, we might have wrong cache hits.
287
+
- Some workflows set variables ending in`_PR`. These specify the GitHub pull request which provides the above `_REF` and can be on a fork.
288
+
- A build argument ending in`_VERSION` refers to the version of a third-party dependency to use (e.g., DUNE).
283
289
- All other build_arguments are free of rules and up to the container maintainer.
The optional `timeout` field (in seconds) sets the maximum timefor the solver run and fieldcompare phases of that specific case. If omitted, it defaults to `GLOBAL_TIMEOUT` (currently 900s, overridable via the `PRECICE_SYSTEMTESTS_TIMEOUT` environment variable).
344
+
345
+
#### External tutorial sources
346
+
347
+
By default, every `path` must exist in the local`precice/tutorials` checkout. For tutorials maintained elsewhere, add an optional `source` block:
348
+
349
+
```yaml
350
+
- path: flow-over-heated-plate
351
+
source:
352
+
type: git
353
+
url: https://github.com/precice/tutorials.git
354
+
ref: develop
355
+
subdir: .# optional subdirectory inside the repository
- `local` (default): use the tutorial from this repository.
365
+
- `git`: shallow-clone `url` at `ref` (cached under `~/.cache/precice-tutorials` or `PRECICE_EXTERNAL_CACHE_DIR`).
366
+
- `archive`: download and extract a `.tar.gz` / `.zip` from `url`.
367
+
368
+
The runner copies the resolved tutorial into the run directory, then continues with the usual Docker build/run and fieldcompare steps. `TUTORIALS_REF` / `TUTORIALS_PR` build arguments still apply only to **local** tutorials; external tutorials are pinned by `source.ref`.
369
+
336
370
This defines two test suites, namely `openfoam_adapter_pr` and `openfoam_adapter_release`. Each of them defines which case combinations of which tutorials to run.
337
371
338
372
### Generate Reference Results
339
373
340
374
#### via GitHub workflow (recommended)
341
375
342
-
The preferred way of adding reference results is via the manual triggerable `Generate reference results (manual)` workflow. This takes two inputs:
376
+
The preferred way of adding reference results is via the manual `Generate reference results (manual)` workflow. This takes two inputs:
343
377
344
378
- `from_ref`: branch where the new test configuration (e.g added tests, new reference_versions.yaml) is
345
379
- `commit_msg`: commit message for adding the reference results into the branch
0 commit comments