Skip to content

Commit 80153e7

Browse files
authored
Codecov Env Variable (aws#241)
* add env flag
1 parent eceac9f commit 80153e7

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

config/buildspec.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ env:
1717
run_integration_pytest_xgboost: "disable"
1818
# below needs to be enabled
1919
zero_code_change_test: "enable"
20+
# set code coverage flag
21+
code_coverage_smdebug: "true"
2022
phases:
2123
install:
2224
commands:

config/tests.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ check_logs() {
1717
run_for_framework() {
1818
if [ "$zero_code_change_test" = "enable" ] ; then
1919
# ignoring some test becuase they require multiple frmaeworks to be installed, these tests need to be broken down
20-
python -m pytest --cov=./ --cov-append --durations=50 --html=$REPORT_DIR/report_$1.html -v -s --self-contained-html --ignore=tests/core/test_paths.py --ignore=tests/core/test_index_utils.py --ignore=tests/core/test_collections.py tests/$1
20+
python -m pytest ${code_coverage_smdebug:+--cov=./ --cov-append} --durations=50 --html=$REPORT_DIR/report_$1.html -v -s --self-contained-html --ignore=tests/core/test_paths.py --ignore=tests/core/test_index_utils.py --ignore=tests/core/test_collections.py tests/$1
2121
if [ "$1" = "mxnet" ] ; then
22-
python -m pytest --cov=./ --cov-append tests/zero_code_change/test_mxnet_gluon_integration.py
22+
python -m pytest ${code_coverage_smdebug:+--cov=./ --cov-append} tests/zero_code_change/test_mxnet_gluon_integration.py
2323
elif [ "$1" = "pytorch" ] ; then
24-
python -m pytest --cov=./ --cov-append tests/zero_code_change/test_pytorch_integration.py
25-
python -m pytest --cov=./ --cov-append tests/zero_code_change/test_pytorch_multiprocessing.py
26-
python -m pytest --cov=./ --cov-append tests/zero_code_change/test_training_with_no_grad_updates.py
24+
python -m pytest ${code_coverage_smdebug:+--cov=./ --cov-append} tests/zero_code_change/test_pytorch_integration.py
25+
python -m pytest ${code_coverage_smdebug:+--cov=./ --cov-append} tests/zero_code_change/test_pytorch_multiprocessing.py
26+
python -m pytest ${code_coverage_smdebug:+--cov=./ --cov-append} tests/zero_code_change/test_training_with_no_grad_updates.py
2727
elif [ "$1" = "tensorflow" ] ; then
28-
python -m pytest --cov=./ --cov-append tests/zero_code_change/test_tensorflow_integration.py
28+
python -m pytest ${code_coverage_smdebug:+--cov=./ --cov-append} tests/zero_code_change/test_tensorflow_integration.py
2929
elif [ "$1" = "tensorflow2" ] ; then
30-
python -m pytest --cov=./ --cov-append tests/zero_code_change/test_tensorflow2_gradtape_integration.py
31-
python -m pytest --cov=./ --cov-append tests/zero_code_change/test_tensorflow2_integration.py
30+
python -m pytest ${code_coverage_smdebug:+--cov=./ --cov-append} tests/zero_code_change/test_tensorflow2_gradtape_integration.py
31+
python -m pytest ${code_coverage_smdebug:+--cov=./ --cov-append} tests/zero_code_change/test_tensorflow2_integration.py
3232
fi
3333

3434
else
3535
if [ "$1" = "tensorflow2" ] ; then
36-
python -m pytest --cov=./ --cov-append --durations=50 --html=$REPORT_DIR/report_$1/eager_mode.html -v -s --self-contained-html tests/$1
37-
python -m pytest --cov=./ --cov-append --durations=50 --non-eager --html=$REPORT_DIR/report_$1/non_eager_mode.html -v -s --self-contained-html tests/$1
36+
python -m pytest ${code_coverage_smdebug:+--cov=./ --cov-append} --durations=50 --html=$REPORT_DIR/report_$1/eager_mode.html -v -s --self-contained-html tests/$1
37+
python -m pytest ${code_coverage_smdebug:+--cov=./ --cov-append} --durations=50 --non-eager --html=$REPORT_DIR/report_$1/non_eager_mode.html -v -s --self-contained-html tests/$1
3838
else
39-
python -m pytest --cov=./ --cov-append --durations=50 --html=$REPORT_DIR/report_$1.html -v -s --self-contained-html tests/$1
39+
python -m pytest ${code_coverage_smdebug:+--cov=./ --cov-append} --durations=50 --html=$REPORT_DIR/report_$1.html -v -s --self-contained-html tests/$1
4040
fi
4141
fi
4242
}
@@ -48,7 +48,7 @@ export SMDEBUG_LOG_LEVEL=info
4848

4949
export OUT_DIR=upload/$CURRENT_COMMIT_PATH
5050
export REPORT_DIR=$OUT_DIR/pytest_reports
51-
python -m pytest --cov=./ --cov-append -v -W=ignore --durations=50 --html=$REPORT_DIR/report_analysis.html --self-contained-html tests/analysis
51+
python -m pytest ${code_coverage_smdebug:+--cov=./ --cov-append} -v -W=ignore --durations=50 --html=$REPORT_DIR/report_analysis.html --self-contained-html tests/analysis
5252

5353
run_for_framework core
5454

0 commit comments

Comments
 (0)