Skip to content

Commit

Permalink
AJ-1362 - Add retries in WDS end to end test (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliadub authored Nov 14, 2023
1 parent 06001c0 commit 86b9591
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 13 deletions.
28 changes: 28 additions & 0 deletions .github/actions/create-bee/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'create bee'
description: 'Creates a bee for the wds e2e test'
inputs:
token:
description: 'The auth token to use for bee creation'
required: true
type: string
bee_name:
description: 'The name of the bee to create'
required: true
type: string

runs:
using: 'composite'
steps:
- name: dispatch to terra-github-workflows
uses: broadinstitute/workflow-dispatch@v3
with:
workflow: bee-create
repo: broadinstitute/terra-github-workflows
ref: refs/heads/main
token: '${{ inputs.token }}'
inputs: >-
{
"bee-name": "${{ inputs.bee_name }}",
"bee-template-name": "rawls-e2e-azure-tests",
"version-template": "dev"
}
30 changes: 17 additions & 13 deletions .github/workflows/run-e2e-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: run e2e tests
name: Run WDS e2e tests with BEE
'on':
schedule:
# run twice a day at 10:00 and 22:00 UTC every day of the week
Expand Down Expand Up @@ -38,20 +38,24 @@ jobs:
contents: read
id-token: write
steps:
- name: Get actions
uses: actions/checkout@v3

- name: dispatch to terra-github-workflows
uses: broadinstitute/workflow-dispatch@v3
id: FirstAttempt
continue-on-error: true
uses: ./.github/actions/create-bee
with:
workflow: bee-create
repo: broadinstitute/terra-github-workflows
ref: refs/heads/main
token: '${{ env.TOKEN }}'
inputs: >-
{
"bee-name": "${{ env.BEE_NAME }}",
"bee-template-name":
"rawls-e2e-azure-tests",
"version-template": "dev"
}
bee_name: ${{ env.BEE_NAME }}
token: '${{ env.TOKEN }}'

- name: retry dispatch to terra-github-workflows in case of failure
if: steps.FirstAttempt.outcome == 'failure'
uses: ./.github/actions/create-bee
with:
bee_name: ${{ env.BEE_NAME }},
token: ${{ env.TOKEN }}

attach-landing-zone-to-bee-workflow:
runs-on: ubuntu-latest
needs: [ init-github-context, create-bee-workflow, params-gen ]
Expand Down
30 changes: 30 additions & 0 deletions docs/WDS End to End test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Workspace Data Service End to End test

To continuously test basic WDS functionality and make sure it is working with no errors, there is an automated end to end test that runs twice a day on the latest WDS bits available in Leonardo.

# How does the test work

The test gets kicked off via a github action that runs on a schedule. The github action is defined [**here**](https://github.com/DataBiosphere/terra-workspace-data-service/blob/main/.github/workflows/run-e2e-tests.yaml).
You can see the github action runs [**here**](https://github.com/DataBiosphere/terra-workspace-data-service/actions/workflows/run-e2e-tests.yaml).

That action actually kicks of a few other actions in other repos, mainly:
- a github action to create a bee and connect a landing zone to it (using repo: [**terra-github-workflows**](https://github.com/broadinstitute/terra-github-workflows/actions/workflows/bee-create.yaml))
- a github action to run the e2e (defined in this repo: [**dsp-reusable-workflows**](https://github.com/broadinstitute/dsp-reusable-workflows/blob/main/e2e-test/wds_azure_e2etest.py))
- a github action to destroy the bee (not used at this time, also defined in terra-github-workflows)

# How to test e2e test if making changes

Adjust which branch github actions are pulling from. Most common scenario will be changing the branch you call for getting the e2e test, instead of pulling from main, you can pull directly from your own branch (as long as it was pushed into the repo)

Change branch in your branch in WDS to pull from a different e2e branch, adjusted [**here**](https://github.com/DataBiosphere/terra-workspace-data-service/blob/main/.github/workflows/run-e2e-tests.yaml#L79)
Then change the github action that actually runs the test that is defined in [**dsp-reusable-workflows**](https://github.com/broadinstitute/dsp-reusable-workflows/blob/main/.github/workflows/run-e2e-tests.yaml#L36)
After these changes, you can execute the e2e test from your branch by using the manual "Run workflow" trigger [**here**](https://github.com/DataBiosphere/terra-workspace-data-service/actions/workflows/run-e2e-tests.yaml), and selecting your branch vs main.

# What does the test currently cover

- Workspace creation
- Polling for Wds app to start as expected
- Wds data upload
- Wds cloning
- Wds check to ensure cloning worked as expected
- Workspace deletion

0 comments on commit 86b9591

Please sign in to comment.