From 236708f2e4096ded61ab438e4d1980f77a8d6aa7 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Fri, 31 Jan 2025 15:37:49 +0300 Subject: [PATCH] try to add e2e job --- Makefile | 1 + bamboo-specs/test.yaml | 24 ++++++++++++++++++++++++ client/package.json | 2 +- client/playwright.config.ts | 4 +++- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 15149924..89e5faf4 100644 --- a/Makefile +++ b/Makefile @@ -109,6 +109,7 @@ js-build: ; $(NPM) $(NPM_FLAGS) run build-prod js-deps: ; $(NPM) $(NPM_INSTALL_FLAGS) ci js-lint: ; $(NPM) $(NPM_FLAGS) run lint js-test: ; $(NPM) $(NPM_FLAGS) run test +js-test-e2e: ; $(NPM) $(NPM_FLAGS) run test:e2e go-bench: ; $(ENV) "$(SHELL)" ./scripts/make/go-bench.sh go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh diff --git a/bamboo-specs/test.yaml b/bamboo-specs/test.yaml index 53f052d3..2a228839 100644 --- a/bamboo-specs/test.yaml +++ b/bamboo-specs/test.yaml @@ -28,6 +28,7 @@ final: false jobs: - 'Artifact' + - 'Test e2e' 'Test frontend': 'docker': @@ -165,6 +166,29 @@ 'requirements': - 'adg-docker': 'true' +'Test e2e': + 'docker': + 'image': '${bamboo.dockerFrontend}' + 'volumes': + '${system.YARN_DIR}': '${bamboo.cacheYarn}' + 'key': 'E2ETEST' + 'other': + 'clean-working-dir': true + 'tasks': + - 'checkout': + 'force-clean-build': true + - 'script': + 'interpreter': 'SHELL' + 'scripts': + - | + #!/bin/sh + + set -e -f -u -x + + make VERBOSE=1 js-test-e2e + 'requirements': + - 'adg-docker': 'true' + 'branches': 'create': 'for-pull-request' 'delete': diff --git a/client/package.json b/client/package.json index a2189cd4..06bb2824 100644 --- a/client/package.json +++ b/client/package.json @@ -10,7 +10,7 @@ "lint": "echo 'Lint temporarily disabled'", "lint-new": "eslint './src/**/*.(ts|tsx)'", "lint:fix": "eslint './src/**/*.(ts|tsx)' --fix", - "test": "vitest --run && npx playwright test", + "test": "vitest --run", "test:watch": "vitest --watch", "test:e2e": "npx playwright test tests/e2e", "test:e2e:interactive": "npx playwright test --ui", diff --git a/client/playwright.config.ts b/client/playwright.config.ts index c0f5e47f..b8e485bf 100644 --- a/client/playwright.config.ts +++ b/client/playwright.config.ts @@ -69,7 +69,9 @@ export default defineConfig({ ], webServer: { - command: 'rm -f AdGuardHome.yaml && sudo ./AdGuardHome --local-frontend -v', + command: process.env.CI + ? 'rm -f AdGuardHome.yaml && ./AdGuardHome --local-frontend -v' + : 'rm -f AdGuardHome.yaml && sudo ./AdGuardHome --local-frontend -v', url: 'http://127.0.0.1:3000', cwd: '..', reuseExistingServer: !process.env.CI,