Repository navigation
Description
Summary
The test suite isn't isolated from the developer's own LuCLI home. Two problems have the same cause:
mvn testwrites into the real~/.lucli.ModuleArgBindingTestinstalls itstypedbindfixture intoLucliPaths.resolve().modulesDir()(the real~/.lucli/modulesby default). It removes the folder afterwards, but Lucee's compiled classes for it, and forMcpCommandTest'smcpfixture, stay in~/.lucli/lucee-server/.../cfclasses. The run also updates the real home's Lucee context logs and felix-cache.- The suite fails in a clean home. With the test JVM's home pointed at an empty directory (
mvn test -DargLine="-Duser.home=<empty dir>",LUCLI_HOMEunset), these tests fail (17 = 12 failures + 5 errors; the same set on the branch with fix(home): REPL history and settings follow LUCLI_HOME #22 merged):
cli.commands.McpCommandTest.declaredMarkerParameterIsNeverBoundFromATerminalPositionalcli.commands.McpCommandTest.failedToolPreservesReportAndRestoresCaptureForNextCallcli.commands.McpCommandTest.falseHelpArgumentsDoNotHijackMcpToolCallscli.commands.McpCommandTest.terminalInvocationNeverCarriesTheMcpMarkercli.commands.McpCommandTest.toolCallCapturesOutStreamIntoResponseBodycli.commands.McpCommandTest.toolsCallCarriesARuntimeOwnedMcpMarkercli.commands.McpCommandTest.toolsListExcludesBaseModuleInternalscli.commands.McpCommandTest.toolsListHonorsMcpHiddenToolsDeclarationcli.commands.McpCommandTest.toolsListUsesModuleDeclaredInputSchemacli.commands.ModuleArgBindingTest.clusteredRootFlagsAndAttachedValuesPreserveModuleTimeoutcli.commands.ModuleArgBindingTest.enabledHelpFlagsStillShowModuleHelpcli.commands.ModuleArgBindingTest.falseHelpFlagsRunTheRequestedCommandcli.commands.ModuleArgBindingTest.moduleTimeoutValuesReachTheModuleInsteadOfTheRootParsercli.commands.ModuleArgBindingTest.namedArgBeatsPositionalcli.commands.ModuleArgBindingTest.singlePositionalLeavesOptionalAtDefaultcli.commands.ModuleArgBindingTest.timeoutBeforeTheModuleRemainsARootOptioncli.commands.ModuleArgBindingTest.twoPositionalArgsBindToTypedParams
Cause
These tests install their fixture module into the test JVM's LuCLI home, then spawn dev-lucli.sh as a subprocess (ProcessBuilder) without passing that home. So the child resolves its own home from the account's user.home.
- With the default home, both sides are the real
~/.lucli: the tests pass, but they write into it. - With an isolated test home, the two differ: the child can't find the fixture, and the tests fail.
Possible fix
Give each of these test classes a temporary LUCLI_HOME (e.g. a @TempDir), install the fixture there, and pass it to the child via pb.environment().put("LUCLI_HOME", …) (and/or -Dlucli.home). The suite then never touches the developer's home, and it passes in a clean one.
Tested on: wheels-dev/LuCLI wheels @ 8942048 (17 failures; the extra McpCommandTest cases are fork patches). Upstream has the same issue on main (cybersonic#144).
Activity
test: isolate the subprocess tests from the developer's LuCLI home (#28)