Skip to content

Commit 95f5825

Browse files
committed
test(web): add Stovepipe coverage and align E2E suites
1 parent 5585587 commit 95f5825

36 files changed

Lines changed: 998 additions & 325 deletions

‎Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,8 +711,8 @@ web-check: ## Run web generation, packaging, lint, type, unit, and image checks
711711
@$(BAZEL) test //web:check --test_output=errors
712712
@$(BAZEL) build //web/service/submitqueue:image //web/service/stovepipe:image
713713

714-
web-e2e-test: ## Run the Bazel-managed real-stack Playwright and axe web test
715-
@$(BAZEL) test //web/test/e2e:web_test --test_output=errors
714+
web-e2e-test: ## Run real-stack browser tests with Playwright and axe
715+
@$(BAZEL) test //web/test/e2e/submitqueue:web_test //web/test/e2e/stovepipe:web_test --test_output=errors
716716

717717
web-image-load: ## Build and load the deployable web image into Docker with Bazel (also tagged with SQ_DOCKER_IMAGE_PREFIX)
718718
@$(BAZEL) run //web/service/submitqueue:image_load

‎doc/howto/TESTING.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ make build-all-linux # Build Linux binaries for the local docker-
8585
- Containers: Each suite's required services and dependencies; SubmitQueue E2E includes Gateway, Orchestrator, Runway, and MySQL
8686
- Tests end-to-end behavior, including cross-service communication where applicable
8787

88-
**4. Web E2E Test** - Browser behavior against the complete SubmitQueue stack
89-
- Location: `web/test/e2e/`
88+
**4. Web E2E Tests** - Browser behavior against each domain stack
89+
- Location: `web/test/e2e/{submitqueue,stovepipe}/`
9090
- Run: `make web-e2e-test`
91-
- Containers: Bazel-built Gateway, Orchestrator, Runway, web OCI image, and MySQL
92-
- Coverage: Basic authentication, h2c gateway access, newest-first queue requests, encoded SQID navigation, ordered history, and axe accessibility checks
91+
- Containers: Each domain's Bazel-built services, web OCI image, and MySQL
92+
- Coverage: Authentication, queue and change navigation, pagination, status and history, project JSON export, and axe accessibility checks
9393
- Tooling: Bazel supplies Node, Playwright, and Chromium; no host Node install or browser download is required
9494

9595
### Live GitHub Tests
@@ -122,7 +122,7 @@ Go integration and domain E2E tests use **docker-compose** via `ComposeStack` to
122122
3. Tests run against those containers with **real-time log output**
123123
4. On cleanup, containers are torn down automatically (set `SKIP_CLEANUP=true` to keep them for inspection)
124124

125-
The web E2E target uses the Bazel `py_test` runner in `web/test/e2e/run_e2e.py`. It stages runfiles into a temporary Compose context, loads the Bazel-built web image, applies the gateway and orchestrator schemas, runs Playwright, and removes its `e2e-submitqueue-web-<pid>` project unless `SKIP_CLEANUP=true`. It does not auto-tail service logs; inspect retained containers with `docker ps` and `docker logs` when cleanup is disabled.
125+
The SubmitQueue web E2E target uses the Bazel `py_test` runner in `web/test/e2e/submitqueue/run_e2e.py`. It stages runfiles into a temporary Compose context, loads the Bazel-built web image, applies the gateway and orchestrator schemas, runs Playwright, and removes its `e2e-submitqueue-web-<pid>` project unless `SKIP_CLEANUP=true`. It does not auto-tail service logs; inspect retained containers with `docker ps` and `docker logs` when cleanup is disabled.
126126

127127
---
128128

‎doc/rfc/web-ui.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ The workspace lives under `web/` and repeats the Go root layout; the UI is a gat
9494

9595
- Unit tests cover route round-trips, readable paths, timestamp conversion, stable list bounds, cursor scoping and tampering, error classification and host classifiers, catalog caching, request-scoped logging, gateway and page metrics, mount paths and authorization, client navigation, and polling (transition-aware single flight, progressive backoff, hidden and offline pause, history-aware terminal stop).
9696
- Every protected host layout and route repeats the authentication check rather than relying only on the Next.js proxy.
97-
- `//web/test/e2e:web_test` runs the Bazel-built Go services, the Bazel-built web image, and a digest-pinned MySQL image with pulls and Dockerfile builds disabled. It covers the Basic-auth challenge, explicit h2c, newest-first lists, client-side navigation, a slash-containing request ID, lifecycle and build history, paginated change history, and axe checks.
97+
- `//web/test/e2e/submitqueue:web_test` runs the Bazel-built Go services, the Bazel-built web image, and a digest-pinned MySQL image with pulls and Dockerfile builds disabled. It covers the Basic-auth challenge, explicit h2c, newest-first lists, client-side navigation, a slash-containing request ID, lifecycle and build history, paginated change history, and axe checks.
9898
- Built package tarballs are inspected for contents and forbidden imports, typechecked by a consumer written only against public entry points, rendered by a plain Node consumer through `handle`, and server-rendered and hydrated under React 18.
9999

100100
## Deferred

‎service/runway/server/BUILD.bazel‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ go_cross_binary(
6565
name = "runway_linux",
6666
platform = "@rules_go//go/toolchain:linux_amd64",
6767
target = ":runway",
68-
visibility = ["//web/test/e2e:__pkg__"],
68+
visibility = ["//web/test/e2e/submitqueue:__pkg__"],
6969
)
7070

7171
# Everything a Docker-based test needs to build the runway image from a staged
@@ -80,7 +80,7 @@ filegroup(
8080
],
8181
visibility = [
8282
"//test:__subpackages__",
83-
"//web/test/e2e:__pkg__",
83+
"//web/test/e2e/submitqueue:__pkg__",
8484
],
8585
)
8686

