test(selfhost): cover env_get and require_cmd in selfhost-deploy-common - #7915
test(selfhost): cover env_get and require_cmd in selfhost-deploy-common#7915davion-knight wants to merge 1 commit into
Conversation
selfhost-deploy-common.test.ts covered only maybe_infisical_run, env_put, and compose_file_args (the last two added by their own bug-fix PRs). env_get and require_cmd -- both sourced by 5 deploy/verify scripts -- had no test seam, the same structural gap that let two other bugs in this file ship unnoticed. Add tests following the file's existing source-and-invoke harness: - env_get: reads an existing key, strips surrounding quotes, ignores comment/blank lines and matches the key exactly (not as a prefix), and returns non-zero for a missing key or missing file. - require_cmd: succeeds silently for a command on PATH, and exits non-zero with an actionable 'required command not found' error otherwise. Test-only; no change to the shell library. Closes JSONbored#7769
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-21 17:44:25 UTC
Review summary Nits — 3 non-blocking
CI checks failing
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionPartially addressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests (1), validate-tests (2), validate-tests (3))). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Problem
test/unit/selfhost-deploy-common.test.tscovered onlymaybe_infisical_run— and, via their own recently-merged bug-fix PRs,env_put(#7766) andcompose_file_args(#7765). The remaining two functions inscripts/lib/selfhost-deploy-common.sh—env_getandrequire_cmd, both sourced by 5 deploy/verify scripts — had no test seam at all, the same structural gap that let two other bugs in this file ship unnoticed.Per #7769's scope note, this adds only the remaining coverage (
env_get,require_cmd);env_put/compose_file_argsare already covered by their companion fixes and aren't duplicated.Tests
Following the file's existing source-and-invoke harness (
spawnSync("bash", …)sourcing the lib):env_get— reads an existing key's value; strips surrounding single/double quotes; ignores comment/blank lines and matches the key exactly (aFOOBAR=line does not satisfyenv_get FOO); returns non-zero for a missing key and for a missing file.require_cmd— succeeds silently for a command on PATH; exits non-zero with the actionablerequired command not found: <cmd>error otherwise (asserting execution does not continue past it).Notes
Test-only — no change to the shell library.
scripts/**andtest/**are both outside Codecov's scope, so there's nocodecov/patchobligation; the file's 18 tests (11 existing + 7 new) all pass and roottypecheckis clean.Closes #7769