Skip to content

Commit

Permalink
AJ-1465 - Add landing zone attach retry to e2e tests (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliadub authored Nov 15, 2023
1 parent 5b66479 commit b0cc8eb
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 13 deletions.
32 changes: 32 additions & 0 deletions .github/actions/landing-zone-attach/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'create bee'
description: 'Attaches landing zone to an existing bee'
inputs:
token:
description: 'The auth token to use for connecting to bee'
required: true
type: string
bee_name:
description: 'The name of the bee to connect to'
required: true
type: string
project_name:
description: 'The name of billing project to attach to'
required: true
type: string

runs:
using: 'composite'
steps:
- name: dispatch to terra-github-workflows
uses: broadinstitute/workflow-dispatch@v3
with:
workflow: attach-billing-project-to-landing-zone.yaml
repo: broadinstitute/terra-github-workflows
ref: refs/heads/main
token: '${{ inputs.token }}'
inputs: >-
{
"bee-name": "${{ inputs.bee_name }}",
"billing-project": "${{ inputs.project_name }}",
"service-account": "[email protected]"
}
34 changes: 21 additions & 13 deletions .github/workflows/run-e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ jobs:
uses: actions/checkout@v3

- name: dispatch to terra-github-workflows
id: FirstAttempt
id: FirstAttemptCreateBee
continue-on-error: true
uses: ./.github/actions/create-bee
with:
bee_name: ${{ env.BEE_NAME }}
token: '${{ env.TOKEN }}'

- name: retry dispatch to terra-github-workflows in case of failure
if: steps.FirstAttempt.outcome == 'failure'
if: steps.FirstAttemptCreateBee.outcome == 'failure'
uses: ./.github/actions/create-bee
with:
bee_name: ${{ env.BEE_NAME }},
Expand All @@ -60,19 +60,26 @@ jobs:
runs-on: ubuntu-latest
needs: [ init-github-context, create-bee-workflow, params-gen ]
steps:
- name: Get actions
uses: actions/checkout@v3

- name: dispatch to terra-github-workflows
uses: broadinstitute/workflow-dispatch@v3
id: FirstAttemptLandingZone
continue-on-error: true
uses: ./.github/actions/landing-zone-attach
with:
workflow: attach-billing-project-to-landing-zone.yaml
repo: broadinstitute/terra-github-workflows
ref: refs/heads/main
token: '${{ env.TOKEN }}'
inputs: >-
{
"bee-name": "${{ env.BEE_NAME }}",
"billing-project": "${{needs.params-gen.outputs.project-name }}",
"service-account": "[email protected]"
}
bee_name: ${{ env.BEE_NAME }}
token: '${{ env.TOKEN }}'
project_name: ${{needs.params-gen.outputs.project-name }}

- name: retry dispatch to terra-github-workflows in case of failure
if: steps.FirstAttemptLandingZone.outcome == 'failure'
uses: ./.github/actions/landing-zone-attach
with:
bee_name: ${{ env.BEE_NAME }}
token: '${{ env.TOKEN }}'
project_name: ${{needs.params-gen.outputs.project-name }}

run-e2e-test-job:
needs:
- attach-landing-zone-to-bee-workflow
Expand Down Expand Up @@ -103,6 +110,7 @@ jobs:
inputs: '{ "bee-name": "${{ env.BEE_NAME }}" }'
report-workflow:
uses: broadinstitute/sherlock/.github/workflows/client-report-workflow.yaml@main
if: github.ref == 'refs/heads/main'
with:
notify-slack-channels-upon-workflow-failure: "#dsp-analysis-journeys-alerts"
permissions:
Expand Down

0 comments on commit b0cc8eb

Please sign in to comment.