Skip to main content

Testing and quality

The module creates infrastructure that carries patient data in someone else's subscription, so a wrong default is the failure we test hardest against: a public endpoint, a broad role, a secret passed as a plain value. No test or check signs in to Azure or applies anything. Every one reads the code, or plans against mocked providers, with every Azure credential unset. The numbers for the current release are in Current numbers below.

What we run, and what each catches​

CheckWhat it doesWhat it catchesWhat it cannot catch
terraform test (tests/run.sh)plans the root module, each module under modules/ and each example under examples/ against mocked azurerm and azapi providers, with assertions on what the plan would createa default that changed, a resource that is or is not created, an input the plan should refuse but accepts, a wrong value wired from one module to anotheranything Azure decides at apply time: a quota, a name taken, an API that refuses a setting, a limit the documentation does not state
terraform validate (scripts/validate.sh)terraform init and validate in the root, each module and each examplea configuration that does not parse, an unknown argument, a type that does not fit, an example that no longer matches the module's inputswhether a valid configuration does what we meant
tflint, with the azurerm ruleset (scripts/policy.sh)lints every module and examplea value the ruleset knows Azure refuses, such as an unknown SKU, a deprecated argument, an unused declarationa setting that is valid and unsafe
trivy, at HIGH and CRITICAL (scripts/policy.sh)scans the configuration for known misconfigurations; a finding we accept is marked in the code with its reasona public endpoint, encryption off, a network rule that allows everythinga risk no rule of its own names
terraform fmt -checkthe layout of every filea file not in the canonical layoutanything else
The docs checks (scripts/docs.sh --check, cosyte-docs-content)regenerate the reference and each example's files, and read the pages' shapea reference page out of date with the code, an example with no page, a page whose files drifted, a broken link between pageswhether a page's prose is right
actionlint, and the dash checklint the workflows, and scan every file and the pull request's texta workflow that would fail to start; a character our style forbidsanything else

tests/run.sh also refuses to run a test that could reach Azure: a run block that does not say command = plan, a test file that does not mock a provider its module requires, and a module without tests.

What no check here can catch​

The module has not yet been applied to a real Azure subscription by us. Mocked providers return what the test tells them to, so a plan that passes here can still fail at apply time, and a behavior Azure documents can differ from what it does. Limits we rely on lists the behaviors a live test still has to confirm.

Run them yourself​

The tools are pinned in mise.toml. From a clone, with mise installed:

mise install
MISE_DISABLE_TOOLS=tflint mise exec -- tests/run.sh
MISE_DISABLE_TOOLS=tflint mise exec -- scripts/validate.sh
MISE_DISABLE_TOOLS=tflint mise exec -- scripts/policy.sh
MISE_DISABLE_TOOLS=tflint mise exec -- scripts/docs.sh --check

None of them needs or reads an Azure credential. scripts/policy.sh downloads the pinned tflint and trivy and checks their checksums.

Current numbers​

Measured by the release workflow for version 0.1.0, at commit b12d194b7e95, on 2026-11-30, with Terraform 1.15.7 on a GitHub-hosted runner (ubuntu26, X64).

FolderTest filesRun blocks
.568
modules/alarms15
modules/container_apps453
modules/database110
modules/identity12
modules/key_vault215
modules/logs14
modules/storage129

In all, 16 test files and 186 run blocks, each a plan against mocked providers.

CheckCommandResult
validatescripts/validate.shpassed
testtests/run.shpassed