mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-10-20 05:15:31 +00:00
Add a module-scoped `shared_container` fixture to tests/docker/conftest.py that boots one `sleep infinity` container per test module and tears it down at module exit. Convert read-only tests that previously used `docker run --rm --entrypoint sh/cat/test/su` (bypassing s6 to check static image properties) or `docker run -d` + `docker exec` (starting identical containers per test) to use `docker exec` on the shared container instead. Converted files: test_immutable_install_permissions.py — 2 throwaway runs → 2 execs test_license_file_present.py — 1 throwaway run → 1 exec test_tini_compat_shim.py — 1 throwaway run → 1 exec test_tui_prebuilt_bundle.py — 2 throwaway runs → 2 execs test_dump_build_sha.py — 2 throwaway runs → 2 execs test_immutable_install.py — 3 detached runs → 1 shared + 1 isolated test_dashboard.py — 2 detached runs → 0 (use shared) Local profiling shows docker run calls in these 7 files dropped from ~25 to 7 (the 7 are shared_container boots per module + the one test that needs a restart). Each eliminated `docker run` was paying 1-9s of s6 cont-init startup; the replacement `docker exec` calls average 0.10s — an ~50x speedup per operation. Tests that mutate state (restarts, config changes, gateway starts) still use their own containers via `container_name` + `start_container`. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| conftest.py | ||
| profiling.py | ||
| test_config_migration.py | ||
| test_container_restart.py | ||
| test_dashboard.py | ||
| test_docker_exec_privilege_drop.py | ||
| test_dump_build_sha.py | ||
| test_gateway_bootstrap_state.py | ||
| test_gateway_run_supervised.py | ||
| test_home_override_scripts.py | ||
| test_immutable_install.py | ||
| test_immutable_install_permissions.py | ||
| test_license_file_present.py | ||
| test_log_dir_seed.py | ||
| test_main_invocation.py | ||
| test_profile_gateway.py | ||
| test_puid_pgid_remap.py | ||
| test_s6_profile_gateway_integration.py | ||
| test_smoke.py | ||
| test_stage2_browser_discovery.py | ||
| test_tini_compat_shim.py | ||
| test_toplevel_chown.py | ||
| test_tui_passthrough.py | ||
| test_tui_prebuilt_bundle.py | ||
| test_user_flag_guard.py | ||
| test_zombie_reaping.py | ||