Skip to content

Commit acd1292

Browse files
committed
Improve testing setup
Signed-off-by: Beat Buesser <[email protected]>
1 parent 34eb2dc commit acd1292

File tree

2 files changed

+23
-24
lines changed

2 files changed

+23
-24
lines changed

requirements_test.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ jax[cpu]==0.4.30
5050
pytest~=8.3.2
5151
pytest-mock~=3.14.1
5252
pytest-cov~=6.1.1
53-
pytest-xdist==3.7.0
5453
pylint==3.3.7
5554
mypy==1.11.1
5655
pycodestyle==2.13.0

run_tests.sh

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,70 +19,70 @@ then
1919
echo "############### Running tests with framework $framework ###############"
2020
echo "#######################################################################"
2121

22-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/defences/detector/evasion --framework=$framework --durations=20 --durations-min=0 -n auto
22+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/defences/detector/evasion --framework=$framework --durations=20 --durations-min=0
2323
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed defences/detector/evasion tests"; fi
2424

25-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/defences/detector/poison/test_spectral_signature_defense.py --framework=$framework --durations=20 --durations-min=0 -n auto
25+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/defences/detector/poison/test_spectral_signature_defense.py --framework=$framework --durations=20 --durations-min=0
2626
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed defences/detector/poison/test_spectral_signature_defense.py tests"; fi
2727

28-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/defences/preprocessor --framework=$framework --durations=20 --durations-min=0 -n auto
28+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/defences/preprocessor --framework=$framework --durations=20 --durations-min=0
2929
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed defences/preprocessor tests"; fi
3030

31-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/defences/trainer --framework=$framework --durations=20 --durations-min=0 -n auto
31+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/defences/trainer --framework=$framework --durations=20 --durations-min=0
3232
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed defences/trainer tests"; fi
3333

34-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/defences/transformer --framework=$framework --durations=20 --durations-min=0 -n auto
34+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/defences/transformer --framework=$framework --durations=20 --durations-min=0
3535
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed defences/transformer tests"; fi
3636

37-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/preprocessing/audio --framework=$framework --durations=20 --durations-min=0 -n auto
37+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/preprocessing/audio --framework=$framework --durations=20 --durations-min=0
3838
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed preprocessing/audio tests"; fi
3939

40-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/preprocessing/image --framework=$framework --durations=20 --durations-min=0 -n auto
40+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/preprocessing/image --framework=$framework --durations=20 --durations-min=0
4141
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed preprocessing/image tests"; fi
4242

43-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/preprocessing/expectation_over_transformation --framework=$framework --durations=20 --durations-min=0 -n auto
43+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/preprocessing/expectation_over_transformation --framework=$framework --durations=20 --durations-min=0
4444
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed preprocessing/expectation_over_transformation tests"; fi
4545

46-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/utils --framework=$framework --durations=20 --durations-min=0 -n auto
46+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/utils --framework=$framework --durations=20 --durations-min=0
4747
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed utils tests"; fi
4848

49-
pytest --cov-report=xml --cov=art --cov-append -q -vv -s tests/attacks/poison/ --framework=$framework --durations=20 --durations-min=0 -n auto
49+
pytest --cov-report=xml --cov=art --cov-append -q -vv -s tests/attacks/poison/ --framework=$framework --durations=20 --durations-min=0
5050
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed attacks/poison tests"; fi
5151

52-
pytest --cov-report=xml --cov=art --cov-append -q -vv -s tests/attacks/evasion/ --framework=$framework --durations=20 --durations-min=0 -n auto
52+
pytest --cov-report=xml --cov=art --cov-append -q -vv -s tests/attacks/evasion/ --framework=$framework --durations=20 --durations-min=0
5353
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed attacks/evasion"; fi
5454

55-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/speech_recognition/ --framework=$framework --durations=20 --durations-min=0 -n auto
55+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/speech_recognition/ --framework=$framework --durations=20 --durations-min=0
5656
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed estimators/speech_recognition tests"; fi
5757

58-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/attacks/inference/ --framework=$framework --durations=20 --durations-min=0 -n auto
58+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/attacks/inference/ --framework=$framework --durations=20 --durations-min=0
5959
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed attacks/inference"; fi
6060

61-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/classifiersFrameworks/ --framework=$framework --durations=20 --durations-min=0 -n auto
61+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/classifiersFrameworks/ --framework=$framework --durations=20 --durations-min=0
6262
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed classifiersFrameworks tests"; fi
6363

64-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/classification/test_deeplearning_common.py --framework=$framework --durations=20 --durations-min=0 -n auto
64+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/classification/test_deeplearning_common.py --framework=$framework --durations=20 --durations-min=0
6565
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed estimators/classification/test_deeplearning_common.py $framework"; fi
6666

67-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/classification/test_deeplearning_specific.py --framework=$framework --durations=20 --durations-min=0 -n auto
67+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/classification/test_deeplearning_specific.py --framework=$framework --durations=20 --durations-min=0
6868
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed estimators/classification tests for framework $framework"; fi
6969

70-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/certification/ --framework=$framework --durations=20 --durations-min=0 -n auto
70+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/certification/ --framework=$framework --durations=20 --durations-min=0
7171
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed estimators/certification tests for framework $framework"; fi
7272

73-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/classification/test_blackbox_existing_predictions.py --framework=$framework --durations=20 --durations-min=0 -n auto
73+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/classification/test_blackbox_existing_predictions.py --framework=$framework --durations=20 --durations-min=0
7474
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed estimators/classification/test_blackbox_existing_predictions.py $framework"; fi
7575

76-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/regression/test_blackbox.py --framework=$framework --durations=20 --durations-min=0 -n auto
76+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/regression/test_blackbox.py --framework=$framework --durations=20 --durations-min=0
7777
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed estimators/regression/test_blackbox.py $framework"; fi
7878

79-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/metrics/privacy --framework=$framework --durations=20 --durations-min=0 -n auto
79+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/metrics/privacy --framework=$framework --durations=20 --durations-min=0
8080
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed metrics/privacy tests"; fi
8181

82-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/evaluations --framework=$framework --durations=20 --durations-min=0 -n auto
82+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/evaluations --framework=$framework --durations=20 --durations-min=0
8383
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed evaluations tests"; fi
8484

85-
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/test_summary_writer.py --framework=$framework --durations=20 --durations-min=0 -n auto
85+
pytest --cov-report=xml --cov=art --cov-append -q -vv tests/test_summary_writer.py --framework=$framework --durations=20 --durations-min=0
8686
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed summary writer tests"; fi
8787

8888
else
@@ -174,7 +174,7 @@ else
174174
echo "######################################################################"
175175
echo ${test}
176176
echo "######################################################################"
177-
pytest --cov-report=xml --cov=art --cov-append -q -vv ${test} --durations=20 --durations-min=0 -n auto
177+
pytest --cov-report=xml --cov=art --cov-append -q -vv ${test} --durations=20 --durations-min=0
178178
if [[ $? -ne 0 ]]; then exit_code=1; echo "Failed $test"; fi
179179
}
180180

0 commit comments

Comments
 (0)