From b8eab26c702d649e017118584075984550e3e112 Mon Sep 17 00:00:00 2001 From: elsirion Date: Tue, 22 Oct 2024 05:20:35 -0400 Subject: [PATCH] chore: use self-hosted runner for integration tests --- .github/workflows/verify.yml | 18 ++++++++++-------- flake.nix | 9 +++++++++ package.json | 2 +- pnpm-lock.yaml | 36 ++++++++++++++++++------------------ 4 files changed, 38 insertions(+), 27 deletions(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 5c038e1..2b5a58b 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -54,25 +54,27 @@ jobs: test: name: Test - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] + timeout-minutes: 30 steps: - name: Clone repository uses: actions/checkout@v4 - - name: Install dependencies - uses: ./.github/actions/install-deps - - name: Setup Nix uses: ./.github/actions/setup-nix with: cachix_auth_token: ${{ secrets.CACHIX_AUTH_TOKEN }} - - name: Setup Playwright - run: pnpm exec playwright install + - name: Setup Nix shell and run commands + run: | + nix develop --accept-flake-config --command bash << EOF + # Install dependencies + pnpm install - - name: Run Tests - run: nix develop -c pnpm test + # Run Tests + DEBUG="pw:browser*" pnpm test + EOF build-docs: name: Build Docs diff --git a/flake.nix b/flake.nix index c06474f..b70ef50 100644 --- a/flake.nix +++ b/flake.nix @@ -22,7 +22,16 @@ fedimint.packages.${system}.devimint fedimint.packages.${system}.gateway-pkgs fedimint.packages.${system}.fedimint-pkgs + pkgs.pnpm + pkgs.nodejs_20 + # The version of playwright in nixpkgs has to match the verison specified in package.json + pkgs.playwright-driver.browsers ] ++ prev.nativeBuildInputs; + + shellHook = '' + export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-driver.browsers} + export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true + ''; }); }; }); diff --git a/package.json b/package.json index 7b304d2..83e1568 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "@vitest/ui": "^2.1.2", "glob": "^10.4.5", "happy-dom": "^15.7.4", - "playwright": "^1.47.2", + "playwright": "1.40.0", "prettier": "^3.3.3", "sherif": "^0.8.4", "simple-git-hooks": "^2.11.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5b2f102..e3fae64 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,10 +19,10 @@ importers: version: 20.16.10 '@vitest/browser': specifier: ^2.1.2 - version: 2.1.2(@vitest/spy@2.1.2)(playwright@1.47.2)(typescript@5.5.2)(vite@5.4.8(@types/node@20.16.10)(terser@5.32.0))(vitest@2.1.2) + version: 2.1.2(@vitest/spy@2.1.2)(playwright@1.40.0)(typescript@5.5.2)(vite@5.4.8(@types/node@20.16.10)(terser@5.32.0))(vitest@2.1.2) '@vitest/coverage-v8': specifier: ^2.1.2 - version: 2.1.2(@vitest/browser@2.1.2)(vitest@2.1.2) + version: 2.1.2(@vitest/browser@2.1.2(@vitest/spy@2.1.2)(playwright@1.40.0)(typescript@5.5.2)(vite@5.4.8(@types/node@20.16.10)(terser@5.32.0))(vitest@2.1.2))(vitest@2.1.2(@types/node@20.16.10)(@vitest/browser@2.1.2)(@vitest/ui@2.1.2)(happy-dom@15.7.4)(msw@2.4.8(typescript@5.5.2))(terser@5.32.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.2(vitest@2.1.2) @@ -33,8 +33,8 @@ importers: specifier: ^15.7.4 version: 15.7.4 playwright: - specifier: ^1.47.2 - version: 1.47.2 + specifier: 1.40.0 + version: 1.40.0 prettier: specifier: ^3.3.3 version: 3.3.3 @@ -2560,14 +2560,14 @@ packages: pkg-types@1.2.1: resolution: {integrity: sha512-sQoqa8alT3nHjGuTjuKgOnvjo4cljkufdtLMnO2LBP/wRwuDlo1tkaEdMxCRhyGRPacv/ztlZgDPm2b7FAmEvw==} - playwright-core@1.47.2: - resolution: {integrity: sha512-3JvMfF+9LJfe16l7AbSmU555PaTl2tPyQsVInqm3id16pdDfvZ8TTZ/pyzmkbDrZTQefyzU7AIHlZqQnxpqHVQ==} - engines: {node: '>=18'} + playwright-core@1.40.0: + resolution: {integrity: sha512-fvKewVJpGeca8t0ipM56jkVSU6Eo0RmFvQ/MaCQNDYm+sdvKkMBBWTE1FdeMqIdumRaXXjZChWHvIzCGM/tA/Q==} + engines: {node: '>=16'} hasBin: true - playwright@1.47.2: - resolution: {integrity: sha512-nx1cLMmQWqmA3UsnjaaokyoUpdVaaDhJhMoxX2qj3McpjnsqFHs516QAKYhqHAgOP+oCFTEOCOAaD1RgD/RQfA==} - engines: {node: '>=18'} + playwright@1.40.0: + resolution: {integrity: sha512-gyHAgQjiDf1m34Xpwzaqb76KgfzYrhK7iih+2IzcOCoZWr/8ZqmdBw+t0RU85ZmfJMgtgAiNtBQ/KS2325INXw==} + engines: {node: '>=16'} hasBin: true portfinder@1.0.32: @@ -4487,7 +4487,7 @@ snapshots: vite: 5.4.8(@types/node@22.5.5)(terser@5.32.0) vue: 3.5.10(typescript@5.6.2) - '@vitest/browser@2.1.2(@vitest/spy@2.1.2)(playwright@1.47.2)(typescript@5.5.2)(vite@5.4.8(@types/node@20.16.10)(terser@5.32.0))(vitest@2.1.2)': + '@vitest/browser@2.1.2(@vitest/spy@2.1.2)(playwright@1.40.0)(typescript@5.5.2)(vite@5.4.8(@types/node@20.16.10)(terser@5.32.0))(vitest@2.1.2)': dependencies: '@testing-library/dom': 10.4.0 '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) @@ -4500,7 +4500,7 @@ snapshots: vitest: 2.1.2(@types/node@20.16.10)(@vitest/browser@2.1.2)(@vitest/ui@2.1.2)(happy-dom@15.7.4)(msw@2.4.8(typescript@5.5.2))(terser@5.32.0) ws: 8.18.0 optionalDependencies: - playwright: 1.47.2 + playwright: 1.40.0 transitivePeerDependencies: - '@vitest/spy' - bufferutil @@ -4508,7 +4508,7 @@ snapshots: - utf-8-validate - vite - '@vitest/coverage-v8@2.1.2(@vitest/browser@2.1.2)(vitest@2.1.2)': + '@vitest/coverage-v8@2.1.2(@vitest/browser@2.1.2(@vitest/spy@2.1.2)(playwright@1.40.0)(typescript@5.5.2)(vite@5.4.8(@types/node@20.16.10)(terser@5.32.0))(vitest@2.1.2))(vitest@2.1.2(@types/node@20.16.10)(@vitest/browser@2.1.2)(@vitest/ui@2.1.2)(happy-dom@15.7.4)(msw@2.4.8(typescript@5.5.2))(terser@5.32.0))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 @@ -4524,7 +4524,7 @@ snapshots: tinyrainbow: 1.2.0 vitest: 2.1.2(@types/node@20.16.10)(@vitest/browser@2.1.2)(@vitest/ui@2.1.2)(happy-dom@15.7.4)(msw@2.4.8(typescript@5.5.2))(terser@5.32.0) optionalDependencies: - '@vitest/browser': 2.1.2(@vitest/spy@2.1.2)(playwright@1.47.2)(typescript@5.5.2)(vite@5.4.8(@types/node@20.16.10)(terser@5.32.0))(vitest@2.1.2) + '@vitest/browser': 2.1.2(@vitest/spy@2.1.2)(playwright@1.40.0)(typescript@5.5.2)(vite@5.4.8(@types/node@20.16.10)(terser@5.32.0))(vitest@2.1.2) transitivePeerDependencies: - supports-color @@ -6028,11 +6028,11 @@ snapshots: mlly: 1.7.2 pathe: 1.1.2 - playwright-core@1.47.2: {} + playwright-core@1.40.0: {} - playwright@1.47.2: + playwright@1.40.0: dependencies: - playwright-core: 1.47.2 + playwright-core: 1.40.0 optionalDependencies: fsevents: 2.3.2 @@ -6673,7 +6673,7 @@ snapshots: why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 20.16.10 - '@vitest/browser': 2.1.2(@vitest/spy@2.1.2)(playwright@1.47.2)(typescript@5.5.2)(vite@5.4.8(@types/node@20.16.10)(terser@5.32.0))(vitest@2.1.2) + '@vitest/browser': 2.1.2(@vitest/spy@2.1.2)(playwright@1.40.0)(typescript@5.5.2)(vite@5.4.8(@types/node@20.16.10)(terser@5.32.0))(vitest@2.1.2) '@vitest/ui': 2.1.2(vitest@2.1.2) happy-dom: 15.7.4 transitivePeerDependencies: