Skip to content

Commit 8dd7ec2

Browse files
laurenyuajaykarpur
authored andcommitted
infra: properly fail build if has-matching-changes fails (#126)
1 parent 6b2ae50 commit 8dd7ec2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

buildspec.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,19 @@ phases:
7575
- create-key-pair
7676
- launch-ec2-instance --instance-type $instance_type --ami-name dlami-ubuntu
7777

78+
- HAS_MATCHING_CHANGES_OUTPUT=$(has-matching-changes "test/" "tests/" "src/*.py" "setup.py" "setup.cfg" "docker/*" "buildspec.yml")
79+
7880
# run cpu integration tests
7981
- |
80-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
82+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
8183
pytest test/integration/local --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --tag $CPU_TAG --framework-version $FRAMEWORK_VERSION --py-version $CPU_PY_VERSION --processor cpu
8284
else
8385
echo "skipping cpu integration tests"
8486
fi
8587
8688
# run gpu integration tests
8789
- |
88-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
90+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
8991
printf "$SETUP_CMDS" > $SETUP_FILE
9092
cmd="pytest test/integration/local --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --tag $GPU_TAG --framework-version $FRAMEWORK_VERSION --py-version $GPU_PY_VERSION --processor gpu"
9193
remote-test --github-repo $GITHUB_REPO --test-cmd "$cmd" --setup-file $SETUP_FILE --pr-number "$PR_NUM"
@@ -95,15 +97,15 @@ phases:
9597
9698
# run cpu sagemaker tests
9799
- |
98-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
100+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
99101
pytest test/integration/sagemaker --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --aws-id $ACCOUNT --tag $CPU_TAG --instance-type $CPU_INSTANCE_TYPE
100102
else
101103
echo "skipping cpu sagemaker tests"
102104
fi
103105
104106
# run gpu sagemaker tests
105107
- |
106-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
108+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
107109
pytest test/integration/sagemaker --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --aws-id $ACCOUNT --tag $GPU_TAG --instance-type $GPU_INSTANCE_TYPE
108110
else
109111
echo "skipping gpu sagemaker tests"

0 commit comments

Comments
 (0)