Repository navigation
Stop the environment-gated test scripts depending on sh - #16
Merged
Merged
Conversation
Three scripts were written in shell that only one shell speaks. pnpm hands a
script body to /bin/sh on POSIX and to cmd.exe on Windows, and what sh reads as
syntax cmd.exe reads as text.
`VAR=1 command` is the loud one: cmd.exe has no such form and looks for a
program named `HYPIT_BROWSER_TESTS=1`. It fails where you can see it.
The quoted discovery pattern is the quiet one, and it is the same defect this
repository already found in its main suite. sh strips the quotes and unittest
receives `test_*.py`; cmd.exe does not, and unittest receives six characters
that match no file. Both exit 0:
-p 'test_*.py' stripped Ran 11 tests OK exit 0
-p 'test_*.py' literal Ran 0 tests NO TESTS RAN exit 0
Double quotes are stripped by both shells, so the pattern needs no runner —
only the right quote. The two environment gates move into the runner that
already exists for this, as named suites, where they are assignments rather
than syntax. That also settles the third defect: the OpenCV script named the
POSIX interpreter path outright, though `deployment.ts` has branched on the
platform for that venv all along.
An environment already set by the caller still wins. These are defaults for
running a suite, not a policy about it.
Co-Authored-By: Claude <[email protected]>
overlordkim
pushed a commit
that referenced
this pull request
Sep 9, 2026
Stop the environment-gated test scripts depending on sh
overlordkim
pushed a commit
that referenced
this pull request
Sep 9, 2026
Stop the environment-gated test scripts depending on sh
This was referenced Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three scripts were written in shell that only one shell speaks. pnpm hands a script body to
/bin/shon POSIX and tocmd.exeon Windows, and whatshreads as syntaxcmd.exereads as text. None of the three run in CI, so nothing would have reported this.The loud one
VAR=1 commandis POSIX shell.cmd.exehas no such form and looks for a program namedHYPIT_BROWSER_TESTS=1. It fails where you can see it, which makes it the harmless one.The quiet one
The same defect this repository already found in its main suite, in a second place.
shstrips the quotes around the discovery pattern and unittest receivestest_*.py;cmd.exedoes not, and unittest receives six characters that match no file. Measured locally:Both exit 0. On Windows this script would report success having run nothing — exactly what
node --testdoes with a glob that matches nothing.Double quotes are stripped by both shells, so this one needs no runner, only the right quote.
The third
test:image-opencvalso named the POSIX interpreter path outright —services/image-opencv/.venv/bin/python, where Windows puts.venv\Scripts\python.exe.provider-image-opencv-local/src/deployment.tshas branched on the platform for that venv all along; only the script bypassed it.What changed
The two environment gates move into
test/run.mjs, which already exists for this class of problem, as named suites —node test/run.mjs browser-visualandnode test/run.mjs image-opencv— where the gates are assignments rather than shell syntax and the venv path is a platform branch in JS. An environment already set by the caller still wins: these are defaults for running a suite, not a policy about it. An unknown suite name is refused rather than silently running everything.The testing guide listed
HYPIT_OPENCV_TESTS=1andHYPIT_OPENCV_PYTHONas prerequisites the reader supplies; the script supplies them now, so both language versions say what is actually still required.Verification
pnpm check,pnpm test(544, 0 failures),pnpm test:release(8),pnpm test:whisperx-service(11),pnpm test:browser-visual(12 against a real browser) all pass.pnpm test:image-opencvreports 2 passed and 2 skipped here, the skips being the live tests with no venv present.node test/run.mjs nopeexits 2.🤖 Generated with Claude Code