Skip to content

scripts/lib/selfhost-deploy-common.sh: 3 of 4 functions have zero test coverage #7769

Description

@JSONbored

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

  • env_get covered by new tests in test/unit/selfhost-deploy-common.test.ts.
  • compose_file_args covered (success and missing-file cases), if not already covered by the companion exit-swallow bug-fix issue.
  • require_cmd covered (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.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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions