Adds a MariaDB service to backend-test for SlpModularCms.Api.Tests
Continuous Integration / config (pull_request) Successful in 12s
Continuous Integration / changes (pull_request) Successful in 22s
Continuous Integration / backend-build (pull_request) Successful in 5m52s
Continuous Integration / vulnerability-scan (pull_request) Successful in 5m6s
Continuous Integration / frontend-prepare (pull_request) Successful in 1m24s
Continuous Integration / backend-test (pull_request) Failing after 8m24s
Continuous Integration / frontend-build (pull_request) Successful in 2m14s
Continuous Integration / frontend-test (pull_request) Successful in 4m28s
Continuous Integration / frontend-lint (pull_request) Successful in 2m5s
Continuous Integration / publish-test (pull_request) Skipped
Continuous Integration / publish-production (pull_request) Skipped
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / deploy-production (pull_request) Skipped

The new pipeline regression tests boot the real Api host via
WebApplicationFactory, which unconditionally runs the startup database
migration -- unlike every other test project here, which mocks or uses EF
Core InMemory. CI had no MariaDB service at all, so those tests failed on
the connection itself. Adds a mariadb service container to the backend-test
job plus a ConnectionStrings__DefaultConnection override for that step,
which overrides the appsettings.Development.json placeholder via standard
config layering without touching any committed appsettings file or
affecting local test runs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FWyStNL2ZsjrS7FLd7xvvN
This commit is contained in:
2026-08-02 10:46:25 +02:00
co-authored by Claude Sonnet 5
parent fa389e42ee
commit 0feedf9c01
3 changed files with 43 additions and 0 deletions
@@ -563,3 +563,15 @@
**Context**: Local dev/test database only, explicitly requested by the user, low-risk and reversible (test data). Returning to the Unit 1 Code Generation approval gate.
---
## CI Fix: backend-test Had No Database for the New Pipeline Tests
**Timestamp**: 2026-08-02T12:00:00Z
**User Input**: Pasted the Gitea Actions `backend-test` job log — all 4 `SlpModularCms.Api.Tests` failed with `MySqlException: Access denied for user 'root'@'localhost'`.
**AI Response**: "Read `.gitea/workflows/continuous_integration.yaml`'s `backend-test` job: it runs `dotnet test SlpModularCms.sln -c Release` with no MariaDB service container at all — every other test project (Core.Tests, Module.*.Tests) mocks or uses EF Core InMemory and never needed one. The new `SlpModularCms.Api.Tests` boots the real `Api` host via `WebApplicationFactory`, which unconditionally runs `CmsHost.ConfigurePipeline`'s startup migration -- there is no way to exercise the real pipeline (this unit's whole NFR-CS-01 point) without a real, reachable database, and CI never had one. This is a design gap in the original NFR Requirements/Design for this unit, not something introduced by a later change -- should have been anticipated when Q1=C committed to a real WebApplicationFactory test rather than a fully mocked one. Added a `mariadb` service container to the `backend-test` job plus a `ConnectionStrings__DefaultConnection` environment-variable override for the test step only, which overrides the placeholder in `Api/appsettings.Development.json` via ASP.NET Core's standard configuration layering (env vars win over appsettings.*.json) -- no committed appsettings file changes needed, and zero effect on local `dotnet test` runs (developers' own `appsettings.local.json` continues to apply there, unaffected by a CI-only env var). Verified the override mechanism works by reproducing it locally against the existing local MariaDB container before trusting it in CI."
**Context**: Real bug fix, and a boundary call: `.gitea/workflows/continuous_integration.yaml` is nominally owned by the `gitea-deployment-workflow` feature, but this specific change (making the `backend-test` gate pass for a test project this feature introduced) is Construction/Build-and-Test correctness for `slpsoftware-api`, not a deploy-target retarget (D-15, still deferred to Operations) -- judged in-scope to fix directly rather than blocking the PR on a separate feature's process.
---