feat(database-lab): add local database test environments

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-07-18 22:11:35 +08:00
1 parent 2a65b278e8
commit dda65c0ef0
53 files changed
+1705 -2

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
services:
database:
image: docker.cnb.cool/znb/images/redis:7.4.9-alpine
container_name: dbx-redis-7.4
command: ["redis-server", "--appendonly", "yes", "--requirepass", "${DB_PASSWORD:-123456}"]
environment:
# Keep the password in container env so CMD-SHELL can quote it safely.
REDIS_PASSWORD: "${DB_PASSWORD:-123456}"
ports:
- "${DB_BIND_ADDRESS:-127.0.0.1}:${DB_PORT:-6380}:6379"
volumes:
- data:/data
healthcheck:
test: ["CMD-SHELL", "redis-cli -a \"$$REDIS_PASSWORD\" ping | grep PONG"]
interval: 5s
timeout: 5s
retries: 30
volumes:
data:
+1
View File
@@ -0,0 +1 @@
Redis has no automatic init directory convention. `make db-verify DB=redis@7.4` creates and reads the `dbx:smoke` key.
+13
View File
@@ -0,0 +1,13 @@
{
"database": "redis",
"name": "Redis",
"version": "7.4.9",
"displayVersion": "7.4",
"image": "docker.cnb.cool/znb/images/redis:7.4.9-alpine",
"platforms": ["linux/amd64", "linux/arm64"],
"service": "database",
"defaultPort": 6379,
"connection": { "host": "127.0.0.1", "port": 6380, "username": "default", "password": "123456", "database": 0 },
"shell": ["redis-cli", "-a", "${DB_PASSWORD}"],
"smoke": { "steps": [{ "name": "seed smoke key", "command": ["redis-cli", "-a", "${DB_PASSWORD}", "SET", "dbx:smoke", "DBX smoke"], "expect": "OK" }, { "name": "read smoke key", "command": ["redis-cli", "-a", "${DB_PASSWORD}", "GET", "dbx:smoke"], "expect": "DBX smoke" }] }
}