‎service/submitqueue/demo/BUILD.bazel‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ load("@rules_go//go:def.bzl", "go_library", "go_test")
33
filegroup(
44
name = "fake_provider_config",
55
srcs = glob(["provider/fake/*.yaml"]),
6-
visibility = ["//web/test/e2e:__pkg__"],
6+
visibility = ["//web/test/e2e/submitqueue:__pkg__"],
77
)
88

99
go_library(

‎service/submitqueue/gateway/server/BUILD.bazel‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exports_files(
77

88
exports_files(
99
["queues.yaml"],
10-
visibility = ["//web/test/e2e:__pkg__"],
10+
visibility = ["//web/test/e2e/submitqueue:__pkg__"],
1111
)
1212

1313
go_library(
@@ -60,7 +60,7 @@ go_cross_binary(
6060
name = "gateway_linux",
6161
platform = "@rules_go//go/toolchain:linux_amd64",
6262
target = ":gateway",
63-
visibility = ["//web/test/e2e:__pkg__"],
63+
visibility = ["//web/test/e2e/submitqueue:__pkg__"],
6464
)
6565

6666
# Everything a Docker-based test needs to build the gateway image from a staged
@@ -76,7 +76,7 @@ filegroup(
7676
],
7777
visibility = [
7878
"//test:__subpackages__",
79-
"//web/test/e2e:__pkg__",
79+
"//web/test/e2e/submitqueue:__pkg__",
8080
],
8181
)
8282

‎service/submitqueue/orchestrator/server/BUILD.bazel‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ go_cross_binary(
9191
name = "orchestrator_linux",
9292
platform = "@rules_go//go/toolchain:linux_amd64",
9393
target = ":orchestrator",
94-
visibility = ["//web/test/e2e:__pkg__"],
94+
visibility = ["//web/test/e2e/submitqueue:__pkg__"],
9595
)
9696

9797
# Everything a Docker-based test needs to build the orchestrator image from a
@@ -106,7 +106,7 @@ filegroup(
106106
],
107107
visibility = [
108108
"//test:__subpackages__",
109-
"//web/test/e2e:__pkg__",
109+
"//web/test/e2e/submitqueue:__pkg__",
110110
],
111111
)
112112

‎web/BUILD.bazel‎

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@aspect_rules_js//js:defs.bzl", "js_library")
2-
load("@aspect_rules_ts//ts:defs.bzl", "ts_config", "ts_project")
2+
load("@aspect_rules_ts//ts:defs.bzl", "ts_config")
33
load("@npm//:defs.bzl", "npm_link_all_packages")
44

55
package(default_visibility = ["//visibility:public"])
@@ -33,8 +33,12 @@ test_suite(
3333
"//web/stovepipe:test",
3434
"//web/stovepipe:typecheck_typecheck_test",
3535
"//web/submitqueue:lint",
36+
"//web/test/e2e/stovepipe:run_e2e_test",
37+
"//web/test/e2e/stovepipe:typecheck_typecheck_test",
38+
"//web/test/testutil:compose_test",
3639
"//web/test/package:stovepipe_pack_contents_test",
37-
":e2e_typecheck_typecheck_test",
40+
"//web/test/e2e/submitqueue:run_e2e_test",
41+
"//web/test/e2e/submitqueue:typecheck_typecheck_test",
3842
],
3943
)
4044

@@ -46,39 +50,12 @@ js_library(
4650

4751
exports_files([
4852
"package.json",
49-
"playwright.config.ts",
5053
"pnpm-lock.yaml",
5154
"pnpm-workspace.yaml",
52-
"tsconfig.e2e.json",
5355
"vitest.config.ts",
5456
])
5557

5658
ts_config(
5759
name = "tsconfig_base",
5860
src = "tsconfig.base.json",
5961
)
60-
61-
ts_config(
62-
name = "tsconfig_e2e",
63-
src = "tsconfig.e2e.json",
64-
deps = [":tsconfig_base"],
65-
)
66-
67-
ts_project(
68-
name = "e2e_typecheck",
69-
srcs = [
70-
"playwright.config.ts",
71-
"//web/test/e2e:srcs_for_typecheck",
72-
],
73-
declaration = True,
74-
no_emit = True,
75-
tsconfig = ":tsconfig_e2e",
76-
deps = [
77-
":node_modules/@axe-core/playwright",
78-
":node_modules/@connectrpc/connect",
79-
":node_modules/@connectrpc/connect-node",
80-
":node_modules/@playwright/test",
81-
":node_modules/@types/node",
82-
":node_modules/@submitqueue/api",
83-
],
84-
)

‎web/api/BUILD.bazel‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ package(default_visibility = [
1313
"//web:__pkg__",
1414
"//web/service/submitqueue:__pkg__",
1515
"//web/service/stovepipe:__pkg__",
16-
"//web/test/e2e:__pkg__",
16+
"//web/test/e2e/stovepipe:__pkg__",
17+
"//web/test/e2e/submitqueue:__pkg__",
1718
])
1819

1920
npm_link_all_packages(name = "node_modules")

‎web/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"check": "pnpm build && pnpm lint && pnpm typecheck && pnpm test",
1414
"lint": "pnpm --recursive --if-present run lint",
1515
"test": "pnpm --recursive --if-present run test",
16-
"typecheck": "tsc --project tsconfig.e2e.json && pnpm --recursive --if-present run typecheck"
16+
"typecheck": "pnpm --recursive --if-present run typecheck"
1717
},
1818
"devDependencies": {
1919
"@axe-core/playwright": "4.10.2",

0 commit comments

Comments
 (0)