aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Axel Huebl <axel.huebl@plasma.ninja> 2021-02-22 13:03:08 -0800
committerGravatar GitHub <noreply@github.com> 2021-02-22 13:03:08 -0800
commit24bff4e47403a171e2da2d4f0fcdf941aeffec9c (patch)
tree854e2e26030aca695419c8c2887914c2de5bba53
parentf43dac64920270a7035d0e7b9244dcaa89935f0d (diff)
downloadWarpX-24bff4e47403a171e2da2d4f0fcdf941aeffec9c.tar.gz
WarpX-24bff4e47403a171e2da2d4f0fcdf941aeffec9c.tar.zst
WarpX-24bff4e47403a171e2da2d4f0fcdf941aeffec9c.zip
Fix: run_test.sh - fail on error & fix clone (#1729)
* Fix: run_test.sh clone (fail on error) * regtest.py: WARPX_TEST_COMMIT / --source_git_hash unused They have no effect, looks very ancient. * run_test.sh: Fix commit checkout `git clone --branch` does not support commits as SHA
-rw-r--r--.azure-pipelines.yml1
-rw-r--r--Docs/source/developers/testing.rst1
-rwxr-xr-xTools/Release/updateAMReX.py4
-rwxr-xr-xTools/Release/updatePICSAR.py4
-rwxr-xr-xrun_test.sh12
5 files changed, 12 insertions, 10 deletions
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml
index a5bd094bc..31901a5d8 100644
--- a/.azure-pipelines.yml
+++ b/.azure-pipelines.yml
@@ -55,7 +55,6 @@ steps:
displayName: 'Install dependencies'
- script: |
- export WARPX_TEST_COMMIT=$BUILD_SOURCEVERSION
./run_test.sh
timeoutInMinutes: 360
displayName: 'Build & test'
diff --git a/Docs/source/developers/testing.rst b/Docs/source/developers/testing.rst
index b11bffbfb..fde629448 100644
--- a/Docs/source/developers/testing.rst
+++ b/Docs/source/developers/testing.rst
@@ -39,7 +39,6 @@ from WarpX root folder. It will compile all necessary executables and run all te
* ``export WARPX_TEST_DIM=3``, ``export WARPX_TEST_DIM=2`` or ``export WARPX_TEST_DIM=RZ`` in order to select only the tests that correspond to this dimensionality
* ``export WARPX_TEST_ARCH=CPU`` or ``export WARPX_TEST_ARCH=GPU`` in order to run the tests on CPU or GPU respectively.
-* ``export WARPX_TEST_COMMIT=...`` in order to test a specific commit.
The command above (without command line arguments) runs all the tests defined in [Regression/WarpX-tests.ini](./Regression/WarpX-tests.ini). In order to run single tests, pass the test names as command line arguments:
diff --git a/Tools/Release/updateAMReX.py b/Tools/Release/updateAMReX.py
index e3557c347..807b655e9 100755
--- a/Tools/Release/updateAMReX.py
+++ b/Tools/Release/updateAMReX.py
@@ -100,9 +100,9 @@ run_test_path = str(REPO_DIR.joinpath("run_test.sh"))
with open(run_test_path, encoding='utf-8') as f:
run_test_content = f.read()
# branch/commit/tag (git fetcher) version
- # git clone --branch development https://github.com/AMReX-Codes/amrex.git
+ # cd amrex && git checkout COMMIT_TAG_OR_BRANCH && cd -
run_test_content = re.sub(
- r'(.*git\s+clone\s+\-\-branch\s+)(.+)(\s+https://github\.com/AMReX\-Codes/amrex\.git)',
+ r'(.*cd\s+amrex.+git checkout\s+)(.+)(\s+&&\s.*)',
r'\g<1>{}\g<3>'.format(amrex_new_branch),
run_test_content, flags = re.MULTILINE)
diff --git a/Tools/Release/updatePICSAR.py b/Tools/Release/updatePICSAR.py
index a3c3f79fc..bb17d5132 100755
--- a/Tools/Release/updatePICSAR.py
+++ b/Tools/Release/updatePICSAR.py
@@ -100,9 +100,9 @@ run_test_path = str(REPO_DIR.joinpath("run_test.sh"))
with open(run_test_path, encoding='utf-8') as f:
run_test_content = f.read()
# branch/commit/tag (git fetcher) version
- # git clone --branch development https://github.com/PICSAR-Codes/PICSAR.git
+ # cd picsar && git checkout COMMIT_TAG_OR_BRANCH && cd -
run_test_content = re.sub(
- r'(.*git\s+clone\s+\-\-branch\s+)(.+)(\s+https://github\.com/ECP\-WarpX/picsar\.git)',
+ r'(.*cd\s+picsar.+git checkout\s+)(.+)(\s+&&\s.*)',
r'\g<1>{}\g<3>'.format(PICSAR_new_branch),
run_test_content, flags = re.MULTILINE)
diff --git a/run_test.sh b/run_test.sh
index 28e5082f7..36d28f5df 100755
--- a/run_test.sh
+++ b/run_test.sh
@@ -21,6 +21,8 @@
# Use `export WARPX_TEST_ARCH=CPU` or `export WARPX_TEST_ARCH=GPU` in order
# to run the tests on CPU or GPU respectively.
+set -eu -o pipefail
+
# Parse command line arguments: 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)
@@ -48,9 +50,11 @@ cd test_dir
echo "cd $PWD"
# Clone PICSAR and AMReX
-git clone --branch e611121acca7696320f3757982de857cbab74926 https://github.com/AMReX-Codes/amrex.git
+git clone https://github.com/AMReX-Codes/amrex.git
+cd amrex && git checkout e611121acca7696320f3757982de857cbab74926 && cd -
# Use QED brach for QED tests
-git clone --branch b35f07243c51ac35d47857fe36f0aafb6b517955 https://github.com/ECP-WarpX/picsar.git
+git clone https://github.com/ECP-WarpX/picsar.git
+cd picsar && git checkout b35f07243c51ac35d47857fe36f0aafb6b517955 && cd -
# Clone the AMReX regression test utility
git clone https://github.com/ECP-WarpX/regression_testing.git
@@ -68,8 +72,8 @@ cd ../../regression_testing/
echo "cd $PWD"
# run only tests specified in variable tests_arg (single test or multiple tests)
if [[ ! -z "${tests_arg}" ]]; then
- python regtest.py ../rt-WarpX/travis-tests.ini --no_update all --source_git_hash=${WARPX_TEST_COMMIT} "${tests_run}"
+ python regtest.py ../rt-WarpX/travis-tests.ini --no_update all "${tests_run}"
# run all tests (variables tests_arg and tests_run are empty)
else
- python regtest.py ../rt-WarpX/travis-tests.ini --no_update all --source_git_hash=${WARPX_TEST_COMMIT}
+ python regtest.py ../rt-WarpX/travis-tests.ini --no_update all
fi