Skip to content

Commit

Permalink
Revert "disable test log reporting to flaky-bot"
Browse files Browse the repository at this point in the history
This reverts commit 03987a4.
  • Loading branch information
briandorsey committed Sep 3, 2024
1 parent 03987a4 commit b01e844
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/flakybot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,26 @@ jobs:
contents: 'read'
id-token: 'write'
steps:
- name: DISABLED run FlakyBot
run: echo flakybot error reporting disabled
- name: authenticate
uses: 'google-github-actions/auth@62cf5bd3e4211a0a0b51f2c6d6a37129d828611d' # v2
with:
workload_identity_provider: 'projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider'
service_account: 'kokoro-system-test@long-door-651.iam.gserviceaccount.com'
create_credentials_file: 'true'
access_token_lifetime: 600s
- name: download test results
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
with:
name: test-results
- name: download FlakyBot
run: |
curl -s -L https://github.com/googleapis/repo-automation-bots/archive/refs/tags/flakybot-v${{ env.FLAKYBOT_VERSION }}.tar.gz -o flakybot.tar.gz
tar xzf flakybot.tar.gz
cp -rT repo-automation-bots-flakybot-v${{ env.FLAKYBOT_VERSION}}/packages/flakybot/ .
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
cache: true
cache-dependency-path: '${{ github.workspace }}/go.sum'
go-version-file: '${{ github.workspace }}/go.mod'
- name: run FlakyBot
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}}
13 changes: 13 additions & 0 deletions .kokoro/build-with-appengine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ trap cleanup EXIT HUP
# Install dependencies and run tests
npm install

# If tests are running against main, configure FlakyBot
# to open issues on failures:
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"release"* ]]; then
export MOCHA_REPORTER_SUITENAME=${PROJECT}
notify_flakybot() {
# Call the original trap function.
cleanup
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
$KOKORO_GFILE_DIR/linux_amd64/flakybot
}
trap notify_flakybot EXIT HUP
fi

npm test

exit $?
11 changes: 11 additions & 0 deletions .kokoro/build-with-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,17 @@ export SERVICE_NAME="${SAMPLE_NAME}-${SUFFIX}"
export NODE_ENV=development
npm install

# If tests are running against main, configure FlakyBot
# to open issues on failures:
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"release"* ]]; then
export MOCHA_REPORTER_SUITENAME=${PROJECT}
notify_flakybot() {
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
$KOKORO_GFILE_DIR/linux_amd64/flakybot
}
trap notify_flakybot EXIT HUP
fi

# Configure Cloud SQL variables for deploying idp-sql sample
export DB_NAME="kokoro_ci"
export DB_USER="kokoro_ci"
Expand Down
16 changes: 16 additions & 0 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,22 @@ print_logfile() {
echo '----- End ${MOCHA_REPORTER_OUTPUT} -----'
}

# If tests are running against main, configure FlakyBot
# to open issues on failures:
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"release"* ]]; then
export MOCHA_REPORTER_SUITENAME=${PROJECT}
cleanup() {
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
$KOKORO_GFILE_DIR/linux_amd64/flakybot

# We can only set one trap per signal, so run `print_logfile` here
print_logfile
}
trap cleanup EXIT HUP
else
trap print_logfile EXIT HUP
fi

npm test

exit $?

0 comments on commit b01e844

Please sign in to comment.