Skip to content

Commit 8961aac

Browse files
laurenyuajaykarpur
authored andcommitted
infra: properly fail build if has-matching-changes fails (#273)
1 parent c46b6f6 commit 8961aac

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

buildspec.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ phases:
8686
- create-key-pair
8787
- launch-ec2-instance --instance-type $instance_type --ami-name dlami-ubuntu
8888

89+
- HAS_MATCHING_CHANGES_OUTPUT=$(has-matching-changes "test/" "tests/" "src/*.py" "setup.py" "docker/*" "buildspec.yml")
90+
8991
# run cpu integration tests
9092
- |
91-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
93+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
9294
pytest test/integration/local --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --tag $CPU_TAG_PY2 --framework-version $FRAMEWORK_VERSION --py-version 2 --processor cpu
9395
pytest test/integration/local --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --tag $CPU_TAG_PY3 --framework-version $FRAMEWORK_VERSION --py-version 3 --processor cpu
9496
else
@@ -97,7 +99,7 @@ phases:
9799
98100
# run gpu integration tests
99101
- |
100-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
102+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
101103
printf "$SETUP_CMDS" > $SETUP_FILE
102104
cmd="pytest test/integration/local --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --tag $GPU_TAG_PY2 --framework-version $FRAMEWORK_VERSION --py-version 2 --processor gpu"
103105
remote-test --github-repo $GITHUB_REPO --test-cmd "$cmd" --setup-file $SETUP_FILE --pr-number "$PR_NUM"
@@ -109,7 +111,7 @@ phases:
109111
110112
# run sagemaker tests
111113
- |
112-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
114+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
113115
pytest test/integration/sagemaker -n 8 --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --account-id $ACCOUNT --tag $CPU_TAG_PY2 --py-version 2 --processor cpu
114116
pytest test/integration/sagemaker -n 8 --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --account-id $ACCOUNT --tag $GPU_TAG_PY2 --py-version 2 --processor gpu
115117
pytest test/integration/sagemaker -n 8 --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --account-id $ACCOUNT --tag $CPU_TAG_PY3 --py-version 3 --processor cpu

0 commit comments

Comments
 (0)