ADR-MB-025: Testing strategy
Status
Accepted (complements ADR-MB-007)
Context
ADR-MB-007 selects Conftest as the policy engine but does not describe how the repository is validated. MijnBureau is a Helmfile composition of third-party charts, so most defects appear as rendered manifests rather than application code: wrong namespaces, missing secrets, broken selectors, invalid values or environment-specific gating.
A single render is not enough because environments intentionally differ. Tests must run without a cluster so contributors and CI get the same result.
Decision
We will validate changes with a layered, cluster-free test strategy.
- Formatting — Prettier over the repository (
scripts/format.sh). - Lint — gitlint for commit messages and
helmfile lintfor charts (scripts/lint.sh). - Render matrix —
scripts/test.shrenders every environment listed intests/*.yamland runs the environment-specific Rego rules intests/. - Policy —
scripts/policy.shrunspolicy/against the rendered default environment, covering namespaces, labels, images and NetworkPolicies. - CI parity —
.github/workflows/ci.yamlrenders every environment, runs kubeconform and Conftest on the output, and executes the same setup tests.
A change is not complete until all steps pass for the environments it affects. Rendering
outside the scripts requires MIJNBUREAU_MASTER_PASSWORD to be set explicitly.
Consequences
Pros:
- ✅ Failures are caught before a cluster is involved.
- ✅ Environment-specific gating is exercised, not assumed.
- ✅ Contributors can reproduce CI locally with the same scripts.
Cons:
- ❌ The render matrix grows with every environment and slows CI.
- ❌ Policy tests validate structure, not runtime behaviour; upgrade testing still needs a cluster.
- ❌ Third-party chart behaviour can change in ways the policy rules do not model.