From 9a3f11f8f5529c56fd601a06b22e4bd1a6bc91ac Mon Sep 17 00:00:00 2001 From: Karim Nakad Date: Fri, 24 Jan 2020 15:07:04 -0800 Subject: [PATCH 1/6] infra: properly fail PR build if has-matching-changes fails --- buildspec.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 4d483a54d1..273580c728 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -11,15 +11,21 @@ phases: # run integration tests - start_time=`date +%s` + - HAS_MATCHING_CHANGES_OUTPUT=$(has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml") + - HAS_MATCHING_CHANGES_EXIT_CODE=$? - | - if has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"; then + if [[ $HAS_MATCHING_CHANGES_EXIT_CODE = 1 ]] ; then + echo "There was an error checking for matching changes. PR will now fail to prevent false negative (success) tests." + exit 1 + fi + if [[ $HAS_MATCHING_CHANGES = "Changes Found" ]] ; then python3 -u ci-scripts/queue_build.py fi - ./ci-scripts/displaytime.sh 'build queue' $start_time - start_time=`date +%s` - | - if has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"; then + if [[ $HAS_MATCHING_CHANGES = "Changes Found" ]] ; then tox -e py36 -- tests/integ -m "not local_mode" -n 512 --reruns 3 --reruns-delay 5 --durations 50 --boto-config '{"region_name": "us-east-2"}' fi - ./ci-scripts/displaytime.sh 'py36 tests/integ' $start_time From 160b7a39e76fe1a93b64eff8cb1cf9115be33db0 Mon Sep 17 00:00:00 2001 From: Karim Nakad Date: Fri, 24 Jan 2020 15:19:48 -0800 Subject: [PATCH 2/6] infra: properly fail PR build if has-matching-changes fails --- buildspec.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 273580c728..b554e72500 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -14,18 +14,18 @@ phases: - HAS_MATCHING_CHANGES_OUTPUT=$(has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml") - HAS_MATCHING_CHANGES_EXIT_CODE=$? - | - if [[ $HAS_MATCHING_CHANGES_EXIT_CODE = 1 ]] ; then + if [ $HAS_MATCHING_CHANGES_EXIT_CODE -eq 1 ] ; then echo "There was an error checking for matching changes. PR will now fail to prevent false negative (success) tests." exit 1 fi - if [[ $HAS_MATCHING_CHANGES = "Changes Found" ]] ; then + if [ $HAS_MATCHING_CHANGES -eq "Changes Found" ] ; then python3 -u ci-scripts/queue_build.py fi - ./ci-scripts/displaytime.sh 'build queue' $start_time - start_time=`date +%s` - | - if [[ $HAS_MATCHING_CHANGES = "Changes Found" ]] ; then + if [ $HAS_MATCHING_CHANGES -eq "Changes Found" ] ; then tox -e py36 -- tests/integ -m "not local_mode" -n 512 --reruns 3 --reruns-delay 5 --durations 50 --boto-config '{"region_name": "us-east-2"}' fi - ./ci-scripts/displaytime.sh 'py36 tests/integ' $start_time From c38950bfef4a2b7c3b8b0cd1d615915d0dffee5c Mon Sep 17 00:00:00 2001 From: Karim Nakad Date: Fri, 24 Jan 2020 15:25:27 -0800 Subject: [PATCH 3/6] infra: properly fail PR build if has-matching-changes fails --- buildspec.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index b554e72500..f0520af398 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -14,18 +14,18 @@ phases: - HAS_MATCHING_CHANGES_OUTPUT=$(has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml") - HAS_MATCHING_CHANGES_EXIT_CODE=$? - | - if [ $HAS_MATCHING_CHANGES_EXIT_CODE -eq 1 ] ; then + if [ $HAS_MATCHING_CHANGES_EXIT_CODE = 1 ] ; then echo "There was an error checking for matching changes. PR will now fail to prevent false negative (success) tests." exit 1 fi - if [ $HAS_MATCHING_CHANGES -eq "Changes Found" ] ; then + if [ $HAS_MATCHING_CHANGES = "Changes Found" ] ; then python3 -u ci-scripts/queue_build.py fi - ./ci-scripts/displaytime.sh 'build queue' $start_time - start_time=`date +%s` - | - if [ $HAS_MATCHING_CHANGES -eq "Changes Found" ] ; then + if [ $HAS_MATCHING_CHANGES = "Changes Found" ] ; then tox -e py36 -- tests/integ -m "not local_mode" -n 512 --reruns 3 --reruns-delay 5 --durations 50 --boto-config '{"region_name": "us-east-2"}' fi - ./ci-scripts/displaytime.sh 'py36 tests/integ' $start_time From 4c546bfe862a9885d3c8c22e5e4190c84eb995ab Mon Sep 17 00:00:00 2001 From: Karim Nakad Date: Fri, 24 Jan 2020 15:30:06 -0800 Subject: [PATCH 4/6] infra: properly fail PR build if has-matching-changes fails --- buildspec.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index f0520af398..87485ece2a 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -18,14 +18,14 @@ phases: echo "There was an error checking for matching changes. PR will now fail to prevent false negative (success) tests." exit 1 fi - if [ $HAS_MATCHING_CHANGES = "Changes Found" ] ; then + if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then python3 -u ci-scripts/queue_build.py fi - ./ci-scripts/displaytime.sh 'build queue' $start_time - start_time=`date +%s` - | - if [ $HAS_MATCHING_CHANGES = "Changes Found" ] ; then + if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then tox -e py36 -- tests/integ -m "not local_mode" -n 512 --reruns 3 --reruns-delay 5 --durations 50 --boto-config '{"region_name": "us-east-2"}' fi - ./ci-scripts/displaytime.sh 'py36 tests/integ' $start_time From 1fded9deb25b7b88e42f02f579430971b4cec4e4 Mon Sep 17 00:00:00 2001 From: Karim Nakad Date: Fri, 24 Jan 2020 15:35:31 -0800 Subject: [PATCH 5/6] infra: properly fail PR build if has-matching-changes fails --- buildspec-localmodetests.yml | 6 ++++-- buildspec-notebooktests.yml | 4 +++- buildspec.yml | 4 ---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/buildspec-localmodetests.yml b/buildspec-localmodetests.yml index ccbcf1a62d..f19643d952 100644 --- a/buildspec-localmodetests.yml +++ b/buildspec-localmodetests.yml @@ -11,15 +11,17 @@ phases: # local mode tests - start_time=`date +%s` + - HAS_MATCHING_CHANGES_OUTPUT=$(has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml") + - HAS_MATCHING_CHANGES_EXIT_CODE=$? - | - if has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"; then + if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then tox -e py36 -- tests/integ -m local_mode --durations 50 fi - ./ci-scripts/displaytime.sh 'py36 local mode' $start_time - start_time=`date +%s` - | - if has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"; then + if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then tox -e py27 -- tests/integ -m local_mode --durations 50 fi - ./ci-scripts/displaytime.sh 'py27 local mode' $start_time diff --git a/buildspec-notebooktests.yml b/buildspec-notebooktests.yml index a69ea4f248..6132b6ff11 100644 --- a/buildspec-notebooktests.yml +++ b/buildspec-notebooktests.yml @@ -6,8 +6,10 @@ phases: # run notebook test - echo "running notebook test" - start_time=`date +%s` + - HAS_MATCHING_CHANGES_OUTPUT=$(has-matching-changes "src/*.py" "setup.py" "setup.cfg" "tests/scripts/run-notebook-test.sh") + - HAS_MATCHING_CHANGES_EXIT_CODE=$? - | - if has-matching-changes "src/*.py" "setup.py" "setup.cfg" "tests/scripts/run-notebook-test.sh"; then + if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then ./tests/scripts/run-notebook-test.sh fi - ./ci-scripts/displaytime.sh 'notebook test' $start_time diff --git a/buildspec.yml b/buildspec.yml index 87485ece2a..a13d809175 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -14,10 +14,6 @@ phases: - HAS_MATCHING_CHANGES_OUTPUT=$(has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml") - HAS_MATCHING_CHANGES_EXIT_CODE=$? - | - if [ $HAS_MATCHING_CHANGES_EXIT_CODE = 1 ] ; then - echo "There was an error checking for matching changes. PR will now fail to prevent false negative (success) tests." - exit 1 - fi if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then python3 -u ci-scripts/queue_build.py fi From 5eedba822b17bb4308101d8e8990914d62b2f533 Mon Sep 17 00:00:00 2001 From: Karim Nakad Date: Fri, 24 Jan 2020 15:46:15 -0800 Subject: [PATCH 6/6] infra: properly fail PR build if has-matching-changes fails --- buildspec-localmodetests.yml | 1 - buildspec-notebooktests.yml | 1 - buildspec.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/buildspec-localmodetests.yml b/buildspec-localmodetests.yml index f19643d952..141b7bceb1 100644 --- a/buildspec-localmodetests.yml +++ b/buildspec-localmodetests.yml @@ -12,7 +12,6 @@ phases: # local mode tests - start_time=`date +%s` - HAS_MATCHING_CHANGES_OUTPUT=$(has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml") - - HAS_MATCHING_CHANGES_EXIT_CODE=$? - | if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then tox -e py36 -- tests/integ -m local_mode --durations 50 diff --git a/buildspec-notebooktests.yml b/buildspec-notebooktests.yml index 6132b6ff11..548f5d7d90 100644 --- a/buildspec-notebooktests.yml +++ b/buildspec-notebooktests.yml @@ -7,7 +7,6 @@ phases: - echo "running notebook test" - start_time=`date +%s` - HAS_MATCHING_CHANGES_OUTPUT=$(has-matching-changes "src/*.py" "setup.py" "setup.cfg" "tests/scripts/run-notebook-test.sh") - - HAS_MATCHING_CHANGES_EXIT_CODE=$? - | if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then ./tests/scripts/run-notebook-test.sh diff --git a/buildspec.yml b/buildspec.yml index a13d809175..1a4ec71025 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -12,7 +12,6 @@ phases: # run integration tests - start_time=`date +%s` - HAS_MATCHING_CHANGES_OUTPUT=$(has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml") - - HAS_MATCHING_CHANGES_EXIT_CODE=$? - | if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then python3 -u ci-scripts/queue_build.py