diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a81b7a9115..198bb51066 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -973,14 +973,14 @@ jobs: - run: make gen/mark-fresh name: make gen - - run: make site/e2e/bin/coder - name: make coder - - run: pnpm build env: NODE_OPTIONS: ${{ github.repository_owner == 'coder' && '--max_old_space_size=8192' || '' }} working-directory: site + - run: make site/e2e/bin/coder + name: make coder + - run: pnpm playwright:install working-directory: site diff --git a/Makefile b/Makefile index 3200ae9565..a1aa57d4e0 100644 --- a/Makefile +++ b/Makefile @@ -1690,9 +1690,9 @@ test-clean: go clean -testcache .PHONY: test-clean -site/e2e/bin/coder: go.mod go.sum $(GO_SRC_FILES) +site/e2e/bin/coder: go.mod go.sum $(GO_SRC_FILES) site/out/index.html go build -o $@ \ - -tags ts_omit_aws,ts_omit_bird,ts_omit_tap,ts_omit_kube \ + -tags embed,ts_omit_aws,ts_omit_bird,ts_omit_tap,ts_omit_kube \ ./enterprise/cmd/coder test-e2e: site/e2e/bin/coder site/node_modules/.installed site/out/index.html diff --git a/site/.knip.jsonc b/site/.knip.jsonc index c4d0b3152c..536f5b035b 100644 --- a/site/.knip.jsonc +++ b/site/.knip.jsonc @@ -20,7 +20,7 @@ // exclusion once the settings page lands. "src/api/queries/chatDebugLogging.ts" ], - "ignoreBinaries": ["protoc"], + "ignoreBinaries": ["make", "protoc"], "ignoreDependencies": [ "@babel/plugin-syntax-typescript", "@coder/pixel-storybook", diff --git a/site/e2e/README.md b/site/e2e/README.md index 5b61ab443b..c4add37172 100644 --- a/site/e2e/README.md +++ b/site/e2e/README.md @@ -17,7 +17,7 @@ NODE_ENV=development pnpm vite build --mode=development # Install the browsers to `~/.cache/ms-playwright`. pnpm playwright:install # Run E2E tests. You can see the configuration of the server -# in `playwright.config.ts`. This uses `go run -tags embed ...`. +# in `playwright.config.ts`. This builds and runs `site/e2e/bin/coder`. pnpm playwright:test # Run a specific test (`-g` stands for grep. It accepts regex). pnpm playwright:test -g '' diff --git a/site/e2e/playwright.config.ts b/site/e2e/playwright.config.ts index 8a220d8d76..a92af9c71c 100644 --- a/site/e2e/playwright.config.ts +++ b/site/e2e/playwright.config.ts @@ -1,6 +1,7 @@ import * as path from "node:path"; import { defineConfig } from "@playwright/test"; import { + coderBinary, coderdPProfPort, coderPort, e2eFakeExperiment1, @@ -76,12 +77,12 @@ export default defineConfig({ }), }, webServer: { - url: `http://localhost:${coderPort}/api/v2/deployment/config`, - // The default timeout is 60s, but `go run` compilation with the - // embed tag can take longer on CI. + url: `http://localhost:${coderPort}/healthz`, + // The default timeout is 60s, but coderd startup can take longer on + // loaded CI runners. timeout: 120_000, command: [ - `go run -tags embed ${path.join(__dirname, "../../enterprise/cmd/coder")}`, + `"${coderBinary}"`, "server", "--global-config $(mktemp -d -t e2e-XXXXXXXXXX)", `--access-url=http://localhost:${coderPort}`, diff --git a/site/package.json b/site/package.json index 161b90b95f..d848c13973 100644 --- a/site/package.json +++ b/site/package.json @@ -21,8 +21,8 @@ "lint:fix": "biome lint --error-on-warnings --write . && knip --fix", "lint:types": "tsc -p .", "playwright:install": "playwright install --with-deps chromium", - "playwright:test": "playwright test --config=e2e/playwright.config.ts", - "playwright:test-ui": "playwright test --config=e2e/playwright.config.ts --ui $([[ \"$CODER\" == \"true\" ]] && echo --ui-port=7500 --ui-host=0.0.0.0)", + "playwright:test": "make -C .. site/e2e/bin/coder && playwright test --config=e2e/playwright.config.ts", + "playwright:test-ui": "make -C .. site/e2e/bin/coder && playwright test --config=e2e/playwright.config.ts --ui $([[ \"$CODER\" == \"true\" ]] && echo --ui-port=7500 --ui-host=0.0.0.0)", "gen:provisioner": "protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./e2e/ --ts_proto_opt=outputJsonMethods=false,outputEncodeMethods=encode-no-creation,outputClientImpl=false,nestJs=false,outputPartialMethods=false,fileSuffix=Generated,suffix=hey -I ../provisionersdk/proto ../provisionersdk/proto/provisioner.proto", "storybook": "STORYBOOK=true storybook dev -p 6006", "storybook:build": "storybook build",