Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,8 @@ web-check: ## Run web generation, packaging, lint, type, unit, and image checks
@$(BAZEL) test //web:check --test_output=errors
@$(BAZEL) build //web/service/submitqueue:image //web/service/stovepipe:image

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

web-image-load: ## Build and load the deployable web image into Docker with Bazel (also tagged with SQ_DOCKER_IMAGE_PREFIX)
@$(BAZEL) run //web/service/submitqueue:image_load
Expand Down
10 changes: 5 additions & 5 deletions doc/howto/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ make build-all-linux # Build Linux binaries for the local docker-
- Containers: Each suite's required services and dependencies; SubmitQueue E2E includes Gateway, Orchestrator, Runway, and MySQL
- Tests end-to-end behavior, including cross-service communication where applicable

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

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

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.
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.

---

Expand Down
2 changes: 1 addition & 1 deletion doc/rfc/web-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ The workspace lives under `web/` and repeats the Go root layout; the UI is a gat

- 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).
- Every protected host layout and route repeats the authentication check rather than relying only on the Next.js proxy.
- `//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.
- `//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.
- 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.

## Deferred
Expand Down
4 changes: 2 additions & 2 deletions service/runway/server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ go_cross_binary(
name = "runway_linux",
platform = "@rules_go//go/toolchain:linux_amd64",
target = ":runway",
visibility = ["//web/test/e2e:__pkg__"],
visibility = ["//web/test/e2e/submitqueue:__pkg__"],
)

# Everything a Docker-based test needs to build the runway image from a staged
Expand All @@ -80,7 +80,7 @@ filegroup(
],
visibility = [
"//test:__subpackages__",
"//web/test/e2e:__pkg__",
"//web/test/e2e/submitqueue:__pkg__",
],
)

Expand Down
2 changes: 1 addition & 1 deletion service/submitqueue/demo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load("@rules_go//go:def.bzl", "go_library", "go_test")
filegroup(
name = "fake_provider_config",
srcs = glob(["provider/fake/*.yaml"]),
visibility = ["//web/test/e2e:__pkg__"],
visibility = ["//web/test/e2e/submitqueue:__pkg__"],
)

go_library(
Expand Down
6 changes: 3 additions & 3 deletions service/submitqueue/gateway/server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports_files(

exports_files(
["queues.yaml"],
visibility = ["//web/test/e2e:__pkg__"],
visibility = ["//web/test/e2e/submitqueue:__pkg__"],
)

go_library(
Expand Down Expand Up @@ -60,7 +60,7 @@ go_cross_binary(
name = "gateway_linux",
platform = "@rules_go//go/toolchain:linux_amd64",
target = ":gateway",
visibility = ["//web/test/e2e:__pkg__"],
visibility = ["//web/test/e2e/submitqueue:__pkg__"],
)

# Everything a Docker-based test needs to build the gateway image from a staged
Expand All @@ -76,7 +76,7 @@ filegroup(
],
visibility = [
"//test:__subpackages__",
"//web/test/e2e:__pkg__",
"//web/test/e2e/submitqueue:__pkg__",
],
)

Expand Down
4 changes: 2 additions & 2 deletions service/submitqueue/orchestrator/server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ go_cross_binary(
name = "orchestrator_linux",
platform = "@rules_go//go/toolchain:linux_amd64",
target = ":orchestrator",
visibility = ["//web/test/e2e:__pkg__"],
visibility = ["//web/test/e2e/submitqueue:__pkg__"],
)

# Everything a Docker-based test needs to build the orchestrator image from a
Expand All @@ -106,7 +106,7 @@ filegroup(
],
visibility = [
"//test:__subpackages__",
"//web/test/e2e:__pkg__",
"//web/test/e2e/submitqueue:__pkg__",
],
)

Expand Down
35 changes: 6 additions & 29 deletions web/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@aspect_rules_ts//ts:defs.bzl", "ts_config", "ts_project")
load("@aspect_rules_ts//ts:defs.bzl", "ts_config")
load("@npm//:defs.bzl", "npm_link_all_packages")

package(default_visibility = ["//visibility:public"])
Expand Down Expand Up @@ -33,8 +33,12 @@ test_suite(
"//web/stovepipe:test",
"//web/stovepipe:typecheck_typecheck_test",
"//web/submitqueue:lint",
"//web/test/e2e/stovepipe:run_e2e_test",
"//web/test/e2e/stovepipe:typecheck_typecheck_test",
"//web/test/testutil:compose_test",
"//web/test/package:stovepipe_pack_contents_test",
":e2e_typecheck_typecheck_test",
"//web/test/e2e/submitqueue:run_e2e_test",
"//web/test/e2e/submitqueue:typecheck_typecheck_test",
],
)

