From abaa0ce26225a83be93252a0dccd85bc5e79d889 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 11 Jun 2026 12:04:29 -0400 Subject: [PATCH 1/7] Update e2e.yml --- .github/workflows/e2e.yml | 78 +++++++++++++++++++++++++++++++++---- playwright-docker.config.ts | 1 - tests/Dockerfile | 8 ++-- tests/docker-compose.yml | 3 +- 4 files changed, 74 insertions(+), 16 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 5f372b9d4..9a5af88bb 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -9,27 +9,46 @@ on: branches: - main - 'release/**' + workflow_dispatch: jobs: - e2e-test: + e2e-tests: runs-on: ubuntu-24.04 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] steps: - name: Checkout uses: actions/checkout@v4 + - 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' + run: | + ./tools/run_docker.sh ./tests/docker-compose.yml e2e-tests \ + --reporter=blob \ + --project=${{ steps.config.outputs.browser }} \ + --shard=${{ steps.config.outputs.shard }}/${{ steps.config.outputs.shard_total }} - - name: Upload Playwright report + - name: Upload Playwright blob report uses: actions/upload-artifact@v4 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() @@ -39,5 +58,48 @@ jobs: if: failure() uses: actions/upload-artifact@v4 with: - name: server-logs + name: server-logs-${{ matrix.config }} path: /tmp/server-log.txt + + merge-reports: + if: ${{ !cancelled() }} + runs-on: ubuntu-24.04 + needs: [e2e-tests] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + + - name: Download blob reports + uses: actions/download-artifact@v4 + 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 + + - name: Upload HTML report + uses: actions/upload-artifact@v4 + with: + name: playwright-report + path: playwright-report/ + retention-days: 90 diff --git a/playwright-docker.config.ts b/playwright-docker.config.ts index 1151d0fe5..c6a3856ff 100644 --- a/playwright-docker.config.ts +++ b/playwright-docker.config.ts @@ -7,7 +7,6 @@ const config: PlaywrightTestConfig = { ...DefaultConfig.use, baseURL: 'http://deephaven-plugins:10000/ide/', }, - reporter: process.env.CI ? [['github'], ['html']] : DefaultConfig.reporter, }; export default config; diff --git a/tests/Dockerfile b/tests/Dockerfile index dc2bdd12d..2e1d772da 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -4,13 +4,11 @@ FROM mcr.microsoft.com/playwright:v1.44.1-jammy AS playwright WORKDIR /work/ -# Update packages list and install some build tools. -# Installing fonts-dejavu-core so we have some common fonts with the GH actions -# runner that can be used to render unicode fonts. See web-client-ui README for more info. +# Install a minimal font package so rendering is closer to GH Actions runners. RUN set -eux; \ apt-get update; \ - apt-get install build-essential --yes; \ - apt-get install fonts-dejavu-core --yes; + apt-get install --no-install-recommends -y fonts-dejavu-core; \ + rm -rf /var/lib/apt/lists/* RUN fc-list : family; diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 9df2934aa..d6b9a026a 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: deephaven-plugins: container_name: deephaven-plugins @@ -27,6 +25,7 @@ services: volumes: - ../tests:/work/tests - ../test-results:/work/test-results + - ../blob-report:/work/blob-report - ../playwright-report:/work/playwright-report - ../plugins:/work/plugins entrypoint: 'npx playwright test --config=playwright-docker.config.ts' From 794dceea1c2bd1445af90d64daa86e688975b4b1 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 12 Jun 2026 11:20:30 -0400 Subject: [PATCH 2/7] fix: version, flags, workflow_dispatch, e2e-results, 30 days use newer versions of action prefer the long form of flags remove workflow_dispatch e2e-results 30 days instead of 90 --- .github/workflows/e2e.yml | 26 +++++++++++++++++--------- tests/Dockerfile | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 9a5af88bb..540cd1717 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -9,7 +9,6 @@ on: branches: - main - 'release/**' - workflow_dispatch: jobs: e2e-tests: @@ -23,7 +22,7 @@ jobs: config: [chromium-1-2, chromium-2-2, firefox-1-2, firefox-2-2, webkit-1-2, webkit-2-2] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Extract browser and shard config id: config @@ -43,7 +42,7 @@ jobs: --shard=${{ steps.config.outputs.shard }}/${{ steps.config.outputs.shard_total }} - name: Upload Playwright blob report - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 if: always() with: name: playwright-report-blob-${{ matrix.config }} @@ -56,7 +55,7 @@ jobs: - name: Upload server logs if: failure() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: server-logs-${{ matrix.config }} path: /tmp/server-log.txt @@ -67,15 +66,15 @@ jobs: needs: [e2e-tests] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Use Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version-file: '.nvmrc' - name: Download blob reports - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: pattern: playwright-report-blob-* @@ -98,8 +97,17 @@ jobs: npx -y playwright@1.44.1 merge-reports --reporter html,github ./all-blob-reports - name: Upload HTML report - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: playwright-report path: playwright-report/ - retention-days: 90 + 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') }} diff --git a/tests/Dockerfile b/tests/Dockerfile index 2e1d772da..15f5cdc52 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -7,7 +7,7 @@ WORKDIR /work/ # Install a minimal font package so rendering is closer to GH Actions runners. RUN set -eux; \ apt-get update; \ - apt-get install --no-install-recommends -y fonts-dejavu-core; \ + apt-get install --no-install-recommends --yes fonts-dejavu-core; \ rm -rf /var/lib/apt/lists/* RUN fc-list : family; From ba7fe48baec1d958f1dad583c8e287ddda2a3e3f Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 12 Jun 2026 11:46:02 -0400 Subject: [PATCH 3/7] test failing run --- tests/ui_plotly.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ui_plotly.spec.ts b/tests/ui_plotly.spec.ts index bd125a9ef..5556c8ab7 100644 --- a/tests/ui_plotly.spec.ts +++ b/tests/ui_plotly.spec.ts @@ -7,7 +7,7 @@ test.describe('plotly works in deephaven.ui', () => { test(name, async ({ page }) => { await gotoPage(page, ''); await openPanel(page, name, SELECTORS.WIDGET_LOADER_ELEMENT_VISIBLE); - + expect(false).toBe(true); await expect( page.locator(SELECTORS.WIDGET_LOADER_ELEMENT_VISIBLE) ).toHaveScreenshot(); From e14cfbee9c3f9c628522c8b734dbd1290d4f0e1d Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 12 Jun 2026 12:07:50 -0400 Subject: [PATCH 4/7] remove failing run line --- tests/ui_plotly.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ui_plotly.spec.ts b/tests/ui_plotly.spec.ts index 5556c8ab7..2ab70b8cf 100644 --- a/tests/ui_plotly.spec.ts +++ b/tests/ui_plotly.spec.ts @@ -7,7 +7,7 @@ test.describe('plotly works in deephaven.ui', () => { test(name, async ({ page }) => { await gotoPage(page, ''); await openPanel(page, name, SELECTORS.WIDGET_LOADER_ELEMENT_VISIBLE); - expect(false).toBe(true); + await expect( page.locator(SELECTORS.WIDGET_LOADER_ELEMENT_VISIBLE) ).toHaveScreenshot(); From bf054b57512c41d3d7601b301ec92315cea49618 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 12 Jun 2026 12:23:54 -0400 Subject: [PATCH 5/7] HTML gets produced even when tests fail --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 540cd1717..8ebd51ec2 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -61,7 +61,7 @@ jobs: path: /tmp/server-log.txt merge-reports: - if: ${{ !cancelled() }} + if: ${{ always() }} runs-on: ubuntu-24.04 needs: [e2e-tests] steps: From a7e704c39e9d05754f6245eb85bdaa6d0f7f8687 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 12 Jun 2026 12:26:34 -0400 Subject: [PATCH 6/7] build once in a dedicated job and reuse that image across the shards --- .github/workflows/e2e.yml | 31 +++++++++++++++++++++++++++++++ tools/run_docker.sh | 9 +++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 8ebd51ec2..5e46095b8 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -11,8 +11,29 @@ on: - 'release/**' jobs: + 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@v5 + 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 }}-e2e-tests-${{ matrix.config }} cancel-in-progress: true @@ -24,6 +45,14 @@ jobs: - name: Checkout uses: actions/checkout@v5 + - name: Download Docker images + uses: actions/download-artifact@v5 + 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: @@ -35,6 +64,8 @@ jobs: echo "shard_total=$shard_total" >> "$GITHUB_OUTPUT" - name: Run tests + env: + RUN_DOCKER_BUILD: 'false' run: | ./tools/run_docker.sh ./tests/docker-compose.yml e2e-tests \ --reporter=blob \ diff --git a/tools/run_docker.sh b/tools/run_docker.sh index d44eb0eb3..f1e7db523 100755 --- a/tools/run_docker.sh +++ b/tools/run_docker.sh @@ -3,16 +3,21 @@ COMPOSE_FILE=$1 shift +BUILD_FLAG=(--build) +if [[ "${RUN_DOCKER_BUILD:-true}" == "false" ]]; then + BUILD_FLAG=() +fi + # Start the containers if [[ "${CI}" == "1" || "${CI}" == "true" ]]; then # In CI, keep the container in case we need to dump logs in another # step of the GH action. It should be cleaned up automatically by the CI runner. - docker compose -f "${COMPOSE_FILE}" run --service-ports --build -e CI=true "$@" + docker compose -f "${COMPOSE_FILE}" run --service-ports "${BUILD_FLAG[@]}" -e CI=true "$@" exit_code=$? # stop instead of down to preserve container logs docker compose -f "${COMPOSE_FILE}" stop deephaven-plugins else - docker compose -f "${COMPOSE_FILE}" run --service-ports --rm --build "$@" + docker compose -f "${COMPOSE_FILE}" run --service-ports --rm "${BUILD_FLAG[@]}" "$@" exit_code=$? docker compose -f "${COMPOSE_FILE}" down fi From a93e9b04f8bd26e01d3dbe806c4f02d03559c079 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 12 Jun 2026 16:16:38 -0400 Subject: [PATCH 7/7] fix version to v7/v8 --- .github/workflows/e2e.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 5e46095b8..0caa04e47 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -25,7 +25,7 @@ jobs: docker save tests-deephaven-plugins tests-e2e-tests | gzip > e2e-docker-images.tar.gz - name: Upload Docker images - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: e2e-docker-images path: e2e-docker-images.tar.gz @@ -46,7 +46,7 @@ jobs: uses: actions/checkout@v5 - name: Download Docker images - uses: actions/download-artifact@v5 + uses: actions/download-artifact@v8 with: name: e2e-docker-images @@ -73,7 +73,7 @@ jobs: --shard=${{ steps.config.outputs.shard }}/${{ steps.config.outputs.shard_total }} - name: Upload Playwright blob report - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 if: always() with: name: playwright-report-blob-${{ matrix.config }} @@ -86,7 +86,7 @@ jobs: - name: Upload server logs if: failure() - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: server-logs-${{ matrix.config }} path: /tmp/server-log.txt @@ -105,7 +105,7 @@ jobs: node-version-file: '.nvmrc' - name: Download blob reports - uses: actions/download-artifact@v5 + uses: actions/download-artifact@v8 with: pattern: playwright-report-blob-* @@ -128,7 +128,7 @@ jobs: npx -y playwright@1.44.1 merge-reports --reporter html,github ./all-blob-reports - name: Upload HTML report - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: playwright-report path: playwright-report/