CLAUDE.md: the two other prerequisites for local integration tests - #576
Merged
Merged
Conversation
The note said only that no js-controller may be running. Two more conditions are just as binding, and each costs a failed run to discover - three, in the case I hit while working on #295. - The checkout directory has to be named `ioBroker.sql`. setup.js derives `appName` and `adapterName` from the path and then looks up `system.adapter.${adapterName.split('.').pop()}.0`, so a worktree in `my-branch/` asks npm for `my-branch.js-controller` and one in `iobroker.sql-295/` looks for `system.adapter.sql-295.0` and dies in the `before` hook with "Cannot read properties of undefined (reading 'common')". - `node_modules` must be a real directory, not a junction. copyAdapterToController() copies the whole folder into `tmp/node_modules/` without excluding `node_modules`, so the recursive copy walks into the link and leaves a half-copied adapter. Also notes that the port 9000 guard exits with `process.exit(0)`, so a run it blocks reports success - mocha exits 0 having executed nothing, which is easy to read as a green run. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
CLAUDE.mdsaid only that no js-controller may be running. Two more conditions are just as binding, and each costs a failed run to discover — it took me three while working on #295, all of them setup rather than code.The directory name decides the adapter name
test/lib/setup.jsderives both names from the path:_wt_295/npm install _wt_295.js-controller@dev→ npm rejects a name starting with_iobroker.sql-295/system.adapter.sql-295.0, which does not exist → thebeforehook dies withCannot read properties of undefined (reading 'common')<anything>/ioBroker.sqlThe last one is the useful part: a worktree is fine as long as its leaf directory is
ioBroker.sql.node_modulesmust not be a junctioncopyAdapterToController()copies the whole adapter folder intotmp/node_modules/, and its exclusion list (.idea,test,tmp,.git,src-admin,<app>.js-controller) does not mentionnode_modules. The recursive copy therefore walks into it, and with a link it leaves a half-copied adapter behind — the failure surfaces later, somewhere else entirely.npm installin the worktree takes about 20 s. Linkingtmp/from another checkout is fine and saves the js-controller download.And the port 9000 guard reports success
The existing note now also says that the guard calls
process.exit(0). A run it blocks exits 0 having executed nothing, which reads exactly like a green run — that is how it looked to me at first.Documentation only.
🤖 Generated with Claude Code