From bce3a182159ec7cc4f3c8dd3b528f07792ba8088 Mon Sep 17 00:00:00 2001 From: Felix Stollenwerk Date: Wed, 4 Sep 2024 11:11:02 +0200 Subject: [PATCH 1/3] test: check input arguments for run_distributed_tests.sh --- tests/run_distributed_tests.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/run_distributed_tests.sh b/tests/run_distributed_tests.sh index 85e98822..ac23883b 100755 --- a/tests/run_distributed_tests.sh +++ b/tests/run_distributed_tests.sh @@ -3,23 +3,28 @@ ####################### ### INPUT ARGUMENTS ### ####################### -if [ -z "$1" ] || [ -z "$2" ] # if one of the two input arguments does not exist +if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] # if one of the three input arguments does not exist then - echo "Need to specify 2 GPU devices as arguments, e.g. bash run_distributed_tests.sh 0 1" + echo "Need to specify 2 GPU devices plus --cov/--no-cov as arguments, e.g. bash run_distributed_tests.sh 0 1 --cov" exit fi -if [[ $1 =~ [^0-7] ]] || [[ $2 =~ [^0-7] ]] # if one of the two input arguments is not an integer 0-7 +if [[ $1 =~ [^0-7] ]] || [[ $2 =~ [^0-7] ]] # if one of the two first input arguments is not an integer 0-7 then - echo "Need to specify integers 0-7 as arguments, e.g. bash run_distributed_tests.sh 0 1" + echo "Need to specify integers 0-7 as first two arguments, e.g. bash run_distributed_tests.sh 0 1 --cov" exit fi +if ! [[ $3 =~ ^(--cov|--no-cov)$ ]]; # if the third argument is neither --cov nor --no-cov + then + echo "Need to specify --cov or --no-cov as third argument, e.g. bash run_distributed_tests.sh 0 1 --cov" + exit +fi ################# ### VARIABLES ### ################# DEV0=$1 DEV1=$2 -COVERAGE=$3 # --cov or --no-cov +COVERAGE=$3 ############# ### TESTS ### From 249506959d0138444caac72914e52f6567c89801 Mon Sep 17 00:00:00 2001 From: Felix Stollenwerk Date: Wed, 4 Sep 2024 11:21:34 +0200 Subject: [PATCH 2/3] test: fix usage of run_distributed_tests.sh in tests.py --- tests/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests.py b/tests/tests.py index ce8078c5..c4e0bc25 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -99,7 +99,7 @@ def main(cpu: bool = False, single_gpu: bool = False, multi_gpu: bool = False, d run_distributed_tests_script = _ROOT_DIR / "tests" / "run_distributed_tests.sh" assert isfile(run_distributed_tests_script), f"ERROR! {run_distributed_tests_script} does not exist." command_end_to_end_tests = ( - f"cd {run_distributed_tests_directory}; bash run_distributed_tests.sh {devices[0]} {devices[1]}" + f"cd {run_distributed_tests_directory}; bash run_distributed_tests.sh {devices[0]} {devices[1]} --no-cov" ) print(command_end_to_end_tests) subprocess.run(command_end_to_end_tests, shell=True, capture_output=False, text=True) From 3faec01e0dbf5a508dad0cb4dc99fc7c09a01c27 Mon Sep 17 00:00:00 2001 From: Felix Stollenwerk Date: Wed, 4 Sep 2024 11:31:50 +0200 Subject: [PATCH 3/3] test: remove unused input argument in run_all_tests.sh --- tests/run_all_tests.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/run_all_tests.sh b/tests/run_all_tests.sh index 54494dcc..5eb066c9 100755 --- a/tests/run_all_tests.sh +++ b/tests/run_all_tests.sh @@ -19,7 +19,6 @@ fi ################# DEV0=$1 DEV1=$2 -COVERAGE=$3 # --cov or --no-cov ############# ### TESTS ###