@@ -1,6 +1,6 @@
|
||||
# Integration Tests
|
||||
|
||||
Dockerized integration tests for the vibe server.
|
||||
Dockerized integration tests for the tbd server.
|
||||
|
||||
## Quick Start
|
||||
|
||||
@@ -13,7 +13,7 @@ docker-compose up --abort-on-container-exit
|
||||
|
||||
## Manual Run (app already running)
|
||||
|
||||
If your vibe app is running locally on port 3000:
|
||||
If your tbd app is running locally on port 3000:
|
||||
|
||||
```bash
|
||||
cd integration-test
|
||||
@@ -65,7 +65,7 @@ unit tests, the integration tests, and both combined. From the repo root:
|
||||
| Task | What it does | Output |
|
||||
|------|--------------|--------|
|
||||
| `script/unit-coverage` | Runs `test/` under Cloverage | `target/coverage/unit/` |
|
||||
| `script/integration-coverage` | Runs the integration suite against a Cloverage-instrumented `vibe-app` container | `target/coverage/integration/` |
|
||||
| `script/integration-coverage` | Runs the integration suite against a Cloverage-instrumented `tbd-app` container | `target/coverage/integration/` |
|
||||
| `script/coverage-report` | Merges the two `lcov.info` files, prints a per-file table | `target/coverage/merged/` |
|
||||
| `script/coverage` | All three, in order (the full suite with a joint report) | all of the above |
|
||||
|
||||
@@ -74,7 +74,7 @@ merged report a line counts as covered if either suite hit it; the HTML shows pe
|
||||
counts per suite (`u:` unit, `i:` integration).
|
||||
|
||||
How the integration numbers are collected: `docker-compose.coverage.yml` starts the app via
|
||||
`vibe.integration.coverage`, which lets Cloverage instrument `src/` and then serves real
|
||||
`tbd.integration.coverage`, which lets Cloverage instrument `src/` and then serves real
|
||||
traffic until it receives SIGTERM. `script/integration-coverage` stops the container
|
||||
(`docker compose stop`) so the report gets written, then copies it out with `docker compose cp`.
|
||||
Plain `script/integration-test` / `script/test` are unchanged and run the uninstrumented app.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Overlay for `script/integration-coverage`: runs vibe-app under Cloverage instead of plainly.
|
||||
# Overlay for `script/integration-coverage`: runs tbd-app under Cloverage instead of plainly.
|
||||
# Reports land in /app/target/coverage/integration inside the container; script/integration-test copies
|
||||
# them out after the app is stopped (SIGTERM is what triggers the report).
|
||||
services:
|
||||
vibe-app:
|
||||
tbd-app:
|
||||
build:
|
||||
args:
|
||||
DEPS_ALIASES: run:cov
|
||||
@@ -10,13 +10,13 @@ services:
|
||||
- clojure
|
||||
- -M:cov
|
||||
- -m
|
||||
- vibe.integration.coverage
|
||||
- tbd.integration.coverage
|
||||
- --runner
|
||||
- integration
|
||||
- --src-ns-path
|
||||
- src
|
||||
- --extra-test-ns
|
||||
- vibe.integration.coverage
|
||||
- tbd.integration.coverage
|
||||
- --lcov
|
||||
- --html
|
||||
- --output
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
services:
|
||||
vibe-app:
|
||||
image: vibe-app-integration
|
||||
tbd-app:
|
||||
image: tbd-app-integration
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "${VIBE_PORT:-3000}:${VIBE_PORT:-3000}"
|
||||
- "${TBD_PORT:-3000}:${TBD_PORT:-3000}"
|
||||
security_opt:
|
||||
- apparmor:unconfined
|
||||
environment:
|
||||
- PORT=${VIBE_PORT:-3000}
|
||||
- PORT=${TBD_PORT:-3000}
|
||||
# No container healthcheck: healthchecks run via `docker exec`, which hits the
|
||||
# same LXC/AppArmor runc bug (opencontainers/runc#5007) as image builds and
|
||||
# always fails here. integration_test.bb polls the server until it's ready.
|
||||
@@ -17,12 +17,12 @@ services:
|
||||
# The suite is baked into the image (Dockerfile) rather than bind-mounted: bind mounts
|
||||
# resolve on the Docker host, so they break when run from inside a CI job container.
|
||||
integration-test:
|
||||
image: vibe-integration-test
|
||||
image: tbd-integration-test
|
||||
build:
|
||||
context: .
|
||||
security_opt:
|
||||
- apparmor:unconfined
|
||||
depends_on:
|
||||
vibe-app:
|
||||
tbd-app:
|
||||
condition: service_started
|
||||
entrypoint: ["bb", "/integration_test.bb", "http://vibe-app:${VIBE_PORT:-3000}"]
|
||||
entrypoint: ["bb", "/integration_test.bb", "http://tbd-app:${TBD_PORT:-3000}"]
|
||||
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
(ns vibe.integration.coverage
|
||||
"Entry point that runs the vibe server under Cloverage instrumentation so the
|
||||
(ns tbd.integration.coverage
|
||||
"Entry point that runs the tbd server under Cloverage instrumentation so the
|
||||
black-box integration tests produce a line-coverage report.
|
||||
|
||||
Cloverage normally instruments the source and then runs a test suite in-process.
|
||||
Here the 'suite' is the outside world: the runner starts the real server and blocks
|
||||
until the JVM gets SIGTERM (`docker compose stop`), then Cloverage writes its reports.
|
||||
|
||||
Deliberately does not require any vibe.* source namespace at load time: those must
|
||||
Deliberately does not require any tbd.* source namespace at load time: those must
|
||||
be loaded by Cloverage (instrumented), not by us."
|
||||
(:require [cloverage.coverage :as cov]))
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
(fn [_nses]
|
||||
(let [stop (promise)
|
||||
main (Thread/currentThread)]
|
||||
((requiring-resolve 'vibe.core/start-server))
|
||||
((requiring-resolve 'tbd.core/start-server))
|
||||
;; The report is written by the main thread after the runner returns, but the JVM
|
||||
;; only stays up while shutdown hooks run, so the hook must wait for the main thread.
|
||||
(.addShutdownHook (Runtime/getRuntime)
|
||||
Reference in New Issue
Block a user