Skip to content

Commit f0e260b

Browse files
committed
Add database smoke checks
1 parent 1b32c65 commit f0e260b

14 files changed

Lines changed: 357 additions & 5 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ devices: device.udev.*
309309
notifications: notify.mail.send
310310
```
311311

312-
See `docs/plugins/` for detailed examples of every builtin plugin. Use `scripts/release-check.sh` before tagging a release to verify generated plugin docs, runbook indexes, policy/risk preflight, plugin coverage gates, tests, documentation and packages together.
312+
See `docs/plugins/` for detailed examples of every builtin plugin. Use `scripts/release-check.sh` before tagging a release to verify generated plugin docs, runbook indexes, policy/risk preflight, SQLite database smoke, plugin coverage gates, tests, documentation and packages together.
313313

314314
## Variables and secrets
315315

docs/guides/database-smoke.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<!--
2+
Copyright (C) 2026 Marco Fortina
3+
SPDX-License-Identifier: AGPL-3.0-or-later
4+
-->
5+
6+
# Database Smoke Checks
7+
8+
`scripts/database-smoke.sh` runs controller-side database health checks through the Automax database check plugins.
9+
10+
SQLite is always executed because it requires no external service. PostgreSQL, MySQL/MariaDB and Oracle are optional and run only when their environment variables are provided.
11+
12+
## Commands
13+
14+
```bash
15+
scripts/database-smoke.sh --list
16+
scripts/database-smoke.sh --engine sqlite
17+
scripts/database-smoke.sh --engine all
18+
```
19+
20+
The default output directory is:
21+
22+
```text
23+
dist/database-smoke/
24+
```
25+
26+
Each run writes:
27+
28+
```text
29+
summary.txt
30+
summary.json
31+
sqlite.log
32+
postgres.log
33+
mysql.log
34+
oracle.log
35+
```
36+
37+
Only the selected engines create logs.
38+
39+
## Environment variables
40+
41+
PostgreSQL:
42+
43+
```bash
44+
export AUTOMAX_POSTGRES_DSN='postgresql://automax:automax@127.0.0.1:5432/automax'
45+
```
46+
47+
MySQL/MariaDB:
48+
49+
```bash
50+
export AUTOMAX_MYSQL_HOST=127.0.0.1
51+
export AUTOMAX_MYSQL_PORT=3306
52+
export AUTOMAX_MYSQL_USER=automax
53+
export AUTOMAX_MYSQL_PASSWORD=automax
54+
export AUTOMAX_MYSQL_DATABASE=automax
55+
```
56+
57+
Oracle:
58+
59+
```bash
60+
export AUTOMAX_ORACLE_DSN='db01.example.com/FREEPDB1'
61+
export AUTOMAX_ORACLE_USER=automax
62+
export AUTOMAX_ORACLE_PASSWORD=automax
63+
```
64+
65+
Optional engines require their corresponding Python extras and database client setup.
66+
67+
## Runtime validation packs
68+
69+
Runtime validation packs include the `database-smoke` step. Without optional database environment variables, the script records PostgreSQL, MySQL/MariaDB and Oracle as skipped while SQLite still runs.
70+
71+
## Release check
72+
73+
`scripts/release-check.sh` runs SQLite database smoke as a release guardrail because it is local and deterministic.

docs/guides/runtime-validation-packs.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,7 @@ AUTOMAX_RUNTIME_EVIDENCE_RETAIN=10 scripts/runtime-validation-packs.sh --pack pa
8181

8282
Use `scripts/runtime-evidence-index.sh --verify` to rebuild the index and verify
8383
all discovered checksums without running a new pack.
84+
85+
## Database smoke step
86+
87+
The `database-smoke` step runs `scripts/database-smoke.sh`. SQLite is local and deterministic; PostgreSQL, MySQL/MariaDB and Oracle run only when their environment variables are configured.

docs/plugins/database.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,20 @@ register the canonical plugin in `build_builtin_registry()` or load it through a
130130
external plugin path. The shared base already handles statement validation,
131131
output shaping and common result metadata.
132132

133+
## Database smoke script
134+
135+
Use the controller-side smoke script for release or lab evidence:
136+
137+
```bash
138+
scripts/database-smoke.sh --engine sqlite
139+
scripts/database-smoke.sh --engine all
140+
```
141+
142+
SQLite runs locally. PostgreSQL, MySQL/MariaDB and Oracle run when their environment variables are provided.
143+
133144
## Database health checks
134145

146+
135147
`database.sqlite.check` is a read-only controller-side health check plugin for the existing
136148
SQLite, PostgreSQL, MySQL/MariaDB and Oracle database families. It is intended
137149
for precheck and postcheck gates, not for application queries.

docs/reference/release.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ The script verifies:
3737
- generated plugin reference freshness;
3838
- plugin smoke runbook index freshness;
3939
- policy/risk preflight for committed examples;
40+
- SQLite database smoke through `scripts/database-smoke.sh`;
4041
- Python source compilation;
4142
- Python 3.9 compatibility guardrails;
4243
- Ruff checks;
@@ -80,6 +81,7 @@ Keep the following with the release record:
8081
- JSONL run event stream exported with `automax runs events`;
8182
- runtime validation pack output from `scripts/runtime-validation-packs.sh`;
8283
- policy/risk preflight output from `scripts/policy-risk-preflight.sh`;
84+
- database smoke summaries when database behavior changed;
8385
- approval gate files for release operations that require sign-off;
8486
- `automax plugins coverage --strict` output for builtin and release-loaded
8587
plugins;

examples/runtime-packs/debian-like.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# SPDX-License-Identifier: AGPL-3.0-or-later
33

44
AUTOMAX_RUNTIME_PACK_DESCRIPTION="Debian-like disposable VM validation pack"
5-
AUTOMAX_RUNTIME_PACK_STEPS="release-metadata package-smoke plugin-checks ssh-evidence"
5+
AUTOMAX_RUNTIME_PACK_STEPS="release-metadata package-smoke database-smoke plugin-checks ssh-evidence"
66
AUTOMAX_RUNTIME_OS_FAMILY="debian-like"

examples/runtime-packs/package-only.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# SPDX-License-Identifier: AGPL-3.0-or-later
33

44
AUTOMAX_RUNTIME_PACK_DESCRIPTION="Release metadata and package smoke validation"
5-
AUTOMAX_RUNTIME_PACK_STEPS="release-metadata package-smoke"
5+
AUTOMAX_RUNTIME_PACK_STEPS="release-metadata package-smoke database-smoke"

examples/runtime-packs/privileged-vm.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# SPDX-License-Identifier: AGPL-3.0-or-later
33

44
AUTOMAX_RUNTIME_PACK_DESCRIPTION="Privileged disposable VM validation pack"
5-
AUTOMAX_RUNTIME_PACK_STEPS="release-metadata package-smoke plugin-checks ssh-evidence"
5+
AUTOMAX_RUNTIME_PACK_STEPS="release-metadata package-smoke database-smoke plugin-checks ssh-evidence"
66
AUTOMAX_RUNTIME_PRIVILEGED="1"

examples/runtime-packs/redhat-like.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# SPDX-License-Identifier: AGPL-3.0-or-later
33

44
AUTOMAX_RUNTIME_PACK_DESCRIPTION="Red Hat-like disposable VM validation pack"
5-
AUTOMAX_RUNTIME_PACK_STEPS="release-metadata package-smoke plugin-checks ssh-evidence"
5+
AUTOMAX_RUNTIME_PACK_STEPS="release-metadata package-smoke database-smoke plugin-checks ssh-evidence"
66
AUTOMAX_RUNTIME_OS_FAMILY="redhat-like"

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ nav:
7070
- Extended SSH Smoke: guides/ssh-smoke.md
7171
- Runtime Evidence Suite: guides/runtime-evidence.md
7272
- Runtime Validation Packs: guides/runtime-validation-packs.md
73+
- Database Smoke: guides/database-smoke.md
7374
- Policy and Risk Preflight: guides/policy-risk-preflight.md
7475
- Approval Gates: guides/approval-gates.md
7576
- Runtime Evidence Index: guides/runtime-evidence-index.md

0 commit comments

Comments
 (0)