Skip to content

Commit

Permalink
🪟 🔧 Run FE e2e tests on separate runner (#21428)
Browse files Browse the repository at this point in the history
* Run FE e2e tests on separate runner

* Renamed step name
  • Loading branch information
timroes authored Jan 16, 2023
1 parent 1757a6e commit cb31ff5
Showing 1 changed file with 79 additions and 11 deletions.
90 changes: 79 additions & 11 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,79 @@ jobs:
autoAcceptChanges: true
exitOnceUploaded: true

frontend-test:
# In case of self-hosted EC2 errors, remove this block.
stop-frontend-runner:
name: "Frontend: Stop Runner"
timeout-minutes: 10
needs:
- start-frontend-runner # required to get output from the start-runner job
- frontend-build # required to wait when then build job is done
runs-on: ubuntu-latest
# Always is required to stop the runner even if the previous job has errors. However always() runs even if the previous step is skipped.
# Thus, we check for skipped here.
if: ${{ always() && needs.start-frontend-runner.result != 'skipped'}}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Checkout Airbyte
uses: actions/checkout@v3
- name: Check PAT rate limits
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.AIRBYTEIO_PAT }} \
${{ secrets.OSS_BUILD_RUNNER_GITHUB_PAT }} \
${{ secrets.SUPERTOPHER_PAT }} \
${{ secrets.DAVINCHIA_PAT }}
- name: Stop EC2 runner
uses: supertopher/ec2-github-runner@base64v1.0.10
with:
mode: stop
github-token: ${{ env.PAT }}
label: ${{ needs.start-frontend-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-frontend-runner.outputs.ec2-instance-id }}

## Frontend Test
# In case of self-hosted EC2 errors, remove this block.
start-frontend-e2e-runner:
name: "Frontend E2E Tests: Start EC2 Runner"
needs:
- changes
# Because scheduled builds on master require us to skip the changes job. Use always() to force this to run on master.
if: |
needs.changes.outputs.frontend == 'true' || needs.changes.outputs.build == 'true' || github.ref == 'refs/heads/master'
|| (always() && needs.changes.outputs.backend == 'true')
timeout-minutes: 10
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Checkout Airbyte
uses: actions/checkout@v3
- name: Check PAT rate limits
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.AIRBYTEIO_PAT }} \
${{ secrets.OSS_BUILD_RUNNER_GITHUB_PAT }} \
${{ secrets.SUPERTOPHER_PAT }} \
${{ secrets.DAVINCHIA_PAT }}
- name: Start AWS Runner
id: start-ec2-runner
uses: ./.github/actions/start-aws-runner
with:
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
github-token: ${{ env.PAT }}

frontend-e2e-test:
name: "Frontend: Run End-to-End Tests"
needs:
- start-frontend-runner # required to have runner started
runs-on: ${{ needs.start-frontend-runner.outputs.label }} # run the job on the newly created runner
- start-frontend-e2e-runner # required to have runner started
runs-on: ${{ needs.start-frontend-e2e-runner.outputs.label }} # run the job on the newly created runner
timeout-minutes: 120
steps:
- name: Checkout Airbyte
Expand Down Expand Up @@ -505,18 +573,18 @@ jobs:
command: ./tools/bin/e2e_test.sh
attempt_limit: 3
attempt_delay: 5000 # in ms

# In case of self-hosted EC2 errors, remove this block.
stop-frontend-runner:
name: "Frontend: Stop Runner"
stop-frontend-e2e-runner:
name: "Frontend E2E Tests: Stop Runner"
timeout-minutes: 10
needs:
- start-frontend-runner # required to get output from the start-runner job
- frontend-test # required to wait when the e2e-test job is done
- frontend-build # required to wait when then build job is done
- start-frontend-e2e-runner # required to get output from the start-runner job
- frontend-e2e-test # required to wait when the e2e-test job is done
runs-on: ubuntu-latest
# Always is required to stop the runner even if the previous job has errors. However always() runs even if the previous step is skipped.
# Thus, we check for skipped here.
if: ${{ always() && needs.start-frontend-runner.result != 'skipped'}}
if: ${{ always() && needs.start-frontend-e2e-runner.result != 'skipped'}}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand All @@ -538,8 +606,8 @@ jobs:
with:
mode: stop
github-token: ${{ env.PAT }}
label: ${{ needs.start-frontend-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-frontend-runner.outputs.ec2-instance-id }}
label: ${{ needs.start-frontend-e2e-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-frontend-e2e-runner.outputs.ec2-instance-id }}

## FOLLOWING BUILDS ARE ALL PLATFORM BUILDS.

Expand Down

0 comments on commit cb31ff5

Please sign in to comment.