Skip to content

Commit

Permalink
CI: clean test dirs, reset collisionXZ checksums (#5120)
Browse files Browse the repository at this point in the history
* CI: add option to clean up test dirs

* Reset Checksum: `collisionXZ`

* Env Var Control: `WARPX_CI_CLEAN_TESTS`

---------

Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
  • Loading branch information
EZoni and ax3l authored Aug 8, 2024
1 parent 547794d commit 7d40963
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
1 change: 1 addition & 0 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
LAPACKPP_HOME: '/usr/local'
OMP_NUM_THREADS: 1
WARPX_CI_CCACHE: 'TRUE'
WARPX_CI_CLEAN_TESTS: 'TRUE'
WARPX_CI_NUM_MAKE_JOBS: 2
WARPX_CI_OPENPMD: 'TRUE'
WARPX_CI_TMP: '/tmp/ci'
Expand Down
24 changes: 12 additions & 12 deletions Regression/Checksum/benchmarks_json/collisionXZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
"Ey": 0.0,
"Ez": 0.0
},
"ion": {
"particle_momentum_x": 2.4932317055825563e-19,
"particle_momentum_y": 2.274916403334278e-19,
"particle_momentum_z": 2.2528161767665816e-19,
"particle_position_x": 2648815.601036139,
"particle_position_y": 2662836.7581390506,
"electron": {
"particle_momentum_x": 1.0618161248729303e-19,
"particle_momentum_y": 1.0331186403682394e-19,
"particle_momentum_z": 1.0375409035564829e-19,
"particle_position_x": 2652982.4592067804,
"particle_position_y": 2666143.4238272114,
"particle_weight": 1.7256099431746894e+26
},
"electron": {
"particle_momentum_x": 1.0489203687862582e-19,
"particle_momentum_y": 1.0209657029567292e-19,
"particle_momentum_z": 1.0248962872393911e-19,
"particle_position_x": 2657004.8285825616,
"particle_position_y": 2670174.272797987,
"ion": {
"particle_momentum_x": 2.4479519290953386e-19,
"particle_momentum_y": 2.2313460312794214e-19,
"particle_momentum_z": 2.207395147435577e-19,
"particle_position_x": 2666525.886108531,
"particle_position_y": 2666683.4040517565,
"particle_weight": 1.7256099431746894e+26
}
}
16 changes: 12 additions & 4 deletions run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
# physically correct.

# The tests can be influenced by environment variables:
# Use `export WARPX_CI_CLEAN_TESTS=ON` in order to remove all subdirectories
# from each test directory, directly after a test has passed.
# Use `export WARPX_CI_DIM=3` or `export WARPX_CI_DIM=2` in order to
# select only the tests that correspond to this dimension
# select only the tests that correspond to this dimension.
# Use `export WARPX_TEST_ARCH=CPU` or `export WARPX_TEST_ARCH=GPU` in order
# to run the tests on CPU or GPU respectively.

Expand All @@ -30,6 +32,7 @@ tests_arg=$*
tests_run=${tests_arg:+--tests=${tests_arg}}

# environment options
WARPX_CI_CLEAN_TESTS=${WARPX_CI_CLEAN_TESTS:-""}
WARPX_CI_TMP=${WARPX_CI_TMP:-""}

# Remove contents and link to a previous test directory (intentionally two arguments)
Expand Down Expand Up @@ -80,7 +83,7 @@ curl -sOL https://github.com/openPMD/openPMD-example-datasets/raw/4ba1d257c5b489
cd -

# Clone the AMReX regression test utility
git clone https://github.com/AMReX-Codes/regression_testing.git
git clone -b EZoni_rm_testdir https://github.com/EZoni/regression_testing.git

# Prepare regression tests
mkdir -p rt-WarpX/WarpX-benchmarks
Expand All @@ -93,12 +96,17 @@ cp -r Checksum ../../regression_testing/
# Run tests
cd ../../regression_testing/
echo "cd $PWD"
if [ -z "${WARPX_CI_CLEAN_TESTS}" ]; then
test_rm_dir=""
else
test_rm_dir="--rm_testdir"
fi
# run only tests specified in variable tests_arg (single test or multiple tests)
if [[ ! -z "${tests_arg}" ]]; then
python3 regtest.py ../rt-WarpX/ci-tests.ini --skip_comparison --no_update all "${tests_run}"
python3 regtest.py ../rt-WarpX/ci-tests.ini ${test_rm_dir} --skip_comparison --no_update all "${tests_run}"
# run all tests (variables tests_arg and tests_run are empty)
else
python3 regtest.py ../rt-WarpX/ci-tests.ini --skip_comparison --no_update all
python3 regtest.py ../rt-WarpX/ci-tests.ini ${test_rm_dir} --skip_comparison --no_update all
fi

# clean up python virtual environment
Expand Down

0 comments on commit 7d40963

Please sign in to comment.