File tree Expand file tree Collapse file tree 4 files changed +63
-2
lines changed Expand file tree Collapse file tree 4 files changed +63
-2
lines changed Original file line number Diff line number Diff line change 28
28
contents : ' read'
29
29
id-token : ' write'
30
30
steps :
31
- - name : DISABLED run FlakyBot
32
- run : echo flakybot error reporting disabled
31
+ - name : authenticate
32
+ uses : ' google-github-actions/auth@62cf5bd3e4211a0a0b51f2c6d6a37129d828611d' # v2
33
+ with :
34
+ workload_identity_provider : ' projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider'
35
+ service_account :
' [email protected] '
36
+ create_credentials_file : ' true'
37
+ access_token_lifetime : 600s
38
+ - name : download test results
39
+ uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
40
+ with :
41
+ name : test-results
42
+ - name : download FlakyBot
43
+ run : |
44
+ curl -s -L https://github.com/googleapis/repo-automation-bots/archive/refs/tags/flakybot-v${{ env.FLAKYBOT_VERSION }}.tar.gz -o flakybot.tar.gz
45
+ tar xzf flakybot.tar.gz
46
+ cp -rT repo-automation-bots-flakybot-v${{ env.FLAKYBOT_VERSION}}/packages/flakybot/ .
47
+ - uses : actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
48
+ with :
49
+ cache : true
50
+ cache-dependency-path : ' ${{ github.workspace }}/go.sum'
51
+ go-version-file : ' ${{ github.workspace }}/go.mod'
52
+ - name : run FlakyBot
53
+ run : go run flakybot.go --repo GoogleCloudPlatform/nodejs-docs-samples --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
Original file line number Diff line number Diff line change @@ -61,6 +61,19 @@ trap cleanup EXIT HUP
61
61
# Install dependencies and run tests
62
62
npm install
63
63
64
+ # If tests are running against main, configure FlakyBot
65
+ # to open issues on failures:
66
+ if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = * " release" * ]]; then
67
+ export MOCHA_REPORTER_SUITENAME=${PROJECT}
68
+ notify_flakybot () {
69
+ # Call the original trap function.
70
+ cleanup
71
+ chmod +x $KOKORO_GFILE_DIR /linux_amd64/flakybot
72
+ $KOKORO_GFILE_DIR /linux_amd64/flakybot
73
+ }
74
+ trap notify_flakybot EXIT HUP
75
+ fi
76
+
64
77
npm test
65
78
66
79
exit $?
Original file line number Diff line number Diff line change @@ -118,6 +118,17 @@ export SERVICE_NAME="${SAMPLE_NAME}-${SUFFIX}"
118
118
export NODE_ENV=development
119
119
npm install
120
120
121
+ # If tests are running against main, configure FlakyBot
122
+ # to open issues on failures:
123
+ if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = * " release" * ]]; then
124
+ export MOCHA_REPORTER_SUITENAME=${PROJECT}
125
+ notify_flakybot () {
126
+ chmod +x $KOKORO_GFILE_DIR /linux_amd64/flakybot
127
+ $KOKORO_GFILE_DIR /linux_amd64/flakybot
128
+ }
129
+ trap notify_flakybot EXIT HUP
130
+ fi
131
+
121
132
# Configure Cloud SQL variables for deploying idp-sql sample
122
133
export DB_NAME=" kokoro_ci"
123
134
export DB_USER=" kokoro_ci"
Original file line number Diff line number Diff line change @@ -139,6 +139,22 @@ print_logfile() {
139
139
echo ' ----- End ${MOCHA_REPORTER_OUTPUT} -----'
140
140
}
141
141
142
+ # If tests are running against main, configure FlakyBot
143
+ # to open issues on failures:
144
+ if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = * " release" * ]]; then
145
+ export MOCHA_REPORTER_SUITENAME=${PROJECT}
146
+ cleanup () {
147
+ chmod +x $KOKORO_GFILE_DIR /linux_amd64/flakybot
148
+ $KOKORO_GFILE_DIR /linux_amd64/flakybot
149
+
150
+ # We can only set one trap per signal, so run `print_logfile` here
151
+ print_logfile
152
+ }
153
+ trap cleanup EXIT HUP
154
+ else
155
+ trap print_logfile EXIT HUP
156
+ fi
157
+
142
158
npm test
143
159
144
160
exit $?
You can’t perform that action at this time.
0 commit comments