Expand All @@ -46,39 +50,12 @@ js_library(

exports_files([
"package.json",
"playwright.config.ts",
"pnpm-lock.yaml",
"pnpm-workspace.yaml",
"tsconfig.e2e.json",
"vitest.config.ts",
])

ts_config(
name = "tsconfig_base",
src = "tsconfig.base.json",
)

ts_config(
name = "tsconfig_e2e",
src = "tsconfig.e2e.json",
deps = [":tsconfig_base"],
)

ts_project(
name = "e2e_typecheck",
srcs = [
"playwright.config.ts",
"//web/test/e2e:srcs_for_typecheck",
],
declaration = True,
no_emit = True,
tsconfig = ":tsconfig_e2e",
deps = [
":node_modules/@axe-core/playwright",
":node_modules/@connectrpc/connect",
":node_modules/@connectrpc/connect-node",
":node_modules/@playwright/test",
":node_modules/@types/node",
":node_modules/@submitqueue/api",
],
)
3 changes: 2 additions & 1 deletion web/api/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ package(default_visibility = [
"//web:__pkg__",
"//web/service/submitqueue:__pkg__",
"//web/service/stovepipe:__pkg__",
"//web/test/e2e:__pkg__",
"//web/test/e2e/stovepipe:__pkg__",
"//web/test/e2e/submitqueue:__pkg__",
])

npm_link_all_packages(name = "node_modules")
Expand Down
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"check": "pnpm build && pnpm lint && pnpm typecheck && pnpm test",
"lint": "pnpm --recursive --if-present run lint",
"test": "pnpm --recursive --if-present run test",
"typecheck": "tsc --project tsconfig.e2e.json && pnpm --recursive --if-present run typecheck"
"typecheck": "pnpm --recursive --if-present run typecheck"
},
"devDependencies": {
"@axe-core/playwright": "4.10.2",
Expand Down
36 changes: 36 additions & 0 deletions web/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions web/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ packages:
- service/*
- submitqueue
- stovepipe
- test/e2e/stovepipe
- test/e2e/submitqueue
- test/package/react18

hoist: false
Expand Down
4 changes: 3 additions & 1 deletion web/service/stovepipe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ A queue such as `monorepo/main` appears at `/monorepo%2Fmain`; its change page a

## Validation and images

Run `./tool/bazel test //web:check` for library, host, lint and package checks. Build the deployment image with `./tool/bazel build //web/service/stovepipe:image`, or load it into Docker with `./tool/bazel run //web/service/stovepipe:image_load`.
Run `./tool/bazel test //web:check` for library, host, lint and package checks. Run `./tool/bazel test //web/test/e2e/stovepipe:web_test` for browser checks against a real backend. Build the deployment image with `./tool/bazel build //web/service/stovepipe:image`, or load it into Docker with `./tool/bazel run //web/service/stovepipe:image_load`.

To retain the seeded browser-test stack for inspection, add `--test_env=SKIP_CLEANUP=true --nocache_test_results` to the browser-test command. Its log prints the project and web URL. Stop it with `REPO_ROOT="$PWD" ./tool/bazel run @rules_docker_compose//docker_compose -- -f "$PWD/service/stovepipe/docker-compose.yml" -f "$PWD/web/service/stovepipe/docker-compose.yml" -f "$PWD/web/test/e2e/stovepipe/docker-compose.yml" -p <printed-project> down -v`.
Loading
Loading