Skip to content

Commit

Permalink
Add min tests cmd to runtests script (Project-MONAI#2400)
Browse files Browse the repository at this point in the history
* [DLMED] add min tests command

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update CI script

Signed-off-by: Nic Ma <[email protected]>
  • Loading branch information
Nic-Ma authored Jun 22, 2021
1 parent fb7d9f1 commit 8cda6c1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
13 changes: 12 additions & 1 deletion runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ fi
# configuration values
doCoverage=false
doQuickTests=false
doMinTests=false
doNetTests=false
doDryRun=false
doZooTests=false
Expand All @@ -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 ""
Expand Down Expand Up @@ -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 ""
Expand Down Expand Up @@ -215,6 +217,9 @@ do
-q|--quick)
doQuickTests=true
;;
-m|--min)
doMinTests=true
;;
--net)
doNetTests=true
;;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8cda6c1

Please sign in to comment.