Skip to content

Commit 8cda6c1

Browse files
authored
Add min tests cmd to runtests script (#2400)
* [DLMED] add min tests command Signed-off-by: Nic Ma <[email protected]> * [DLMED] update CI script Signed-off-by: Nic Ma <[email protected]>
1 parent fb7d9f1 commit 8cda6c1

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.github/workflows/pythonapp.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
run: |
152152
python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))'
153153
python -c "import monai; monai.config.print_config()"
154-
python -m tests.min_tests
154+
./runtests.sh --min
155155
env:
156156
QUICKTEST: True
157157

@@ -196,7 +196,7 @@ jobs:
196196
run: |
197197
python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))'
198198
python -c "import monai; monai.config.print_config()"
199-
python -m tests.min_tests
199+
./runtests.sh --min
200200
env:
201201
QUICKTEST: True
202202

runtests.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ fi
3333
# configuration values
3434
doCoverage=false
3535
doQuickTests=false
36+
doMinTests=false
3637
doNetTests=false
3738
doDryRun=false
3839
doZooTests=false
@@ -54,7 +55,7 @@ PY_EXE=${MONAI_PY_EXE:-$(which python)}
5455

5556
function print_usage {
5657
echo "runtests.sh [--codeformat] [--autofix] [--black] [--isort] [--flake8] [--clangformat] [--pytype] [--mypy]"
57-
echo " [--unittests] [--disttests] [--coverage] [--quick] [--net] [--dryrun] [-j number] [--clean] [--help] [--version]"
58+
echo " [--unittests] [--disttests] [--coverage] [--quick] [--min] [--net] [--dryrun] [-j number] [--clean] [--help] [--version]"
5859
echo ""
5960
echo "MONAI unit testing utilities."
6061
echo ""
@@ -83,6 +84,7 @@ function print_usage {
8384
echo " --disttests : perform distributed unit testing"
8485
echo " --coverage : report testing code coverage, to be used with \"--net\", \"--unittests\""
8586
echo " -q, --quick : skip long running unit tests and integration tests"
87+
echo " -m, --min : only run minimal unit tests which do not require optional packages"
8688
echo " --net : perform integration testing"
8789
echo " --list_tests : list unit tests and exit"
8890
echo ""
@@ -215,6 +217,9 @@ do
215217
-q|--quick)
216218
doQuickTests=true
217219
;;
220+
-m|--min)
221+
doMinTests=true
222+
;;
218223
--net)
219224
doNetTests=true
220225
;;
@@ -507,6 +512,12 @@ then
507512
export QUICKTEST=True
508513
fi
509514

515+
if [ $doMinTests = true ]
516+
then
517+
echo "${separator}${blue}min${noColor}"
518+
${cmdPrefix}${PY_EXE} -m tests.min_tests
519+
fi
520+
510521
# set coverage command
511522
if [ $doCoverage = true ]
512523
then

0 commit comments

Comments
 (0)