Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: clean test dirs, reset collisionXZ checksums #5120

Merged
merged 3 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
- bash: |
set -eu -o pipefail
df -h
./run_test.sh
./run_test.sh -c
rm -rf ${WARPX_CI_TMP}
df -h
displayName: 'Build & test'
41 changes: 33 additions & 8 deletions run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,25 @@

set -eu -o pipefail

# Parse command line arguments: if test names are given as command line arguments,
# Parse command line arguments:
# - if -c option is given, set clean=1 and call regtest.py with option --rm_testdir
# in order to remove all subdirectories from each test directory, after each test
# - if test names are given as command line arguments,
# store them in variable tests_arg and define new command line argument to call
# regtest.py with option --tests (works also for single test)
tests_arg=$*
clean=0
while getopts c name
do
case ${name} in
c) clean=1;;
esac
done
ax3l marked this conversation as resolved.
Show resolved Hide resolved
tests_arg=""
if [ ! -z "${clean}" ]; then
tests_arg=${*:2}
else
tests_arg=$*
fi
tests_run=${tests_arg:+--tests=${tests_arg}}

# environment options
Expand Down Expand Up @@ -80,7 +95,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 +108,22 @@ cp -r Checksum ../../regression_testing/
# Run tests
cd ../../regression_testing/
echo "cd $PWD"
# 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}"
# run all tests (variables tests_arg and tests_run are empty)
if [ ! -z "${clean}" ]; then
# 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 --rm_testdir --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 --rm_testdir --skip_comparison --no_update all
fi
else
python3 regtest.py ../rt-WarpX/ci-tests.ini --skip_comparison --no_update all
# 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}"
# 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
fi
fi

# clean up python virtual environment
Expand Down
Loading