Context
test/unit/selfhost-deploy-common.test.ts only covers maybe_infisical_run. env_get, env_put, compose_file_args, and require_cmd — the functions actually responsible for two other bugs already filed against this file (the compose_file_args exit-swallow and env_put non-atomic-write issues) going undetected — have no test seam at all, despite being sourced by 5 different deploy/verify scripts (deploy-selfhost-image.sh, deploy-selfhost-prebuilt.sh, selfhost-post-update-check.sh, selfhost-post-update-regression-gate.sh, and transitively others). This is the same structural gap class as this repo's own recently-closed "lint-composite-actions.mjs has no unit-test seam" issue, applied to a different shared script library.
Requirements
Add test coverage for env_get, compose_file_args, and require_cmd in test/unit/selfhost-deploy-common.test.ts, following the existing maybe_infisical_run tests' structure/harness in the same file. (If the companion compose_file_args/env_put bug-fix issues are picked up separately, their own regression tests may already satisfy part of this — check before duplicating; this issue's scope is the remaining coverage, not re-testing what those issues already cover.)
Deliverables
Test Coverage Requirements
This is the test-coverage deliverable — match maybe_infisical_run's existing test structure/harness in the same file.
Expected Outcome
All 4 functions in scripts/lib/selfhost-deploy-common.sh have real unit-test coverage, closing the structural gap that let two other bugs in this file ship unnoticed.
Links & Resources
test/unit/selfhost-deploy-common.test.ts (existing partial coverage), scripts/lib/selfhost-deploy-common.sh (the library)
Context
test/unit/selfhost-deploy-common.test.tsonly coversmaybe_infisical_run.env_get,env_put,compose_file_args, andrequire_cmd— the functions actually responsible for two other bugs already filed against this file (thecompose_file_argsexit-swallow andenv_putnon-atomic-write issues) going undetected — have no test seam at all, despite being sourced by 5 different deploy/verify scripts (deploy-selfhost-image.sh,deploy-selfhost-prebuilt.sh,selfhost-post-update-check.sh,selfhost-post-update-regression-gate.sh, and transitively others). This is the same structural gap class as this repo's own recently-closed "lint-composite-actions.mjs has no unit-test seam" issue, applied to a different shared script library.Requirements
Add test coverage for
env_get,compose_file_args, andrequire_cmdintest/unit/selfhost-deploy-common.test.ts, following the existingmaybe_infisical_runtests' structure/harness in the same file. (If the companioncompose_file_args/env_putbug-fix issues are picked up separately, their own regression tests may already satisfy part of this — check before duplicating; this issue's scope is the remaining coverage, not re-testing what those issues already cover.)Deliverables
env_getcovered by new tests intest/unit/selfhost-deploy-common.test.ts.compose_file_argscovered (success and missing-file cases), if not already covered by the companion exit-swallow bug-fix issue.require_cmdcovered (present and missing-command cases).Test Coverage Requirements
This is the test-coverage deliverable — match
maybe_infisical_run's existing test structure/harness in the same file.Expected Outcome
All 4 functions in
scripts/lib/selfhost-deploy-common.shhave real unit-test coverage, closing the structural gap that let two other bugs in this file ship unnoticed.Links & Resources
test/unit/selfhost-deploy-common.test.ts(existing partial coverage),scripts/lib/selfhost-deploy-common.sh(the library)