From b08c0dc263ca82e106d759f02ea8e6f4fa1ead24 Mon Sep 17 00:00:00 2001 From: Vikas Kumar Date: Fri, 27 Dec 2019 13:41:21 -0800 Subject: [PATCH 1/4] failing CI if codebuild fails --- config/buildspec.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/buildspec.yml b/config/buildspec.yml index ffb5a2a84..b15dcbbb3 100755 --- a/config/buildspec.yml +++ b/config/buildspec.yml @@ -36,3 +36,5 @@ phases: - . $CODEBUILD_SRC_DIR/config/upload_on_end.sh - rm -rf $CODEBUILD_SRC_DIR/upload/$CURRENT_COMMIT_PATH - rm -rf $RULES_CODEBUILD_SRC_DIR/upload/$CURRENT_COMMIT_PATH + - if [ "$CODEBUILD_BUILD_SUCCEEDING" -eq 0 ]; then echo "ERROR BUILD FAILED " && exit 1 ; fi + - if [ "$CODEBUILD_BUILD_SUCCEEDING" -eq 1 ]; then echo "INFO BUILD SUCCEEDED !!! " ; fi From b777e06c8106163150d126ebc60a45c1c56673e8 Mon Sep 17 00:00:00 2001 From: Vikas Kumar Date: Fri, 27 Dec 2019 13:43:59 -0800 Subject: [PATCH 2/4] Adding duration arg to pytest to find long running tests --- config/tests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/tests.sh b/config/tests.sh index 8af796d6b..60db55921 100644 --- a/config/tests.sh +++ b/config/tests.sh @@ -13,7 +13,7 @@ check_logs() { } run_for_framework() { - python -m pytest --html=$REPORT_DIR/report_$1.html -v -s --self-contained-html tests/$1 + python -m pytest --duration=50 --html=$REPORT_DIR/report_$1.html -v -s --self-contained-html tests/$1 } export TF_CPP_MIN_LOG_LEVEL=1 @@ -23,8 +23,8 @@ export SMDEBUG_LOG_LEVEL=info export OUT_DIR=upload/$CURRENT_COMMIT_PATH export REPORT_DIR=$OUT_DIR/pytest_reports -python -m pytest -v -W=ignore --html=$REPORT_DIR/report_analysis.html --self-contained-html tests/analysis -python -m pytest -v -W=ignore --html=$REPORT_DIR/report_core.html --self-contained-html tests/core +python -m pytest -v -W=ignore --duration=50 --html=$REPORT_DIR/report_analysis.html --self-contained-html tests/analysis +python -m pytest -v -W=ignore --duration=50 --html=$REPORT_DIR/report_core.html --self-contained-html tests/core if [ "$run_pytest_xgboost" = "enable" ] ; then run_for_framework xgboost From d7198499506d7bb9515f5211fcbf282303adfca2 Mon Sep 17 00:00:00 2001 From: Vikas Kumar Date: Fri, 27 Dec 2019 13:57:54 -0800 Subject: [PATCH 3/4] fixing duration argument --- config/tests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/tests.sh b/config/tests.sh index 60db55921..7b1ae163e 100644 --- a/config/tests.sh +++ b/config/tests.sh @@ -13,7 +13,7 @@ check_logs() { } run_for_framework() { - python -m pytest --duration=50 --html=$REPORT_DIR/report_$1.html -v -s --self-contained-html tests/$1 + python -m pytest --durations=50 --html=$REPORT_DIR/report_$1.html -v -s --self-contained-html tests/$1 } export TF_CPP_MIN_LOG_LEVEL=1 @@ -23,8 +23,8 @@ export SMDEBUG_LOG_LEVEL=info export OUT_DIR=upload/$CURRENT_COMMIT_PATH export REPORT_DIR=$OUT_DIR/pytest_reports -python -m pytest -v -W=ignore --duration=50 --html=$REPORT_DIR/report_analysis.html --self-contained-html tests/analysis -python -m pytest -v -W=ignore --duration=50 --html=$REPORT_DIR/report_core.html --self-contained-html tests/core +python -m pytest -v -W=ignore --durations=50 --html=$REPORT_DIR/report_analysis.html --self-contained-html tests/analysis +python -m pytest -v -W=ignore --durations=50 --html=$REPORT_DIR/report_core.html --self-contained-html tests/core if [ "$run_pytest_xgboost" = "enable" ] ; then run_for_framework xgboost From 93c9b2208cb03dbd47c22db1560baa2c1818fa2b Mon Sep 17 00:00:00 2001 From: Vikas Kumar Date: Fri, 27 Dec 2019 19:43:50 -0800 Subject: [PATCH 4/4] set to fail on pipe failures --- config/tests.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/tests.sh b/config/tests.sh index 7b1ae163e..c2dc63925 100644 --- a/config/tests.sh +++ b/config/tests.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash +set -e set -ex +set -o pipefail check_logs() { if grep -e "AssertionError" $1;