Phase 3 sub-commit 4: bridge-integration test (HTTP/SSE round-trip + crash-recover)
examples/todo/tests/integration.sh boots FrankenPHP against the example
app on an isolated port (8767) and database (tests/var/integration.sqlite),
then asserts:
- POST /api/todos creates a row, GET returns it.
- SSE stream on app://model/todo carries the §4 envelope with op,
correlationKey echoed from Idempotency-Key, and the JSON payload.
- The backend log shows ≥2 "Update published" lines per change
(collection topic + entity topic — dual publish per ModelPublisher).
- Killing FrankenPHP makes /healthz unreachable; restarting it
restores GET access without losing data.
Wired into make quality alongside the existing PHPStan / cs-fixer /
PHPUnit / qmllint checks. The script is self-contained — runs against
the example without disturbing a developer's `make dev` instance.
qmltestrunner integration deferred: out-of-the-box runner can't see
PhpQml.Bridge because the framework module is statically linked into
the host binary. A proper QML test target would need a custom CMake
executable that links the module + uses QtQuickTest's quick_test_main.
Phase 3.x or Phase 5 polish.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,12 @@ doctor-connect: ## Run bridge:doctor with backend connectivity probe
|
||||
clean: ## Remove build artefacts
|
||||
rm -rf $(BUILD_DIR)
|
||||
|
||||
.PHONY: integration
|
||||
integration: ## Run the bridge-integration test (FrankenPHP boot + HTTP/SSE round-trip + crash-recover)
|
||||
./tests/integration.sh
|
||||
|
||||
.PHONY: quality
|
||||
quality: build ## Run PHPStan, php-cs-fixer (check), PHPUnit, qmllint
|
||||
cd ../php && composer quality
|
||||
quality: build ## Run PHPStan, php-cs-fixer (check), PHPUnit, qmllint, integration
|
||||
cd ../../framework/php && composer quality
|
||||
cmake --build $(BUILD_DIR) --target all_qmllint
|
||||
./tests/integration.sh
|
||||
|
||||
Reference in New Issue
Block a user