|
6 | 6 | from pathlib import Path |
7 | 7 | from paths import PRECICE_REL_OUTPUT_DIR, PRECICE_TOOLS_DIR, PRECICE_REL_REFERENCE_DIR, PRECICE_TESTS_DIR, PRECICE_TUTORIAL_DIR |
8 | 8 |
|
9 | | -FIELDCOMPARE_DIFFS_DIR = "fieldcompare-diffs" |
| 9 | +DIFF_RESULTS_DIR = "diff-results" |
10 | 10 |
|
11 | 11 | from metadata_parser.metdata import Tutorial, CaseCombination, Case, ReferenceResult |
12 | 12 | from .SystemtestArguments import SystemtestArguments |
@@ -417,16 +417,18 @@ def _run_field_compare(self): |
417 | 417 |
|
418 | 418 | def __archive_fieldcompare_diffs(self): |
419 | 419 | """ |
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). |
422 | 422 | """ |
423 | 423 | precice_exports = self.system_test_dir / PRECICE_REL_OUTPUT_DIR |
424 | 424 | if not precice_exports.exists(): |
425 | 425 | 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)) |
427 | 429 | if not diff_files: |
428 | 430 | return |
429 | | - dest_dir = self.system_test_dir / FIELDCOMPARE_DIFFS_DIR |
| 431 | + dest_dir = self.system_test_dir / DIFF_RESULTS_DIR |
430 | 432 | dest_dir.mkdir(exist_ok=True) |
431 | 433 | for f in diff_files: |
432 | 434 | if f.is_file(): |
@@ -583,10 +585,10 @@ def run(self, run_directory: Path): |
583 | 585 | fieldcompare_time=0) |
584 | 586 |
|
585 | 587 | fieldcompare_result = self._run_field_compare() |
586 | | - self.__archive_fieldcompare_diffs() |
587 | 588 | std_out.extend(fieldcompare_result.stdout_data) |
588 | 589 | std_err.extend(fieldcompare_result.stderr_data) |
589 | 590 | if fieldcompare_result.exit_code != 0: |
| 591 | + self.__archive_fieldcompare_diffs() |
590 | 592 | self.__write_logs(std_out, std_err) |
591 | 593 | logging.critical(f"Fieldcompare returned non zero exit code, therefore {self} failed") |
592 | 594 | return SystemtestResult( |
|
0 commit comments