Skip to content

System tests: Archive fieldcompare diff files on failure#740

Open
PranjalManhgaye wants to merge 3 commits into
precice:developfrom
PranjalManhgaye:issue-441-archive-fieldcompare-diffs
Open

System tests: Archive fieldcompare diff files on failure#740
PranjalManhgaye wants to merge 3 commits into
precice:developfrom
PranjalManhgaye:issue-441-archive-fieldcompare-diffs

Conversation

@PranjalManhgaye
Copy link
Copy Markdown
Contributor

@PranjalManhgaye PranjalManhgaye commented Mar 4, 2026

Summary

Implements #441: archive fieldcompare diff VTK files so they are easy to find in CI artifacts when a comparison fails.

Changes

  • tools/tests/systemtests/Systemtest.py: When fieldcompare fails, copy *diff*.vtu, *diff*.vtk, and *diff*.vtp files from precice-exports/ into a diff-results/ folder in the same run directory.
  • tools/tests/README.md: Document that diff files are copied into diff-results/ for inspection (e.g. in ParaView) when debugging comparison failures.

Checklist

  • I added a summary of any user-facing changes (compared to the last release) in the changelog-entries/441.md.
  • I will remember to squash-and-merge, providing a useful summary of the changes of this PR.

@MakisH MakisH added GSoC Contributed in the context of the Google Summer of Code systemtests labels Mar 6, 2026
@PranjalManhgaye PranjalManhgaye changed the title Archive fieldcompare diff files in fieldcompare-diffs/ (fixes #441) Archive fieldcompare diff files in fieldcompare-diffs/ only on failure (fixes #441) Mar 7, 2026
@PranjalManhgaye PranjalManhgaye changed the title Archive fieldcompare diff files in fieldcompare-diffs/ only on failure (fixes #441) Archive fieldcompare diff files in diff-results/ on failure (fixes #441) Mar 7, 2026
@PranjalManhgaye PranjalManhgaye force-pushed the issue-441-archive-fieldcompare-diffs branch from 44fb3ea to a904f4f Compare March 7, 2026 07:05
@precice-bot
Copy link
Copy Markdown
Collaborator

This pull request has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/gsoc-2026-pranjal-manhgaye/2769/6

@MakisH MakisH requested a review from Copilot May 12, 2026 21:29
@MakisH MakisH changed the title Archive fieldcompare diff files in diff-results/ on failure (fixes #441) System tests: Archive fieldcompare diff files in diff-results/ on failure May 12, 2026
@MakisH MakisH changed the title System tests: Archive fieldcompare diff files in diff-results/ on failure System tests: Archive fieldcompare diff files on failure May 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds automatic archiving of fieldcompare-generated VTK diff files into a dedicated folder to make CI artifact debugging easier when comparisons fail.

Changes:

  • Add logic to collect and copy *diff*.(vtu|vtk|vtp) files into diff-results/ when fieldcompare fails.
  • Invoke the archiving step during systemtest failure handling.
  • Document the new diff-results/ behavior in the systemtests README and add a changelog entry.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
tools/tests/systemtests/Systemtest.py Copies fieldcompare diff VTK files into diff-results/ on fieldcompare failure.
tools/tests/README.md Documents where to find diff VTK files in CI artifacts for debugging.
changelog-entries/441.md Notes the user-facing behavior change for archiving diff files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 6 to 11
from pathlib import Path
from paths import PRECICE_REL_OUTPUT_DIR, PRECICE_TOOLS_DIR, PRECICE_REL_REFERENCE_DIR, PRECICE_TESTS_DIR, PRECICE_TUTORIAL_DIR

DIFF_RESULTS_DIR = "diff-results"

from metadata_parser.metdata import Tutorial, CaseCombination, Case, ReferenceResult
Comment thread tools/tests/systemtests/Systemtest.py
Comment thread tools/tests/systemtests/Systemtest.py
Comment on lines +467 to +471
dest_dir = self.system_test_dir / DIFF_RESULTS_DIR
dest_dir.mkdir(exist_ok=True)
for f in diff_files:
if f.is_file():
shutil.copy2(f, dest_dir / f.name)
for f in diff_files:
if f.is_file():
shutil.copy2(f, dest_dir / f.name)
logging.debug(f"Archived {len(diff_files)} fieldcompare diff file(s) to {dest_dir} for {self}")
Comment thread tools/tests/README.md
The easiest way to debug a systemtest run is first to have a look at the output written into the action on GitHub.
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.
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.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoC Contributed in the context of the Google Summer of Code systemtests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants