-
Notifications
You must be signed in to change notification settings - Fork 18
ci: DH-20051: shard e2e tests and merge shard reports #1361
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
base: main
Are you sure you want to change the base?
Changes from all commits
abaa0ce
794dcee
ba7fe48
e14cfbe
bf054b5
a7e704c
a93e9b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,33 +11,134 @@ on: | |
| - 'release/**' | ||
|
|
||
| jobs: | ||
| e2e-test: | ||
| build-e2e-images: | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Build Docker images | ||
| run: docker compose -f ./tests/docker-compose.yml build deephaven-plugins e2e-tests | ||
|
|
||
| - name: Export Docker images | ||
| run: | | ||
| docker save tests-deephaven-plugins tests-e2e-tests | gzip > e2e-docker-images.tar.gz | ||
|
|
||
| - name: Upload Docker images | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: e2e-docker-images | ||
| path: e2e-docker-images.tar.gz | ||
| retention-days: 1 | ||
|
|
||
| e2e-tests: | ||
| runs-on: ubuntu-24.04 | ||
| needs: [build-e2e-images] | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| group: ${{ github.workflow }}-${{ github.ref }}-e2e-tests-${{ matrix.config }} | ||
| cancel-in-progress: true | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| config: [chromium-1-2, chromium-2-2, firefox-1-2, firefox-2-2, webkit-1-2, webkit-2-2] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How did you decide on this sharding? Did you take a look at how long each shard takes individually? I seem to recall webkit taking longer which is why we split up webkit on web-client-ui but not chromium/firefox.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each shard is currently taking about 15 to 22 minutes to complete. I added a screenshot of the shard timings to the PR description for reference. We could split WebKit into 3 shards instead of 2, which might save another couple of minutes, but I think the current setup is reasonably well balanced for now. |
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Download Docker images | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| name: e2e-docker-images | ||
|
|
||
| - name: Load Docker images | ||
| run: gunzip -c e2e-docker-images.tar.gz | docker load | ||
|
|
||
| - name: Extract browser and shard config | ||
| id: config | ||
| env: | ||
| MATRIX_CONFIG: ${{ matrix.config }} | ||
| run: | | ||
| IFS='-' read -r browser shard shard_total <<< "$MATRIX_CONFIG" | ||
| echo "browser=$browser" >> "$GITHUB_OUTPUT" | ||
| echo "shard=$shard" >> "$GITHUB_OUTPUT" | ||
| echo "shard_total=$shard_total" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Run tests | ||
| run: './tools/run_docker.sh ./tests/docker-compose.yml e2e-tests' | ||
| env: | ||
| RUN_DOCKER_BUILD: 'false' | ||
| run: | | ||
| ./tools/run_docker.sh ./tests/docker-compose.yml e2e-tests \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does each shard need to rebuild the docker image separately? Or do they share the same build image so they don't need to each re-build it?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, each shard currently rebuilds the Docker image separately. We could change this to build once in a dedicated job and reuse that image across the shard jobs, which would save resources. Let me know if you want me to make that change.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to do that if possible |
||
| --reporter=blob \ | ||
| --project=${{ steps.config.outputs.browser }} \ | ||
| --shard=${{ steps.config.outputs.shard }}/${{ steps.config.outputs.shard_total }} | ||
|
|
||
| - name: Upload Playwright report | ||
| uses: actions/upload-artifact@v4 | ||
| - name: Upload Playwright blob report | ||
| uses: actions/upload-artifact@v7 | ||
| if: always() | ||
| with: | ||
| name: playwright-report | ||
| path: playwright-report/ | ||
| retention-days: 90 | ||
| name: playwright-report-blob-${{ matrix.config }} | ||
| path: blob-report/ | ||
| retention-days: 1 | ||
|
|
||
| - name: Dump server logs | ||
| if: failure() | ||
| run: docker logs deephaven-plugins > /tmp/server-log.txt | ||
|
|
||
| - name: Upload server logs | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: server-logs | ||
| name: server-logs-${{ matrix.config }} | ||
| path: /tmp/server-log.txt | ||
|
|
||
| merge-reports: | ||
| if: ${{ always() }} | ||
| runs-on: ubuntu-24.04 | ||
| needs: [e2e-tests] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Use Node.js | ||
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
|
|
||
| - name: Download blob reports | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| pattern: playwright-report-blob-* | ||
|
|
||
| - name: Merge into HTML report | ||
| run: | | ||
| mkdir -p all-blob-reports | ||
| for dir in playwright-report-blob-*; do | ||
| [ -d "$dir" ] || continue | ||
| zip_file=$(find "$dir" -type f -name '*.zip' | head -n 1) | ||
| [ -n "$zip_file" ] || continue | ||
| shard_name=${dir#playwright-report-blob-} | ||
| cp "$zip_file" "all-blob-reports/${shard_name}.zip" | ||
| done | ||
|
|
||
| if ! find all-blob-reports -type f -name '*.zip' | grep -q .; then | ||
| echo "No blob report zip files were found after download." | ||
| exit 1 | ||
| fi | ||
|
|
||
| npx -y playwright@1.44.1 merge-reports --reporter html,github ./all-blob-reports | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably update playwright as well. v1.44.1 is pretty old. That could be a separate PR though. |
||
|
|
||
| - name: Upload HTML report | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: playwright-report | ||
| path: playwright-report/ | ||
| retention-days: 30 | ||
|
|
||
| e2e-test: | ||
| if: ${{ always() }} | ||
| runs-on: ubuntu-24.04 | ||
| needs: [e2e-tests, merge-reports] | ||
| steps: | ||
| - name: Fail if any tests failed or cancelled | ||
| run: exit 1 | ||
| if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we should rename this step, we still should have an

e2e-teststep at the end that passes/fails based on the results. Reason being the branch protection requires ane2e-teststep to pass before you can merge a PR:In web-client-ui we consolidate the result into
e2e-results, but I think we should just name ite2e-testhere so that it matches the existing branch protection rules... otherwise I need to change those rules as well, and change it for the release branches... easier to just keep the same name.https://github.com/deephaven/web-client-ui/blob/caeabb02f0abc824a07c505d0a7ca8693dd63cbb/.github/workflows/e2e.yml#L125