Skip to content

Commit 44fb3ea

Browse files
Archive fieldcompare diffs only on failure, use diff-results/ and extension-specific globs
1 parent fe1f2cb commit 44fb3ea

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

changelog-entries/441.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- Archive fieldcompare diff VTK files into a `fieldcompare-diffs/` folder in each systemtest run directory so they are easy to find in CI artifacts when investigating comparison failures (fixes [#441](https://github.com/precice/tutorials/issues/441)).
1+
- Archive fieldcompare diff VTK files into a `diff-results/` folder in each systemtest run directory on failure so they are easy to find in CI artifacts when investigating comparison failures (fixes [#441](https://github.com/precice/tutorials/issues/441)).

tools/tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ In this case, building and running seems to work out, but the tests fail because
105105

106106
The easiest way to debug a systemtest run is first to have a look at the output written into the action on GitHub.
107107
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. When fieldcompare runs with `--diff`, it writes VTK diff files; these are copied into a `fieldcompare-diffs/` subfolder in the same run directory so you can open them (e.g. in ParaView) to see where results differ from the reference.
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. When fieldcompare runs with `--diff`, it writes VTK diff files; these are copied into a `diff-results/` subfolder in the same run directory so you can open them (e.g. in ParaView) to see where results differ from the reference.
109109

110110
## Adding new tests
111111

tools/tests/systemtests/Systemtest.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pathlib import Path
77
from paths import PRECICE_REL_OUTPUT_DIR, PRECICE_TOOLS_DIR, PRECICE_REL_REFERENCE_DIR, PRECICE_TESTS_DIR, PRECICE_TUTORIAL_DIR
88

9-
FIELDCOMPARE_DIFFS_DIR = "fieldcompare-diffs"
9+
DIFF_RESULTS_DIR = "diff-results"
1010

1111
from metadata_parser.metdata import Tutorial, CaseCombination, Case, ReferenceResult
1212
from .SystemtestArguments import SystemtestArguments
@@ -417,16 +417,18 @@ def _run_field_compare(self):
417417

418418
def __archive_fieldcompare_diffs(self):
419419
"""
420-
Copy fieldcompare diff VTK files from precice-exports into fieldcompare-diffs/
421-
so they are easy to find in CI artifacts (issue #441).
420+
Copy fieldcompare diff VTK files from precice-exports into diff-results/
421+
so they are easy to find in CI artifacts when investigating failures (issue #441).
422422
"""
423423
precice_exports = self.system_test_dir / PRECICE_REL_OUTPUT_DIR
424424
if not precice_exports.exists():
425425
return
426-
diff_files = list(precice_exports.glob("diff_*")) + list(precice_exports.glob("*_diff.*"))
426+
diff_files = []
427+
for pattern in ("*diff*.vtu", "*diff*.vtk", "*diff*.vtp"):
428+
diff_files.extend(precice_exports.glob(pattern))
427429
if not diff_files:
428430
return
429-
dest_dir = self.system_test_dir / FIELDCOMPARE_DIFFS_DIR
431+
dest_dir = self.system_test_dir / DIFF_RESULTS_DIR
430432
dest_dir.mkdir(exist_ok=True)
431433
for f in diff_files:
432434
if f.is_file():
@@ -583,10 +585,10 @@ def run(self, run_directory: Path):
583585
fieldcompare_time=0)
584586

585587
fieldcompare_result = self._run_field_compare()
586-
self.__archive_fieldcompare_diffs()
587588
std_out.extend(fieldcompare_result.stdout_data)
588589
std_err.extend(fieldcompare_result.stderr_data)
589590
if fieldcompare_result.exit_code != 0:
591+
self.__archive_fieldcompare_diffs()
590592
self.__write_logs(std_out, std_err)
591593
logging.critical(f"Fieldcompare returned non zero exit code, therefore {self} failed")
592594
return SystemtestResult(

0 commit comments

Comments
 (0)