ci(acl): run the ACL integration test in CI inside the compose network (closes #55) (refs #46)
All checks were successful
CI / lint (pull_request) Successful in 50s
CI / build (pull_request) Successful in 42s
CI / unit (pull_request) Successful in 47s
CI / mutation (pull_request) Successful in 1m31s
CI / integration (pull_request) Successful in 3m43s
CI / compose-smoke (pull_request) Successful in 4m1s

The hosted runner can't reach the stack's published ports (sibling containers),
so run the seed and the test as containers joined to the OpenZaak network,
reaching it by container IP — a single-label host like 'openzaak' isn't URL-valid
for OpenZaak's own URLValidator, but an IPv4 literal is. Code is delivered via
image build / docker cp (bind mounts don't reach the daemon either).

- infra/run-integration.sh: up -> wait healthy (docker inspect) -> seed published
  zaaktype (python container on the net) -> build + run the test image on the net
  -> always tear down. Plain docker primitives only (portable docker/podman).
- services/acl/Dockerfile.integration: builds + runs Acl.IntegrationTests; dotnet
  lives in the image, so the CI job needs only Docker (no setup-dotnet).
- make integration now delegates to the script; re-added the Gitea Actions job.

Supersedes the local-only gap documented earlier; #55 is no longer needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-29 12:28:43 +02:00
parent 3829cb0b68
commit 4474585606
7 changed files with 138 additions and 35 deletions

View File

@@ -47,8 +47,9 @@ itself. No new test dependency is added.**
- **The lane is kept out of the fast checks.** `make unit` runs with
`--filter "Category!=Integration"`; Stryker is pinned to `Acl.Tests` (`test-projects`), so
neither the unit nor the mutation lane needs a live stack. A new `make integration` target
brings the stack up, seeds, runs the lane, and always tears down. This matches `make` being
the single source of truth (ADR-0005).
(`infra/run-integration.sh`) brings the stack up, seeds, runs the lane, and always tears down
— mirrored by a Gitea Actions `integration` job. This matches `make` being the single source
of truth (ADR-0005).
- **Publishing is opt-in in the seed.** `infra/openzaak/seed_catalogus.py` gains an
`OZ_PUBLISH=1` path that adds the relations OpenZaak's publish requires — two statustypen
(begin/eind), a roltype, and a resultaattype whose Selectielijst procestype is matched onto
@@ -70,12 +71,13 @@ itself. No new test dependency is added.**
in production) but it is a network touchpoint, and a CI environment without egress would need
a local Selectielijst service or a recorded fixture. `OZ_SELECTIELIJST` overrides the base URL.
- **Cost:** the lane needs the stack up first, so it is separate from the fast lanes.
- **Not yet a hosted-runner job.** `make integration` passes locally and on a host-executing
runner, but on Gitea's hosted runner a process *on the runner* cannot reach the stack's
published ports — Compose starts sibling containers via the host daemon, so the ports bind to
the host, not the runner (gitea-actions-gotchas.md §5, the same split as §1). Running the test
and seed *inside* the compose network (via a built image, not bind mounts) to gate it in CI is
tracked in **#55**. Until then the lane runs locally and is not a merge gate.
- **Runs on the hosted runner.** A process *on* the runner can't reach the stack's published
ports (Compose starts sibling containers via the host daemon — gitea-actions-gotchas.md §5,
same split as §1), so `infra/run-integration.sh` runs both the seed and the test as containers
*joined to the OpenZaak network*, reaching it by **container IP** (a single-label host like
`openzaak` isn't URL-valid for OpenZaak's own `URLValidator`; an IPv4 literal is). Code is
delivered by image build / `docker cp`, never bind mounts. The CI job therefore needs only
Docker — no `setup-dotnet`. (This closed the follow-up that was originally split out as #55.)
## Alternatives considered

View File

@@ -17,13 +17,13 @@ and CI cannot drift:
| `build` | `make build``dotnet build … -c Release` | .NET 10 SDK |
| `unit` | `make unit``dotnet test … -c Release --filter "Category!=Integration"` | .NET 10 SDK |
| `mutation` | `make mutation``dotnet tool restore``dotnet stryker` (ACL); uploads the HTML report as an artifact | .NET 10 SDK |
| `integration` | `make integration``infra/run-integration.sh`: OpenZaak up → seed a **published** BIG zaaktype + run `Acl.IntegrationTests` **as containers inside the compose network** → tear down | container engine + egress (base images, nuget, `selectielijst.openzaak.nl`) |
| `compose-smoke` | `make smoke` → seed config volumes → `up -d` (full stack) → `up --wait` durable services → `down` | container engine + compose v2 |
> **`make integration` is not a hosted-runner job yet.** The ACL ↔ real-OpenZaak
> test (`make integration`, ADR-0006) passes locally and on a host-executing runner,
> but a process on the hosted runner can't reach the stack's published ports
> (sibling containers — see [gitea-actions-gotchas.md §5](gitea-actions-gotchas.md)).
> Run it inside the compose network to gate it in CI — tracked in **#55**.
> **The `integration` job needs no `setup-dotnet`.** dotnet runs inside the test
> image, and both the seed and the test join the OpenZaak network and reach it by
> container IP — so the runner never has to reach a published port
> (see [gitea-actions-gotchas.md §5](gitea-actions-gotchas.md)).
All `uses:` references are absolute, tag-pinned URLs (`https://github.com/actions/checkout@v4`,
`https://github.com/actions/setup-dotnet@v4`) per CLAUDE.md §8.7 and §15 — Gitea

View File

@@ -152,6 +152,8 @@ service by name (`http://openzaak:8000`). For a test/seed that needs the repo's
code, deliver it via a **built image** (not a bind mount — §1), then
`docker run --network <stack>_cg …`.
**Status**`make integration` (the ACL ↔ real-OpenZaak test, ADR-0006) therefore
runs locally / on a host-executing runner only. Gating it on the hosted runner via
the compose network is tracked in **#55**.
**Applied**`make integration` (the ACL ↔ real-OpenZaak test, ADR-0006) does
exactly this: `infra/run-integration.sh` runs the seed and the test as containers on
the OpenZaak network and reaches it by **container IP** (a single-label service name
like `openzaak` isn't URL-valid — OpenZaak echoes the request host into the URLs it
returns and then rejects them with Django's `URLValidator`; an IPv4 literal passes).