test(docker): align Dockerfile contract tests with simplified TUI flow - #19024
Closed
Sanjays2402 wants to merge 1 commit into
Closed
test(docker): align Dockerfile contract tests with simplified TUI flow#19024Sanjays2402 wants to merge 1 commit into
Sanjays2402 wants to merge 1 commit into
Conversation
The Dockerfile dropped the manual `@hermes/ink` materialisation gymnastics
in favour of letting npm workspaces resolve the bundled package
naturally. Two contract tests still asserted the older flow:
`test_dockerfile_installs_tui_dependencies` required:
'ui-tui/packages/hermes-ink/package-lock.json' in dockerfile_text
…but the lockfile is no longer COPIED individually \u2014 the entire
`ui-tui/packages/hermes-ink/` tree is COPIED instead (the workspace
reference from `ui-tui/package.json` is `file:` so npm needs the
real source, not just a manifest stub).
`test_dockerfile_materializes_local_tui_ink_package` required a 7-clause
conjunction matching specific `rm -rf` / `npm install --omit=dev`
`--prefix node_modules/@hermes/ink` / `rm -rf .../react` invocations
that were stripped out when the workspace resolution was simplified.
Update the assertions to pin the *contract* the image actually has to
carry rather than the *exact shell incantations* the old flow used:
* TUI deps install: ui-tui/package.json + ui-tui/package-lock.json +
ui-tui/packages/hermes-ink/ tree are all COPIED, and an npm
install/ci step runs in ui-tui.
* Bundled hermes-ink: the workspace package source is COPIED (so
`await import('@hermes/ink')` resolves at runtime).
This keeps the spirit of NousResearch#15012 / NousResearch#16690 (zombie reaping + bundled
workspace materialisation must continue to work) without locking the
Dockerfile into one specific implementation flavour.
Validation:
$ pytest tests/tools/test_dockerfile_pid1_reaping.py -q
6 passed in 1.43s
No production code change. Fixes the two failures observed on `main`
(run 25250051126):
`tests/tools/test_dockerfile_pid1_reaping.py::test_dockerfile_installs_tui_dependencies`
`tests/tools/test_dockerfile_pid1_reaping.py::test_dockerfile_materializes_local_tui_ink_package`
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.
Summary
Fixes two
Testsfailures observed onmain(and therefore propagating to every open PR):Reference run: 25250051126 on
5d3be898a.Root cause
The Dockerfile dropped the manual
@hermes/inkmaterialisation gymnastics in favour of letting npm workspaces resolve the bundled package naturally. Two contract tests still asserted the older flow.test_dockerfile_installs_tui_dependenciesrequired:…but the lockfile is no longer
COPY'd individually — the entireui-tui/packages/hermes-ink/tree isCOPY'd instead (the workspace reference fromui-tui/package.jsonisfile:so npm needs the real source, not just a manifest stub).test_dockerfile_materializes_local_tui_ink_packagerequired a 7-clause conjunction matching very specificrm -rf/npm install --omit=dev/--prefix node_modules/@hermes/ink/rm -rf .../reactinvocations that were stripped out when the workspace resolution was simplified.Fix
Pin the contract the image has to satisfy (zombie reaping + bundled workspace package resolves) rather than the exact shell incantations the old flow used:
ui-tui/package.json+ui-tui/package-lock.json+ui-tui/packages/hermes-ink/tree are allCOPY'd, and annpm install/cistep runs inui-tui.COPY'd (soawait import('@hermes/ink')resolves at runtime).Keeps the spirit of #15012 (zombie reaping) / #16690 (bundled workspace materialisation) without locking the Dockerfile into one specific implementation flavour.
Validation
Scope
Out of scope
The other ~9 main-CI failures — separate focused PRs (#18972, #18974, #18977, #18979 already up; #18980 dotenv inbound; this one is the next).