add Makefile test-layer targets + rename coverage.sh
Makefile grows targets for each test layer (test, test-a11y, test-integration, test-e2e, test-all), the coverage + smoke-bundle helpers, and the UI harness (ui-dev, ui-stop, ui-smoke). push-check now runs `test + test-a11y` — fast pre-push gate under 90s. ci/coverage.sh is renamed to ci/test_coverage.sh so it matches the `test_*.sh` naming of the other layer scripts and sidesteps the repo's `coverage.*` gitignore pattern (intended for coverage output files like coverage.lcov, not scripts). Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,7 @@ jobs:
|
|||||||
- run: (cd app && flutter pub get)
|
- run: (cd app && flutter pub get)
|
||||||
- run: ci/test.sh
|
- run: ci/test.sh
|
||||||
- run: ci/test_a11y.sh
|
- run: ci/test_a11y.sh
|
||||||
- run: ci/coverage.sh
|
- run: ci/test_coverage.sh
|
||||||
|
|
||||||
integration:
|
integration:
|
||||||
name: integration_test (xvfb)
|
name: integration_test (xvfb)
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ heading, and (b) bumping `project.yaml` `version:` in the same commit.
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
- Makefile targets for every test layer and the UI harness: `test`, `test-a11y`, `test-integration`, `test-e2e`, `test-all`, `coverage`, `smoke-bundle`, `ui-dev`, `ui-stop`, `ui-smoke`. `push-check` now runs `test + test-a11y` (fast pre-push gate, <90s).
|
||||||
- Per-layer CI shell scripts under `ci/`: `test.sh` (analyze + format + unit + widget + golden, ~5s), `test_a11y.sh` (a11y contract), `test_integration.sh` (integration_test one file at a time — desktop can't batch them reliably), `test_e2e.sh` (daemon subprocess + browser WASM Playwright smoke), `smoke_bundle.sh` (xvfb-run the Linux release bundle for 5s; catches dynamic-linker / asset-bundle / plugin-init regressions that widget tests can't see), `coverage.sh` (flutter test --coverage + lcov summary).
|
- Per-layer CI shell scripts under `ci/`: `test.sh` (analyze + format + unit + widget + golden, ~5s), `test_a11y.sh` (a11y contract), `test_integration.sh` (integration_test one file at a time — desktop can't batch them reliably), `test_e2e.sh` (daemon subprocess + browser WASM Playwright smoke), `smoke_bundle.sh` (xvfb-run the Linux release bundle for 5s; catches dynamic-linker / asset-bundle / plugin-init regressions that widget tests can't see), `coverage.sh` (flutter test --coverage + lcov summary).
|
||||||
- `.gitea/workflows/test.yml` — four-job pipeline (`unit`, `integration`, `startup-bundle`, `e2e`) that shells out to the `ci/*.sh` scripts. **Not activated yet** — Gitea Actions has to be enabled in the instance settings first. GitHub-Actions-syntax-compatible, so copying to `.github/workflows/` is a one-file move when the repo migrates.
|
- `.gitea/workflows/test.yml` — four-job pipeline (`unit`, `integration`, `startup-bundle`, `e2e`) that shells out to the `ci/*.sh` scripts. **Not activated yet** — Gitea Actions has to be enabled in the instance settings first. GitHub-Actions-syntax-compatible, so copying to `.github/workflows/` is a one-file move when the repo migrates.
|
||||||
- Web WASM harness under `tools/ui/` — Playwright driver so Claude Code (and humans) can drive the Flutter build in a real browser via the Semantics tree. `build.sh` / `serve.sh` / `stop.sh` manage a local `http.server` on `:4280` with port-based reclaim and kill (so orphaned listeners from earlier runs get swept). `driver.ts` exposes `ClideDriver` with `byLabel` / `click` / `type` / `readText` / `screenshot` / `dumpSemanticsTree` / `waitUntilReady` (auto-clicks the `flt-semantics-placeholder` to enable the semantics tree). First Playwright test `smoke.spec.ts` asserts welcome + disconnected labels render in the browser.
|
- Web WASM harness under `tools/ui/` — Playwright driver so Claude Code (and humans) can drive the Flutter build in a real browser via the Semantics tree. `build.sh` / `serve.sh` / `stop.sh` manage a local `http.server` on `:4280` with port-based reclaim and kill (so orphaned listeners from earlier runs get swept). `driver.ts` exposes `ClideDriver` with `byLabel` / `click` / `type` / `readText` / `screenshot` / `dumpSemanticsTree` / `waitUntilReady` (auto-clicks the `flt-semantics-placeholder` to enable the semantics tree). First Playwright test `smoke.spec.ts` asserts welcome + disconnected labels render in the browser.
|
||||||
|
|||||||
@@ -70,20 +70,48 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: ## flutter test (unit + widget).
|
test: ## Fast: analyze + format + unit + widget + golden (<60s).
|
||||||
ifeq ($(APP_PRESENT),yes)
|
ci/test.sh
|
||||||
flutter test
|
|
||||||
else
|
.PHONY: test-a11y
|
||||||
@echo "(pubspec.yaml not scaffolded yet; skipping)"
|
test-a11y: ## A11y contract (semantic coverage + keyboard + contrast + i18n).
|
||||||
endif
|
ci/test_a11y.sh
|
||||||
|
|
||||||
.PHONY: test-integration
|
.PHONY: test-integration
|
||||||
test-integration: build ## Integration tests (daemon + CLI + fixture repos).
|
test-integration: ## Integration tests (real app boot; xvfb on headless Linux).
|
||||||
ifeq ($(APP_PRESENT),yes)
|
ci/test_integration.sh
|
||||||
flutter test integration_test || echo "(no integration_test suite yet)"
|
|
||||||
else
|
.PHONY: test-e2e
|
||||||
@echo "(pubspec.yaml not scaffolded yet; skipping)"
|
test-e2e: build ## Daemon subprocess + web WASM Playwright smoke.
|
||||||
endif
|
ci/test_e2e.sh
|
||||||
|
|
||||||
|
.PHONY: test-all
|
||||||
|
test-all: test test-a11y test-integration test-e2e ## Everything, sequentially.
|
||||||
|
|
||||||
|
.PHONY: coverage
|
||||||
|
coverage: ## flutter test --coverage + lcov summary.
|
||||||
|
ci/test_coverage.sh
|
||||||
|
|
||||||
|
.PHONY: smoke-bundle
|
||||||
|
smoke-bundle: ## Build Linux release bundle and run it under xvfb for 5s.
|
||||||
|
ci/smoke_bundle.sh
|
||||||
|
|
||||||
|
# -- web UI harness (for Claude Code to drive the app) -----------------
|
||||||
|
|
||||||
|
.PHONY: ui-dev
|
||||||
|
ui-dev: ## Build web WASM + start localhost:4280 in the background.
|
||||||
|
tools/ui/build.sh
|
||||||
|
tools/ui/serve.sh
|
||||||
|
|
||||||
|
.PHONY: ui-stop
|
||||||
|
ui-stop: ## Stop the background web server.
|
||||||
|
tools/ui/stop.sh
|
||||||
|
|
||||||
|
.PHONY: ui-smoke
|
||||||
|
ui-smoke: ## Build + serve + run Playwright smoke + stop.
|
||||||
|
tools/ui/build.sh
|
||||||
|
tools/ui/serve.sh
|
||||||
|
@sh -c 'trap "tools/ui/stop.sh >/dev/null 2>&1" EXIT; cd tools/ui && npx playwright test smoke.spec.ts'
|
||||||
|
|
||||||
.PHONY: build-linux
|
.PHONY: build-linux
|
||||||
build-linux: ## flutter build linux (desktop bundle).
|
build-linux: ## flutter build linux (desktop bundle).
|
||||||
@@ -133,7 +161,7 @@ security: ## Dart advisory review + ptyc source review (manual — no floating d
|
|||||||
# -- pre-push gate -------------------------------------------------------
|
# -- pre-push gate -------------------------------------------------------
|
||||||
|
|
||||||
.PHONY: push-check
|
.PHONY: push-check
|
||||||
push-check: analyze format test ## Full pre-push gate — everything that must pass before a push.
|
push-check: test test-a11y ## Pre-push gate: fast unit + widget + golden + a11y (<90s).
|
||||||
|
|
||||||
.PHONY: hooks
|
.PHONY: hooks
|
||||||
hooks: ## Install the repo's git hooks (points core.hooksPath at .githooks/).
|
hooks: ## Install the repo's git hooks (points core.hooksPath at .githooks/).
|
||||||
|
|||||||
Executable
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Generate + summarize lcov coverage. No thresholds yet (see plan's
|
||||||
|
# "Open questions deferred" — we let the suite run for a week of real
|
||||||
|
# commits before setting hard gates that would just need tuning).
|
||||||
|
set -euo pipefail
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
echo "==> flutter test --coverage"
|
||||||
|
(cd app && flutter test --coverage)
|
||||||
|
|
||||||
|
echo "==> root dart coverage (skipped until dart_test + coverage integrate)"
|
||||||
|
# dart test doesn't emit lcov natively; wire package:coverage later.
|
||||||
|
|
||||||
|
if command -v lcov >/dev/null 2>&1; then
|
||||||
|
echo "==> lcov summary"
|
||||||
|
lcov --summary app/coverage/lcov.info
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user