Skip to content

Commit

Permalink
test: postsubmit - fix cloudbuild job filtering. Part of #4046 (#4122)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobgy committed Jul 2, 2020
1 parent 47b0878 commit fadbcc0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,5 @@ timeout: '3600s'
options:
diskSizeGb: 300
machineType: 'N1_HIGHCPU_8'
tags:
- build-each-commit
2 changes: 2 additions & 0 deletions .release.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -649,3 +649,5 @@ images:
- 'gcr.io/ml-pipeline/google/pipelines-test/deployer:$TAG_NAME'
- 'gcr.io/ml-pipeline/google/pipelines-test:$TAG_NAME'
timeout: '1200s'
tags:
- release-on-tag
5 changes: 3 additions & 2 deletions test/postsubmit-tests-with-pipeline-deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ source "${DIR}/test-prep.sh"
CLOUDBUILD_TIMEOUT_SECONDS=3600
PULL_CLOUDBUILD_STATUS_MAX_ATTEMPT=$(expr ${CLOUDBUILD_TIMEOUT_SECONDS} / 20 )
CLOUDBUILD_STARTED=TIMEOUT
CLOUDBUILD_FILTER="substitutions.COMMIT_SHA:${PULL_BASE_SHA} AND tags:build-each-commit"

for i in $(seq 1 ${PULL_CLOUDBUILD_STATUS_MAX_ATTEMPT})
do
output=`gcloud builds list --project="$CLOUDBUILD_PROJECT" --filter="sourceProvenance.resolvedRepoSource.commitSha:${PULL_BASE_SHA}"`
output=`gcloud builds list --project="$CLOUDBUILD_PROJECT" --filter="$CLOUDBUILD_FILTER"`
if [[ ${output} != "" ]]; then
CLOUDBUILD_STARTED=True
break
Expand All @@ -106,7 +107,7 @@ fi
CLOUDBUILD_FINISHED=TIMEOUT
for i in $(seq 1 ${PULL_CLOUDBUILD_STATUS_MAX_ATTEMPT})
do
output=`gcloud builds list --project="$CLOUDBUILD_PROJECT" --filter="sourceProvenance.resolvedRepoSource.commitSha:${PULL_BASE_SHA}"`
output=`gcloud builds list --project="$CLOUDBUILD_PROJECT" --filter="$CLOUDBUILD_FILTER"`
if [[ ${output} == *"SUCCESS"* ]]; then
CLOUDBUILD_FINISHED=SUCCESS
break
Expand Down

0 comments on commit fadbcc0

Please sign in to comment.