Skip to content

Commit

Permalink
Add junitxml to unit test and update exclude var test (NVIDIA#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanTingHsieh authored May 5, 2022
1 parent 6eaafe7 commit c7bc54f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion runtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export MINIO_SERVER_PORT=9001
./minio server $MINIO_STORE_PATH --console-address :$MINIO_SERVER_PORT &
echo $! > ./minio_pid
minio_pid=`cat ./minio_pid`
python -m pytest --cov=nvflare --cov-report html:cov_html --cov-report xml:cov.xml --numprocesses=auto tests/unit_test/
python -m pytest --cov=nvflare --cov-report html:cov_html --cov-report xml:cov.xml --junitxml=unit_test.xml --numprocesses=auto tests/unit_test/
kill -9 $minio_pid
rm -rf ./$MINIO_STORE_PATH ./minio_pid ./minio
echo "Done with unit tests"
12 changes: 6 additions & 6 deletions tests/unit_test/app_common/filters/exclude_vars_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
from nvflare.app_common.filters import ExcludeVars

TEST_CASES = [
[{"a": 1.0, "b": 2.0}, "a", {"b": 2.0}],
[{"a": 1.0, "b": 2.0, "c": 3.0}, ["a", "b"], {"c": 3.0}],
[{"a": 1.0, "b": 2.0, "c": 3.0, "d": 4.0}, ["a", "d"], {"b": 2.0, "c": 3.0}],
[
({"a": 1.0, "b": 2.0}, "a", {"b": 2.0}),
({"a": 1.0, "b": 2.0, "c": 3.0}, ["a", "b"], {"c": 3.0}),
({"a": 1.0, "b": 2.0, "c": 3.0, "d": 4.0}, ["a", "d"], {"b": 2.0, "c": 3.0}),
(
{"conv/a": 1.0, "conv/b": 2.0, "drop/c": 3.0, "conv/d": 4.0},
["conv/*"],
{"conv/a": 1.0, "conv/b": 2.0, "drop/c": 3.0, "conv/d": 4.0},
],
[{"conv/a": 1.0, "conv/b": 2.0, "drop/c": 3.0, "conv/d": 4.0}, "conv/*", {"drop/c": 3.0}],
),
({"conv/a": 1.0, "conv/b": 2.0, "drop/c": 3.0, "conv/d": 4.0}, "conv/*", {"drop/c": 3.0}),
]


Expand Down

0 comments on commit c7bc54f

Please sign in to comment.