Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🪟 🔧 Run FE e2e tests on separate runner #21428

Merged
merged 3 commits into from
Jan 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/[email protected]
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