Repository navigation
Fix filenames in tests and examples, support complex float vectors in JSON schema - #1951
Open
franzpoeschel wants to merge 18 commits into
Open
franzpoeschel wants to merge 18 commits into
franzpoeschel wants to merge 18 commits into
Conversation
Rename the config files used by the parallel JSON-config test so that they do not clash with the identically named files written by the serial test when CTest runs both executables in parallel.
Move the files created by the core unit tests and the Python API tests from the current working directory into ../samples. Give the 'unavailable backend' test files unique names so they do not collide with the ones of the parallel I/O tests.
Add a source check that verifies that data files created by tests and examples are written below ../samples and that no output filename is used by more than one source file.
The serial and parallel append-mode tests both wrote to ../samples/append and removed that directory before each run, so the two executables raced when CTest ran them in parallel. Give the parallel test its own ../samples/append_parallel directory.
Extend the filename check to require that output directories below ../samples are not shared between source files. This catches conflicts such as the append-mode tests whose filenames are assembled dynamically and were therefore not seen by the filename-only check.
Filenames are frequently built as "../samples/prefix_" + extension. Check such prefixes for uniqueness across source files too.
The static source scan was too finicky. It will be replaced by a runtime check that verifies, after the test suite has run, that no files were written outside the samples directory.
Add test/check_test_output.sh which scans the tests' working directory (the build runtime output directory) for openPMD data files and directories and fails if any were written outside of the samples directory. Invoke it after ctest in the Linux Python/HDF5/ADIOS2 job.
…mples This test assembled its filename dynamically and was missed when moving the other test outputs into the samples directory, leaving electrons.h5, electrons.bp, electrons.bp4 and electrons.json in the build directory.
The wrapper test wrote particle patches without the numParticlesOffset, offset and extent components required by the openPMD standard. The output constructor and modification tests wrote non-standard custom meshesPath and particlesPath values; reset them to the defaults after the assertions so that the written files remain valid.
Rename the config written by the parallel JSON configuration test so that it ends in config.json and is therefore skipped by the JSON schema check, like the equivalent file of the serial test.
The JSON backend represents complex numbers as a two-element array of their real and imaginary part. The schema rejected these for vectors of complex numbers (nested arrays) and for constant datasets (array instead of number). Disambiguate by the declared datatype so that complex values are accepted while real values are still checked strictly.
franzpoeschel
force-pushed
the
fix-test-example-filenames
branch
from
October 15, 2026 13:26
ce7c518 to
697bf29
Compare
Depending on the test registration order, use_count_test can be the last writer of new_openpmd_output.json and its incomplete particle patches were then picked up by the JSON schema check.
This test also wrote a particlePatches group and, like the other core tests, only populated a subset of the standard components. Depending on the test order it could be the last writer of MyOutput_42.json, which then failed the JSON schema check.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Files should go under
samples/, files should not be duplicate across tests.This uncovered a gap in the JSON schema, it did not recognize complex float vectors so far.
TODO:
checkTestFilenamesis probably too finicky. I'll let it run through the CI once and then remove it again.