From ed75aa3104c9d16d3ee585b01d24fb095fcad9a8 Mon Sep 17 00:00:00 2001 From: Ncbudd <209378361+ncbudd@users.noreply.github.com> Date: Tue, 24 Nov 2026 10:50:54 -0500 Subject: [PATCH 1/2] Fetch the SeerrNG files Lumen builds against before testing Lumen now imports a few files from outside lumen/ (@app/@server aliases, shared translations, issue constants) and its image copies them in, so the type check, build and image tests failed in this mirror. The job now fetches src/, server/, config/ and the root package.json/tsconfig.json from the SeerrNG commit in UPSTREAM, and runs the browser tests the way SeerrNG's Lumen workflow does. --- .github/workflows/test.yml | 63 ++++++++++++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0c6e7fb..2de01f0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,16 +1,23 @@ -# Builds Lumen and runs its type check, unit tests and browser tests (desktop, iPhone, -# Android and tablet) for every pull request that touches lumen/, and after each sync. +# Builds Lumen and runs its type check, unit tests and browser tests (desktop, phone and +# tablet) for every pull request that touches lumen/, and after each sync. +# +# Lumen imports a few SeerrNG files from outside lumen/ (the @app and @server aliases, shared +# translations, the issue constants), and its image build copies them in. This repo only +# mirrors lumen/, so the job first fetches src/, server/, config/ and the root package.json and +# tsconfig.json from the SeerrNG commit named in UPSTREAM, the one lumen/ was synced from. name: Lumen tests on: pull_request: paths: - 'lumen/**' + - 'UPSTREAM' - '.github/workflows/test.yml' push: branches: [main] paths: - 'lumen/**' + - 'UPSTREAM' workflow_dispatch: permissions: @@ -18,25 +25,55 @@ permissions: jobs: test: - runs-on: ubuntu-latest - defaults: - run: - working-directory: lumen + runs-on: ubuntu-24.04 + timeout-minutes: 75 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Fetch the SeerrNG files Lumen builds against + run: | + sha="$(tr -d '[:space:]' < UPSTREAM)" + [[ "$sha" =~ ^[0-9a-f]{40}$ ]] || { echo "UPSTREAM does not hold a commit id"; exit 1; } + git init -q "$RUNNER_TEMP/up" + cd "$RUNNER_TEMP/up" + git remote add origin https://github.com/snapetech-org/seerrng.git + git sparse-checkout set --no-cone /src/ /server/ /config/ /package.json /tsconfig.json + git fetch -q --depth 1 --filter=blob:none origin "$sha" + git checkout -q FETCH_HEAD + cp -r src server config package.json tsconfig.json "$GITHUB_WORKSPACE/" + echo "Using snapetech-org/seerrng@${sha::8}" - uses: actions/setup-node@v4 with: - node-version: 24 + node-version-file: package.json cache: npm cache-dependency-path: lumen/package-lock.json - - run: npm ci - - run: npx tsc --noEmit -p . - - run: npm run build - - run: npm test - - run: npx playwright install --with-deps chromium webkit - - run: npx playwright test + - name: Install Lumen dependencies + working-directory: lumen + run: npm ci --ignore-scripts + + - name: Type check + working-directory: lumen + run: npx tsc --noEmit -p . + + - name: Build Lumen + working-directory: lumen + run: npm run build + + - name: Unit, image and proxy tests + working-directory: lumen + run: npm test + + - name: Install Chromium + working-directory: lumen + run: npx --no-install playwright install --with-deps chromium + + - name: Browser tests in desktop, phone and tablet viewports + working-directory: lumen + run: npm run test:browser -- --workers=2 - uses: actions/upload-artifact@v4 if: failure() From 5799cc7eb4e5a6339ea74bfb1b588cb4db9e69ef Mon Sep 17 00:00:00 2001 From: Ncbudd <209378361+ncbudd@users.noreply.github.com> Date: Tue, 24 Nov 2026 12:40:15 -0500 Subject: [PATCH 2/2] Run the browser tests in four shards The full browser suite in four viewports needs more than the 75-minute job limit on one runner (the first run was cancelled there after every other step passed). The quick checks are now their own job, the browser tests run in four parallel shards, and both fetch the SeerrNG files through one script. --- .github/scripts/fetch-seerrng-files.sh | 15 +++++++ .github/workflows/test.yml | 61 +++++++++++++++----------- 2 files changed, 51 insertions(+), 25 deletions(-) create mode 100755 .github/scripts/fetch-seerrng-files.sh diff --git a/.github/scripts/fetch-seerrng-files.sh b/.github/scripts/fetch-seerrng-files.sh new file mode 100755 index 0000000..9056b0b --- /dev/null +++ b/.github/scripts/fetch-seerrng-files.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# Copies the SeerrNG files Lumen builds against (src/, server/, config/, package.json, +# tsconfig.json) from the commit named in UPSTREAM into the workspace root. +set -euo pipefail +sha="$(tr -d '[:space:]' < UPSTREAM)" +[[ "$sha" =~ ^[0-9a-f]{40}$ ]] || { echo "UPSTREAM does not hold a commit id"; exit 1; } +up="${RUNNER_TEMP:-/tmp}/seerrng-upstream" +rm -rf "$up" +git init -q "$up" +git -C "$up" remote add origin https://github.com/snapetech-org/seerrng.git +git -C "$up" sparse-checkout set --no-cone /src/ /server/ /config/ /package.json /tsconfig.json +git -C "$up" fetch -q --depth 1 --filter=blob:none origin "$sha" +git -C "$up" checkout -q FETCH_HEAD +cp -r "$up/src" "$up/server" "$up/config" "$up/package.json" "$up/tsconfig.json" "${GITHUB_WORKSPACE:-$PWD}/" +echo "Using snapetech-org/seerrng@${sha::8}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2de01f0..b430115 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,8 +3,10 @@ # # Lumen imports a few SeerrNG files from outside lumen/ (the @app and @server aliases, shared # translations, the issue constants), and its image build copies them in. This repo only -# mirrors lumen/, so the job first fetches src/, server/, config/ and the root package.json and -# tsconfig.json from the SeerrNG commit named in UPSTREAM, the one lumen/ was synced from. +# mirrors lumen/, so each job first fetches src/, server/, config/ and the root package.json +# and tsconfig.json from the SeerrNG commit named in UPSTREAM, the one lumen/ was synced from. +# +# The browser suite runs in four shards so each one finishes well inside the job limit. name: Lumen tests on: @@ -13,6 +15,7 @@ on: - 'lumen/**' - 'UPSTREAM' - '.github/workflows/test.yml' + - '.github/scripts/fetch-seerrng-files.sh' push: branches: [main] paths: @@ -24,60 +27,68 @@ permissions: contents: read jobs: - test: + checks: + name: Type check, build, unit and image tests runs-on: ubuntu-24.04 - timeout-minutes: 75 + timeout-minutes: 30 steps: - uses: actions/checkout@v4 with: persist-credentials: false - - name: Fetch the SeerrNG files Lumen builds against - run: | - sha="$(tr -d '[:space:]' < UPSTREAM)" - [[ "$sha" =~ ^[0-9a-f]{40}$ ]] || { echo "UPSTREAM does not hold a commit id"; exit 1; } - git init -q "$RUNNER_TEMP/up" - cd "$RUNNER_TEMP/up" - git remote add origin https://github.com/snapetech-org/seerrng.git - git sparse-checkout set --no-cone /src/ /server/ /config/ /package.json /tsconfig.json - git fetch -q --depth 1 --filter=blob:none origin "$sha" - git checkout -q FETCH_HEAD - cp -r src server config package.json tsconfig.json "$GITHUB_WORKSPACE/" - echo "Using snapetech-org/seerrng@${sha::8}" - + run: bash .github/scripts/fetch-seerrng-files.sh - uses: actions/setup-node@v4 with: node-version-file: package.json cache: npm cache-dependency-path: lumen/package-lock.json - - name: Install Lumen dependencies working-directory: lumen run: npm ci --ignore-scripts - - name: Type check working-directory: lumen run: npx tsc --noEmit -p . - - name: Build Lumen working-directory: lumen run: npm run build - - name: Unit, image and proxy tests working-directory: lumen run: npm test + browser: + name: Browser tests (shard ${{ matrix.shard }}/4) + runs-on: ubuntu-24.04 + timeout-minutes: 75 + strategy: + fail-fast: false + matrix: + shard: [1, 2, 3, 4] + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Fetch the SeerrNG files Lumen builds against + run: bash .github/scripts/fetch-seerrng-files.sh + - uses: actions/setup-node@v4 + with: + node-version-file: package.json + cache: npm + cache-dependency-path: lumen/package-lock.json + - name: Install Lumen dependencies + working-directory: lumen + run: npm ci --ignore-scripts + - name: Build Lumen + working-directory: lumen + run: npm run build - name: Install Chromium working-directory: lumen run: npx --no-install playwright install --with-deps chromium - - name: Browser tests in desktop, phone and tablet viewports working-directory: lumen - run: npm run test:browser -- --workers=2 - + run: npm run test:browser -- --workers=2 --shard=${{ matrix.shard }}/4 - uses: actions/upload-artifact@v4 if: failure() with: - name: playwright-results + name: playwright-results-${{ matrix.shard }} path: lumen/test-results retention-days: 7