Skip to content

cli: wheels test ignores the subpath setting — add base-path support for subfolder deployments #3026

Description

@bpamiri

Context

Companion to #3025; the small half of the subfolder phase-2 work from discussion #2887 / issue #2968. PR #2985 gave the framework a subpath setting (set(subpath="/myapp") / WHEELS_SUBPATH), so generated URLs and asset paths now work under a URL prefix — but the CLI test command still assumes the app is mounted at the server root.

Problem

  • cli/lucli/Module.cfc:4741var testPath = coreTests ? "/wheels/core/tests" : "/wheels/app/tests"; builds the runner URL with no subfolder segment.
  • cli/lucli/Module.cfc:6819 — second hardcoded http://localhost:#serverPort#/wheels/app/tests?... URL with the same assumption.

For an app mounted at /wheelsproject1 (the six-instance IIS/CommandBox setup in #2887), the CLI requests /wheels/app/tests, which the rewrite layer never routes to the app — wheels test is unusable in that topology.

Proposed direction

  1. Accept an explicit --base-path=/wheelsproject1 flag on wheels test (and the wheels_test MCP tool input), prefixed onto both URL constructions.
  2. When the flag is absent, auto-derive: read WHEELS_SUBPATH from the environment, else scan config/settings.cfm for set(subpath=...) (strip CFML comments first — see Anti-Pattern 14 and the existing stripCfmlComments() helpers). Explicit flag wins over derivation.
  3. Normalize like the framework does (leading slash, no trailing slash — mirror $resolveFrameworkPaths() in vendor/wheels/Global.cfc:2447).

Note the CLI ArgSpec migration context (#2861): implement the new flag via ArgSpec, not the legacy argsFromCollection round-trip, so --base-path=... parses reliably.

Acceptance

Refs #2887. Follow-up to #2985 (phase 1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions