From 8cda6c15c1e10af8785e369431af091480910913 Mon Sep 17 00:00:00 2001 From: Nic Ma Date: Tue, 22 Jun 2021 08:02:55 +0800 Subject: [PATCH] Add min tests cmd to runtests script (#2400) * [DLMED] add min tests command Signed-off-by: Nic Ma * [DLMED] update CI script Signed-off-by: Nic Ma --- .github/workflows/pythonapp.yml | 4 ++-- runtests.sh | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 01572290d5..9e84862ede 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -151,7 +151,7 @@ jobs: run: | python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))' python -c "import monai; monai.config.print_config()" - python -m tests.min_tests + ./runtests.sh --min env: QUICKTEST: True @@ -196,7 +196,7 @@ jobs: run: | python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))' python -c "import monai; monai.config.print_config()" - python -m tests.min_tests + ./runtests.sh --min env: QUICKTEST: True diff --git a/runtests.sh b/runtests.sh index 862d7fe092..f10e888543 100755 --- a/runtests.sh +++ b/runtests.sh @@ -33,6 +33,7 @@ fi # configuration values doCoverage=false doQuickTests=false +doMinTests=false doNetTests=false doDryRun=false doZooTests=false @@ -54,7 +55,7 @@ PY_EXE=${MONAI_PY_EXE:-$(which python)} function print_usage { echo "runtests.sh [--codeformat] [--autofix] [--black] [--isort] [--flake8] [--clangformat] [--pytype] [--mypy]" - echo " [--unittests] [--disttests] [--coverage] [--quick] [--net] [--dryrun] [-j number] [--clean] [--help] [--version]" + echo " [--unittests] [--disttests] [--coverage] [--quick] [--min] [--net] [--dryrun] [-j number] [--clean] [--help] [--version]" echo "" echo "MONAI unit testing utilities." echo "" @@ -83,6 +84,7 @@ function print_usage { echo " --disttests : perform distributed unit testing" echo " --coverage : report testing code coverage, to be used with \"--net\", \"--unittests\"" echo " -q, --quick : skip long running unit tests and integration tests" + echo " -m, --min : only run minimal unit tests which do not require optional packages" echo " --net : perform integration testing" echo " --list_tests : list unit tests and exit" echo "" @@ -215,6 +217,9 @@ do -q|--quick) doQuickTests=true ;; + -m|--min) + doMinTests=true + ;; --net) doNetTests=true ;; @@ -507,6 +512,12 @@ then export QUICKTEST=True fi +if [ $doMinTests = true ] +then + echo "${separator}${blue}min${noColor}" + ${cmdPrefix}${PY_EXE} -m tests.min_tests +fi + # set coverage command if [ $doCoverage = true ] then