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

Fix run test scripts #250

Merged
merged 3 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion tests/run_all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ fi
#################
DEV0=$1
DEV1=$2
COVERAGE=$3 # --cov or --no-cov

#############
### TESTS ###
Expand Down
15 changes: 10 additions & 5 deletions tests/run_distributed_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ###
Expand Down
2 changes: 1 addition & 1 deletion tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading