Repository navigation
test: isolate the subprocess tests from the developer's LuCLI home - #28
Conversation
ModuleArgBindingTest and McpCommandTest installed their fixture modules into LucliPaths' modules dir (the real ~/.lucli/modules by default) and spawned dev-lucli.sh without passing a home. The child resolved its own home from the account's user.home, so mvn test compiled the fixtures into the real ~/.lucli/lucee-server, and with an isolated test home the child couldn't find the fixtures (17 failures). Each class now has a static @tempdir LuCLI home: the fixture is installed there and every child gets it as LUCLI_HOME. Adds childRunsInTheTemporaryLucliHome, which fails when the child runs in any other home. Fixes #25 Upstream: cybersonic#144 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
Unit Tests (ubuntu-latest, Java 21) 65 files 65 suites 2m 29s ⏱️ Results for commit 3b79b9c. |
Integration Tests (ubuntu-latest, Java 21)78 tests 78 ✅ 2m 1s ⏱️ Results for commit 3b79b9c. |
|
rev1-r3 review @ 3b79b9c: APPROVE (final) RED/GREEN in a clean home. I ran
The base failures are exactly the 17 known clean-home failures from #25, and this PR removes all of them. No writes to the real home: Code (test-only):
Note, not blocking: each class now builds a fresh Lucee context on its first child run, so locally the two classes took about 49 s and 28 s instead of about 11 s each. That's a fair price for hermetic tests. PR CI: 8 pass (Build ×3, Unit ×3, Integration ×2); APT smoke skipped. mergeStateStatus is CLEAN. Ready to merge. |
- pom.xml version 0.6.2.3 (the Windows file/product version follows
${project.version}); install-validation default 0.6.2.3.
- FORK.md: 'Next queue' becomes the 0.6.2.3 queue (rows 8-15: #19,
#21-#24, #26-#28), with the row-8 compatibility note (Wheels 4.1.x
stays at max 0.6.2.2: no __lucliMcpCall handling), and a new empty
Next queue.
- CHANGELOG unchanged: fork entries stay under Unreleased, as for
0.6.2.2.
Sandboxed mvn test (-Duser.home only): 788 run, 0 failures.
Signed-off-by: Peter Amiri <peter@alurium.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Fixes #25 (upstream: cybersonic#144)
What
ModuleArgBindingTestandMcpCommandTestinstalled their fixture modules intoLucliPaths.resolve().modulesDir(), which is the real~/.lucli/modulesby default. They then spawneddev-lucli.shwithout passing a home, so the child resolved its own home from the account'suser.home. That caused two problems:mvn testcompiled the fixtures into the real~/.lucli/lucee-server.Each class now has a static
@TempDirLuCLI home. The fixture is installed there, and every child process gets that home asLUCLI_HOMEthrough a smalllucliProcess(...)helper.LUCLI_HOMEalso moves the child's Lucee context (configureLuceeDirectories), so nothing goes to~/.lucli. Only test code changes.Tests
ModuleArgBindingTest.childRunsInTheTemporaryLucliHome: asserts that the child created itslucee-serverunder the temporary home. RED: with the child pointed at a different home, it fails with "the child must create its Lucee context under LUCLI_HOME".mvn test -DargLine="-Duser.home=<empty dir>"withLUCLI_HOMEunset: 788 tests, 0 failures (before: 17 failures).~/.luclihad no files newer than the run's start. The child ran with the realuser.home, so this checks the child, not just the test JVM.🤖 Generated with Claude Code