Skip to content

test(e2e): add setup for E2E testing using bublik-e2e tool - #71

Draft
okt-limonikas wants to merge 12 commits into
ts-factory:mainfrom
okt-limonikas:e2e-testing
Draft

test(e2e): add setup for E2E testing using bublik-e2e tool#71
okt-limonikas wants to merge 12 commits into
ts-factory:mainfrom
okt-limonikas:e2e-testing

Conversation

@okt-limonikas

Copy link
Copy Markdown
Collaborator

No description provided.

@okt-limonikas okt-limonikas self-assigned this Jun 24, 2026
@okt-limonikas
okt-limonikas force-pushed the e2e-testing branch 3 times, most recently from 0f33e8b to 132a2ca Compare June 26, 2026 13:25
Wire pnpm run e2e:features:check into the pre-run gate so a scenario without
a Playwright test fails locally and in CI (which invokes task e2e:types:check
before building the stack).
`task --list` offered 18 e2e tasks, most of them variations on the same
three actions (up:reuse, up:fresh, run, run:fresh, run:reuse, down,
down:fresh, reset, clean), so picking one meant reading the Taskfile.

Five are listed now — reset, up, down, test, test:ui. The rest stay
runnable but drop their `desc`, so they show up under `task --list-all`
as the debugging helpers they are; the steps that are meaningless or
dangerous on their own are `internal: true`.

`e2e:up` seeds only when the instance does not already have the runs, so
it is cheap to re-run. The probe checks the manifest *and* asks the API
whether one of its run ids still exists: a database wiped underneath a
stale manifest must not skip a seed the stack needs.

`e2e:reset` now also clears Playwright's reports, traces and cached auth
state. Nothing did, so a "clean" run could still be reading a previous
run's output.

Campaign parsing moves to the bublik-e2e CLI (`--plan`), which already
owned every validator scripts/e2e_plan.py duplicated. What is left is
this repo's concern: the path guard that keeps a cleanup inside the
directories E2E may write to, the Compose-project guard, and the seed
probe. The plan itself becomes YAML, so each run group is one line and
the days can carry comments; `task e2e:plan` expands it.

The 50-line nested readiness probe becomes scripts/e2e_ready.sh, a flat
loop over the endpoints a test can touch.

E2E tasks live in Taskfile.e2e.yml. Their environment is shared through a
YAML anchor rather than the included file's root `env:`, which Task
merges into the whole run — it would have followed the production stack
into `task docker:up` and pointed it at the E2E data directory.
`task e2e:report:bundle` converts the last Playwright JSON report into a Bublik
bundle and publishes it, printing the import URL; `-- --import` imports it too.
It is a helper, not wired into e2e:test or e2e:ci, so a suite run stays a suite
run.

Results are published to a sibling of the fixture directory, never inside it.
`generate` replaces its entire publish directory on every seed and
`scripts/e2e.py clean` deletes it on reset, while accumulating result runs
across resets is the whole point of importing them. `e2e-results` sits outside
that blast radius — `_resolve_allowed` confines the deletion to
{DATA_DIR}/logs/logs/e2e — and stays under the served logs root, so the
instance's existing LOGS_BASES covers its URL.

Also bumps bublik-ui for the json reporter the task reads.

Claude-Session: https://claude.ai/code/session_01CoxryDN5irXCVFgMrBWEtz
Taskfile.e2e.yml existed to keep the E2E Compose project and data
directory from leaking into the production tasks, but the per-task env
anchor it already used does that just as well inside one file — and the
include cost API_URL forwarded by hand plus a ":docker:setup" escape on
every cross-reference.

Keep six tasks instead of seventeen: up, seed, test and down are the
loop; logs and types:check stay runnable but unlisted. The rest were
one-line wrappers around bublik-e2e subcommands, so call those directly.
Splitting up from seed also gives CI somewhere to put the chmod that lets
the host seeder write into the containers' data dir.

Vars gain an E2E_ prefix now that they share a namespace with the
production ones; the env var names they feed are unchanged.

Claude-Session: https://claude.ai/code/session_01KDfUVbrKGpHugNSefSoUmT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant