fix theme picker integration test; one bake for build-time facts (T-116)
test / unit + widget + golden + a11y (push) Failing after 31s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m1s

The test was awaiting services.commands.execute('theme.pick') whose
Future doesn't complete until the dialog is dismissed — deadlock.
Fire-and-forget around pumpAndSettle, then tap Cancel, then await
the original future. Also tear the widget tree down before
services.dispose() so listening widgets unsubscribe first.

Pre-existing layout overflow in the welcome _StatusLine surfaced
when running the test at narrower viewports. Switched to a whole-
row FittedBox(scaleDown) — uniform shrink on narrow screens, no-op
at standard widths.

User flagged the hardcoded 'clide 2.0.0-dev' string. Replaced with
one generated lib/src/build_info.g.dart (gitignored, regenerated
by `make gen-build-info` from pubspec.yaml + git short SHA + UTC
clock). The same target re-syncs assets/licenses.yaml self.version
in place — no second source. Every make build/run/test depends on
it implicitly. Welcome status line now reads `clideVersion`. Stale
fontSize literals in welcome_view swept to typography constants;
clideFontMeta=13, clideFontDialogTitle=16, clideFontWelcomeBanner=52
added to fill gaps in the scale.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-05-18 13:22:55 +02:00
co-authored by Claude
parent 68aa34e9dd
commit 7c2eae42f1
12 changed files with 156 additions and 81 deletions
+29 -12
View File
@@ -19,6 +19,7 @@ else
endif
VERSION ?= $(shell awk -F': *' '/^version:/ {gsub(/[" ]/,"",$$2); print $$2; exit}' pubspec.yaml)
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
.PHONY: help
@@ -28,7 +29,7 @@ help: ## Show this help.
# -- app (Flutter) -------------------------------------------------------
.PHONY: run
run: ## Launch the Flutter desktop app.
run: gen-build-info ## Launch the Flutter desktop app.
ifeq ($(FLUTTER_OS),linux)
GDK_BACKEND=x11 LD_LIBRARY_PATH=$(CURDIR)/native/linux-x64$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} flutter run -d linux --dart-define=CLIDE_PROJECT=$(CURDIR)
else
@@ -64,7 +65,7 @@ pubget: ## flutter pub get.
flutter pub get
.PHONY: build-check
build-check: ## Verify native + Dart build compiles (no run).
build-check: gen-build-info ## Verify native + Dart build compiles (no run).
ifeq ($(FLUTTER_OS),linux)
LD_LIBRARY_PATH=$(CURDIR)/native/linux-x64$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} flutter build linux
else
@@ -79,29 +80,45 @@ analyze: ## flutter analyze.
format: ## dart format --set-exit-if-changed.
dart format --set-exit-if-changed .
# The single bake of every build-time fact derived from pubspec.yaml
# + git + clock. Runs implicitly as a prereq of every target that
# compiles or executes Dart code so nobody has to remember it.
#
# Outputs:
# - lib/src/build_info.g.dart — gitignored, fresh on every build.
# Exposes `clideVersion` (from pubspec), `clideCommit` (git short
# SHA), `clideDate` (UTC now) for the app to read directly.
# - assets/licenses.yaml `self.version:` — rewritten in place so the
# bundled license manifest never drifts from pubspec. (Tracked in
# git; the rewrite is a no-op when in sync.)
.PHONY: gen-build-info
gen-build-info:
@printf '// GENERATED — do not edit. Regenerated by `make` on every\n// build/run/test (see gen-build-info in Makefile). The version\n// field is read from pubspec.yaml `version:` — the single source\n// of truth for the release number; commit + date stamp at run time.\nconst String clideVersion = '"'"'%s'"'"';\nconst String clideCommit = '"'"'%s'"'"';\nconst String clideDate = '"'"'%s'"'"';\n' "$(VERSION)" "$(COMMIT)" "$(DATE)" > lib/src/build_info.g.dart
@awk -v v="$(VERSION)" '/^self:/ {in_self=1} in_self && /^[[:space:]]+version:/ {sub(/version:.*/, "version: \"" v "\""); in_self=0} {print}' assets/licenses.yaml > assets/licenses.yaml.tmp && mv assets/licenses.yaml.tmp assets/licenses.yaml
.PHONY: verify
verify: analyze format decisions-validate changelog-gate ## No-tests sweep — analyze + format + decisions-validate + changelog-gate. For mid-edit "are the gates green?" checks; `push-check` is the full pre-push pipeline.
verify: gen-build-info analyze format decisions-validate changelog-gate ## No-tests sweep — gen-build-info + analyze + format + decisions-validate + changelog-gate. For mid-edit "are the gates green?" checks; `push-check` is the full pre-push pipeline.
.PHONY: t
t: ## Run one test path with tee'd output. Usage: make t T=test/path/to/spec.dart
t: gen-build-info ## Run one test path with tee'd output. Usage: make t T=test/path/to/spec.dart
@mkdir -p test/.test-output
@if [ -z "$(T)" ]; then echo "usage: make t T=test/path/to/spec.dart" >&2; exit 2; fi
flutter test $(T) 2>&1 | tee test/.test-output/last.log
.PHONY: test
test: ## Fast: analyze + format + unit + widget + golden (<60s).
test: gen-build-info ## Fast: analyze + format + unit + widget + golden (<60s).
ci/test.sh
.PHONY: test-core
test-core: ## Core subsystem tests (IPC, PTY, git, pane registry).
test-core: gen-build-info ## Core subsystem tests (IPC, PTY, git, pane registry).
ci/test_core.sh
.PHONY: test-a11y
test-a11y: ## A11y contract (semantic coverage + keyboard + contrast + i18n).
test-a11y: gen-build-info ## A11y contract (semantic coverage + keyboard + contrast + i18n).
ci/test_a11y.sh
.PHONY: test-integration
test-integration: ## Integration tests (real app boot; xvfb on headless Linux).
test-integration: gen-build-info ## Integration tests (real app boot; xvfb on headless Linux).
ci/test_integration.sh
.PHONY: test-e2e
@@ -141,15 +158,15 @@ ui-smoke: ## Build + serve + run Playwright smoke + stop.
@sh -c 'trap "tools/ui/stop.sh >/dev/null 2>&1" EXIT; cd tools/ui && npx playwright test smoke.spec.ts'
.PHONY: build
build: ## flutter build for the current OS.
build: gen-build-info ## flutter build for the current OS.
flutter build $(FLUTTER_OS)
.PHONY: build-linux
build-linux: ## flutter build linux (desktop bundle).
build-linux: gen-build-info ## flutter build linux (desktop bundle).
flutter build linux
.PHONY: build-macos
build-macos: ## flutter build macos (desktop bundle).
build-macos: gen-build-info ## flutter build macos (desktop bundle).
flutter build macos
# -- install / uninstall -----------------------------------------------------
@@ -263,7 +280,7 @@ decisions-validate: ## Parser dry-run over governance/{decisions,questions,rejec
push-check: decisions-validate test-core test test-a11y coverage-gate changelog-gate ## Pre-push gate (fast — <2 min target).
.PHONY: push-check-full
push-check-full: push-check test-integration smoke-bundle ## Pre-release gate (push-check + integration + smoke; slower; skips theme_picker per T-116).
push-check-full: push-check test-integration smoke-bundle ## Pre-release gate (push-check + integration + smoke; slower).
.PHONY: hooks
hooks: ## Install the repo's git hooks.