diff --git a/changelog.d/3113-cli-test-verbose-tree.fixed.md b/changelog.d/3113-cli-test-verbose-tree.fixed.md new file mode 100644 index 0000000000..361f0e95b1 --- /dev/null +++ b/changelog.d/3113-cli-test-verbose-tree.fixed.md @@ -0,0 +1 @@ +- `wheels test --verbose` (and `-v`, in any flag position) now actually prints the per-spec bundle → suite → spec tree: the test command honors the runtime `verboseEnabled` signal LuCLI passes through `init()`, since the launcher consumes the `--verbose`/`-v` token globally and it never reaches the module's own parser; requires a CLI binary built on a LuCLI runtime that preserves the flag across the module-shortcut re-dispatch (#3113) diff --git a/cli/lucli/Module.cfc b/cli/lucli/Module.cfc index 567a2dd618..1832497f6f 100644 --- a/cli/lucli/Module.cfc +++ b/cli/lucli/Module.cfc @@ -741,7 +741,7 @@ component extends="modules.BaseModule" { var filter = opts.filter; var reporter = opts.reporter; var format = opts.format; - var verboseOutput = opts.verbose; + var verboseOutput = $resolveTestVerbosity(opts.verbose); var ciMode = opts.ci; var coreTests = opts.core; var db = opts.db; @@ -769,6 +769,25 @@ component extends="modules.BaseModule" { return runTests(filter, reporter, format, verboseOutput, coreTests, db, ciMode, useTestDB, dbExplicit, basePath); } + /** + * Resolve the effective verbose flag for `wheels test`. The LuCLI picocli + * root defines `-v`/`--verbose` as GLOBAL options and consumes them + * wherever they appear on the command line — `wheels test --verbose` + * forwards only `test` to the module (verified live, issue #3113), so + * `parseTestArgs()` can never see the token on a normal install. The + * runtime conveys the flag through `init(verboseEnabled=...)` instead + * (LuCLI's executeModule.cfs passes `verboseEnabled=verbose`), which + * BaseModule stores as `variables.verboseEnabled`. Honor both sources: + * the parsed token still wins for direct/programmatic invocations that + * deliver it. + * + * Public `$`-prefixed so specs can exercise it (cli/CLAUDE.md carve-out); + * hidden from MCP by the `mcpHiddenTools()` structural sweep. + */ + public boolean function $resolveTestVerbosity(boolean parsedVerbose = false) { + return arguments.parsedVerbose || (variables.verboseEnabled ?: false); + } + /** * Normalize a short filter name to a path the test runner's directory * regex will accept. App mode prepends `tests.specs.`; core mode diff --git a/cli/lucli/tests/specs/commands/TestCommandSpec.cfc b/cli/lucli/tests/specs/commands/TestCommandSpec.cfc index 88bba43551..809dd78e70 100644 --- a/cli/lucli/tests/specs/commands/TestCommandSpec.cfc +++ b/cli/lucli/tests/specs/commands/TestCommandSpec.cfc @@ -428,6 +428,29 @@ component extends="wheels.wheelstest.system.BaseSpec" { }); + // The LuCLI picocli root defines -v/--verbose as GLOBAL options and + // consumes them wherever they sit on the command line, so the token + // never reaches parseTestArgs() ("wheels test --verbose" forwards only + // "test" to the module — verified live in issue 3113). The runtime + // conveys the flag through init(verboseEnabled=...) instead, and + // test() must honor it for --verbose to have any observable effect. + describe("$resolveTestVerbosity (--verbose / -v consumed by the LuCLI root, issue 3113)", () => { + + it("is false for a plain run", () => { + expect(mod.$resolveTestVerbosity(false)).toBeFalse(); + }); + + it("honors the runtime verboseEnabled flag set by a root-consumed --verbose / -v", () => { + var vmod = new cli.lucli.Module(cwd = variables.tempRoot, verboseEnabled = true); + expect(vmod.$resolveTestVerbosity(false)).toBeTrue(); + }); + + it("honors a --verbose token that does reach the module's own parser", () => { + expect(mod.$resolveTestVerbosity(true)).toBeTrue(); + }); + + }); + } /** diff --git a/web/sites/guides/src/content/docs/v4-0-0/command-line-tools/wheels-commands/testing.mdx b/web/sites/guides/src/content/docs/v4-0-0/command-line-tools/wheels-commands/testing.mdx index 8dcf8a80e1..be4ae24edd 100644 --- a/web/sites/guides/src/content/docs/v4-0-0/command-line-tools/wheels-commands/testing.mdx +++ b/web/sites/guides/src/content/docs/v4-0-0/command-line-tools/wheels-commands/testing.mdx @@ -58,7 +58,7 @@ A bare positional argument is treated as the filter directory — `wheels test m | `--directory=