Skip to content

Commit 5d89911

Browse files
bpamiriclaude
andauthored
fix(cli): wheels test --verbose renders the per-spec tree via the runtime verboseEnabled signal (#3168)
* fix(cli): wheels test --verbose renders the per-spec tree via the runtime verboseEnabled signal Signed-off-by: Peter Amiri <peter@alurium.com> * docs(web/guides): document the working wheels test --verbose per-spec tree Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com> --------- Signed-off-by: Peter Amiri <peter@alurium.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent c363194 commit 5d89911

5 files changed

Lines changed: 46 additions & 3 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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)

cli/lucli/Module.cfc

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ component extends="modules.BaseModule" {
741741
var filter = opts.filter;
742742
var reporter = opts.reporter;
743743
var format = opts.format;
744-
var verboseOutput = opts.verbose;
744+
var verboseOutput = $resolveTestVerbosity(opts.verbose);
745745
var ciMode = opts.ci;
746746
var coreTests = opts.core;
747747
var db = opts.db;
@@ -769,6 +769,25 @@ component extends="modules.BaseModule" {
769769
return runTests(filter, reporter, format, verboseOutput, coreTests, db, ciMode, useTestDB, dbExplicit, basePath);
770770
}
771771

772+
/**
773+
* Resolve the effective verbose flag for `wheels test`. The LuCLI picocli
774+
* root defines `-v`/`--verbose` as GLOBAL options and consumes them
775+
* wherever they appear on the command line — `wheels test --verbose`
776+
* forwards only `test` to the module (verified live, issue #3113), so
777+
* `parseTestArgs()` can never see the token on a normal install. The
778+
* runtime conveys the flag through `init(verboseEnabled=...)` instead
779+
* (LuCLI's executeModule.cfs passes `verboseEnabled=verbose`), which
780+
* BaseModule stores as `variables.verboseEnabled`. Honor both sources:
781+
* the parsed token still wins for direct/programmatic invocations that
782+
* deliver it.
783+
*
784+
* Public `$`-prefixed so specs can exercise it (cli/CLAUDE.md carve-out);
785+
* hidden from MCP by the `mcpHiddenTools()` structural sweep.
786+
*/
787+
public boolean function $resolveTestVerbosity(boolean parsedVerbose = false) {
788+
return arguments.parsedVerbose || (variables.verboseEnabled ?: false);
789+
}
790+
772791
/**
773792
* Normalize a short filter name to a path the test runner's directory
774793
* regex will accept. App mode prepends `tests.specs.`; core mode

cli/lucli/tests/specs/commands/TestCommandSpec.cfc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,29 @@ component extends="wheels.wheelstest.system.BaseSpec" {
428428

429429
});
430430

431+
// The LuCLI picocli root defines -v/--verbose as GLOBAL options and
432+
// consumes them wherever they sit on the command line, so the token
433+
// never reaches parseTestArgs() ("wheels test --verbose" forwards only
434+
// "test" to the module — verified live in issue 3113). The runtime
435+
// conveys the flag through init(verboseEnabled=...) instead, and
436+
// test() must honor it for --verbose to have any observable effect.
437+
describe("$resolveTestVerbosity (--verbose / -v consumed by the LuCLI root, issue 3113)", () => {
438+
439+
it("is false for a plain run", () => {
440+
expect(mod.$resolveTestVerbosity(false)).toBeFalse();
441+
});
442+
443+
it("honors the runtime verboseEnabled flag set by a root-consumed --verbose / -v", () => {
444+
var vmod = new cli.lucli.Module(cwd = variables.tempRoot, verboseEnabled = true);
445+
expect(vmod.$resolveTestVerbosity(false)).toBeTrue();
446+
});
447+
448+
it("honors a --verbose token that does reach the module's own parser", () => {
449+
expect(mod.$resolveTestVerbosity(true)).toBeTrue();
450+
});
451+
452+
});
453+
431454
}
432455

433456
/**

web/sites/guides/src/content/docs/v4-0-0/command-line-tools/wheels-commands/testing.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ A bare positional argument is treated as the filter directory — `wheels test m
5858
| `--directory=<dir>` | Alias for `--filter` (tutorial chapter 7). When both are supplied, `--directory` wins. |
5959
| `--db=<engine>` | Database engine for `--core` matrix runs only. Ignored for app tests (with a warning) — see [below](#testing-against-different-engines). |
6060
| `--reporter=<name>` | `simple` (default, colourful), `json` (raw runner JSON), `tap` (TAP v13 for CI consumers). |
61-
| `--verbose`, `-v` | Accepted but currently inert — output is identical to a plain run; no per-spec output is printed for passing specs. Wiring tracked in [#3113](https://github.com/wheels-dev/wheels/issues/3113). |
61+
| `--verbose`, `-v` | Print the full bundle → suite → spec tree (one `[PASS]`/`[FAIL]` line per spec) instead of only the summary line. Applies to the default `simple` reporter. The launcher consumes the flag globally, so any position works (`wheels test --verbose`, `wheels test -v`, `wheels -v test`). CLI binaries built on a LuCLI runtime that predates the [#3113](https://github.com/wheels-dev/wheels/issues/3113) launcher fix drop the signal before it reaches the test command and print the plain summary. |
6262
| `--ci` | CI mode: emits one GitHub Actions `::error` workflow-command annotation per failed or errored spec, so failures surface inline in CI logs and PR-check panels. Exit code is non-zero on failure regardless. |
6363
| `--core` | Run framework self-tests (`vendor/wheels/tests/specs/`) instead of your app suite. App tests are the default; `--core` is the explicit opt-in. |
6464
| `--no-test-db` | Disable the auto-swap to `<datasource>_test`. App tests run against your dev datasource, with whatever data is already in it. |

web/sites/guides/src/content/docs/v4-0-0/testing/ci-integration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ The `wheels test` command accepts a `--reporter=<name>` flag. The CLI always req
7979
| `--reporter=json` | Emits the raw JSON result document — pipe it to `jq` or a post-processor |
8080
| `--reporter=tap` | Emits TAP version 13 (`1..N`, `ok` / `not ok` lines) for TAP-consuming CI tooling |
8181
| `--ci` | Emits one GitHub Actions `::error` workflow-command annotation per failed or errored spec, so failures appear inline in CI logs and PR-check panels. Exit code is non-zero on failure regardless. |
82-
| `--verbose` / `-v` | Accepted but currently inert — output is identical to a plain run; the per-spec tree wiring is tracked in [#3113](https://github.com/wheels-dev/wheels/issues/3113) |
82+
| `--verbose` / `-v` | Prints the full bundle → suite → spec tree (one `[PASS]`/`[FAIL]` line per spec) with the default `simple` reporter; flag position doesn't matter (`wheels -v test` works too). Binaries built on a LuCLI runtime that predates the [#3113](https://github.com/wheels-dev/wheels/issues/3113) launcher fix drop the signal and print the plain summary |
8383

8484
For machine-readable results you can also call the test runner URL directly and post-process the JSON. That is exactly what `tools/ci/run-tests.sh` does in this repo: it `curl`s `/wheels/core/tests?db=sqlite&format=json`, parses the totals in Python, emits a JUnit XML file that `actions/upload-artifact` ingests for the GitHub summary, and fails the build when the payload reports a rejected `directory=` scope or a 0-bundle discovery.
8585

0 commit comments

Comments
 (0)