用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/lukemcqueen/hermes-cortex --skill docker-test-isolation-harness命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Cross-server agent health monitoring using binary status vectors — deploy health endpoints on each agent, poll from orchestrator, alert on state transitions.
Wire a self-hosted Langfuse instance to Hermes Agent — generate API keys, configure env vars, enable the bundled plugin, install SDK, and verify traces flow.
Use before enforcement code changes or shared-repo commits.
| name | docker-test-isolation-harness |
| description | Isolated throwaway containers for Docker test runs. |
| category | devops |
| version | 1.0.0 |
| platforms | ["linux","macos"] |
Run a Docker-based project's integration test suite WITHOUT bringing up its full compose stack on a shared host where that stack would collide with other running services. Uses isolated throwaway containers with unique names/ports, then tears them down.
Trigger when the project's stack can't come up safely on the host, yet the suite needs a real Postgres/Redis:
container_name: postgres / redis that collide with another
project's already-running containers of the same name — running yours would attach to or
disturb the wrong project's DB.docker ps)..venv with pytest + alembic installed (or the equivalent runner).# Which project owns the running 'postgres'? Read the compose-project label.
docker inspect postgres --format \
'project={{index .Config.Labels "com.docker.compose.project"}} \
workdir={{index .Config.Labels "com.docker.compose.project.working_dir"}}'
docker ps --format '{{.Names}}\t{{.Status}}\t{{.Ports}}' # non-default port maps reveal a sibling
A postgres on 13211->5432 is not your project's default 5432 — it belongs to someone else.
# 1. Throwaway Postgres + Redis with UNIQUE names and free ports.
docker run -d --name <proj>-test-pg -e POSTGRES_USER=<user> -e POSTGRES_PASSWORD=<pw> \
-e POSTGRES_DB=<db> -p 127.0.0.1:<p1>:5432 postgres:16-alpine
docker run -d --name <proj>-test-redis -p 127.0.0.1:<p2>:6379 redis:7-alpine
# wait for readiness: for i in $(seq 1 30); do \
# docker exec <proj>-test-pg pg_isready -U <user> >/dev/null 2>&1 && break; sleep 1; done
# 2. Point the app/tests at them via env. Env overrides .env in pydantic-settings.
export DATABASE_URL="postgresql://<user>:<pw>@127.0.0.1:<p1>/<db>"
export REDIS_URL="redis://127.0.0.1:<p2>/0"
# 3. Alembic reads sqlalchemy.url from alembic.ini, NOT env -> throwaway ini via -c.
# env.py's sys.path insert is anchored to env.py location, so -c from /tmp still imports the project.
# [alembic] script_location = <abs>/.../migrations ; sqlalchemy.url = postgresql://<user>:<pw>@127.0.0.1:<p1>/<db>
.venv/bin/python -m alembic -c /tmp/<proj>-test-alembic.ini upgrade head
# 4. Run the suite. The test harness spawns its own server subprocess -> inherits the env.
DATABASE_URL=... REDIS_URL=... .venv/bin/python -m pytest tests/ -q
# 5. Teardown AND confirm the sibling project is still up.
docker rm -f <proj>-test-pg <proj>-test-redis && rm -f /tmp/<proj>-test-alembic.ini
docker ps --format '{{.Names}}' | grep -E '^(postgres|redis|worker)$' # sibling set present
create_engine wants postgresql://
(psycopg2), NOT postgresql+asyncpg. Match the project's database.py / config default../run: the suite's spawned subprocess inherits YOUR
exported env; a ./run wrapper may source .env and clobber the override.nc -z 127.0.0.1 <port> before docker run -p.-test- containers clutter the host and can be mistaken
for the real stack.container_name: postgres/redis across projects) and its
permanent fix (unique container names per project) is covered in the engineering-approach skill.api/ gitignore silently dropping an app dir
from git — is in git-forensics / git-pull-local-changes.