From a0b407e92d28767311ff903e65eda93bdd4b9fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hartmut=20N=C3=B6renberg?= Date: Mon, 13 Apr 2026 01:11:37 +0200 Subject: [PATCH] ci: bump skill matrix parser test timeout; install playwright in isolated dir Unit Tests flaked on QNAP: skillMatrixParser ExcelJS workbook builds exceeded the 5s default per-test timeout (runtime ~8.6s for the suite). Bumped to 30s. Docker Deploy smoke tests failed because `npm install` in the repo root tried to resolve sibling workspace:* deps (pnpm protocol, not npm-supported). Install @playwright/test into /tmp/pw-install instead and symlink the package dirs into apps/web/node_modules so the CJS require() in playwright.ci.config.ts resolves it by walking up from apps/web/. --- .github/workflows/ci.yml | 21 +++++++++++++++------ apps/web/src/lib/skillMatrixParser.test.ts | 5 +++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ae0d44..bcdec30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -496,20 +496,29 @@ jobs: node-version: "20" - name: Install Playwright and Chromium - # Install locally (not -g) so the CJS require() in playwright.ci.config.ts - # resolves @playwright/test by walking up from apps/web/. A global - # install puts it in /opt/hostedtoolcache/.../lib/node_modules which - # Node's resolver doesn't check. + # The repo root package.json uses pnpm `workspace:*` deps which npm + # cannot resolve, so install into an isolated temp dir and symlink + # @playwright/test into apps/web/node_modules so playwright.ci.config.ts + # (CJS) can resolve it by walking up from apps/web/. run: | + set -e + mkdir -p /tmp/pw-install + cd /tmp/pw-install + [ -f package.json ] || npm init -y >/dev/null npm install --no-save --no-package-lock @playwright/test@1.49 - npx playwright install chromium --with-deps + cd "$GITHUB_WORKSPACE" + mkdir -p apps/web/node_modules + ln -sfn /tmp/pw-install/node_modules/@playwright apps/web/node_modules/@playwright + ln -sfn /tmp/pw-install/node_modules/playwright apps/web/node_modules/playwright + ln -sfn /tmp/pw-install/node_modules/playwright-core apps/web/node_modules/playwright-core + /tmp/pw-install/node_modules/.bin/playwright install chromium --with-deps - name: Run smoke tests env: # App runs on the compose network; act_runner job is on gitea_gitea # (docker-compose.ci.yml attaches services to both). Override baseURL. PLAYWRIGHT_BASE_URL: http://app:3100 - run: npx playwright test --config apps/web/playwright.ci.config.ts + run: /tmp/pw-install/node_modules/.bin/playwright test --config apps/web/playwright.ci.config.ts - name: Upload Playwright report if: failure() diff --git a/apps/web/src/lib/skillMatrixParser.test.ts b/apps/web/src/lib/skillMatrixParser.test.ts index 16a65e8..7033d47 100644 --- a/apps/web/src/lib/skillMatrixParser.test.ts +++ b/apps/web/src/lib/skillMatrixParser.test.ts @@ -21,6 +21,7 @@ async function createWorkbookBuffer( describe("skill matrix parser", () => { it("extracts employee info and merges skills by highest proficiency", async () => { + // ExcelJS dynamic import + workbook writeBuffer is slow on constrained CI runners. const workbook = await createWorkbookBuffer([ { name: "Employee Information", @@ -71,7 +72,7 @@ describe("skill matrix parser", () => { }, ]), }); - }); + }, 30000); it("rejects duplicate headers in skill sheets", async () => { const workbook = await createWorkbookBuffer([ @@ -96,7 +97,7 @@ describe("skill matrix parser", () => { ]); await expect(parseSkillMatrixWorkbook(workbook)).rejects.toThrow('duplicate header "item"'); - }); + }, 30000); it("matches role names by exact and partial matches", () => { expect(matchRoleName("Compositing", ["Producer", "Compositing"])).toBe("Compositing");