Skip to content

test(cli): add TestBox test suite for LuCLI module#2093

Merged
bpamiri merged 13 commits intodevelopfrom
peter/cli-testing
Apr 12, 2026
Merged

test(cli): add TestBox test suite for LuCLI module#2093
bpamiri merged 13 commits intodevelopfrom
peter/cli-testing

Conversation

@bpamiri
Copy link
Copy Markdown
Collaborator

@bpamiri bpamiri commented Apr 11, 2026

Summary

Adds a TestBox BDD test suite for the CLI module services and commands, integrated into the CI pipeline.

  • 70 tests across 8 spec files covering Helpers, Destroy, Doctor, Stats, Admin, CodeGen services + DB Commands and Introspect integration
  • Tests run via /wheels/cli/tests?format=json route, reusing the same server instance as core tests
  • Temp project scaffolding copies project skeleton for isolated testing — no tests modify the real project
  • Integration tests skip gracefully when no server is running
  • CI pipeline updated to run both core (2740 tests) and CLI (70 tests) suites with separate JUnit artifacts

Test coverage

Spec Tests Category
HelpersSpec 17 Unit — pluralize, singularize, capitalize
DestroySpec 10 Unit — file deletion, route cleanup, migration gen
DoctorSpec 7 Unit — health checks, CRITICAL/WARNING/HEALTHY
StatsSpec 8 Unit — LOC counting, annotation extraction
AdminSpec 15 Unit — form helpers, template gen, route injection
CodeGenSpec 6 Unit — model/controller generation
DbCommandsSpec 3 Integration — dbStatus, dbVersion endpoints
IntrospectSpec 4 Integration — model introspection endpoint

Bug fixes found during testing

  • Helpers.cfc: reFindNoCase vs reFind — case-sensitive regex needed for uppercase detection in pluralize/singularize
  • Admin.cfc: Use tableName from introspection data for consistent path derivation
  • Doctor.cfc: Add recommendation for missing tests directory

Test plan

  • All 70 CLI tests pass locally
  • All 2740 core tests still pass (no regressions)
  • CI pipeline runs both suites with separate result artifacts

🤖 Generated with Claude Code

bpamiri and others added 9 commits April 11, 2026 18:16
Tests for Admin.generateAdmin() (controller + 5 views, form column filtering,
FK loaders, route injection, force flag, noRoutes flag) and form helper type
mapping covered indirectly via generated _form.cfm content (mapColumnToFormHelper
is private).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add /wheels/cli/tests route, clitests view, Public.cfc handler, and
/cli mapping so TestBox can discover cli.lucli.tests.specs.
Remove standalone runner.cfm approach (Wheels Application.cfc
intercepts all requests).
…li tests

- fix reFindNoCase -> reFind for uppercase detection in Helpers.cfc pluralize/singularize,
  preventing case-insensitive match from corrupting all-lowercase words like "user"
- scaffold temp project with all required dirs, config files, placeholder migration and
  test spec so Doctor health checks report HEALTHY instead of CRITICAL
- fix TestHelper to avoid cfscript/tag parser confusion in string literals
- add recommendation for missing tests/ directory in Doctor.buildRecommendations
- use modelData.tableName for Admin view/controller paths to match spec expectations
- fix CodeGenSpec: pass array for actions param, add required type to validateName
- fix AdminSpec: rename form -> formContent to avoid CFML form scope collision
- fix DoctorSpec: use < 10 char content to trigger routes.cfm minimal warning

Result: 70/70 CLI tests pass (was 37 pass, 14 fail, 19 error)
@bpamiri bpamiri force-pushed the peter/cli-testing branch from 65562e8 to 1260a16 Compare April 12, 2026 01:17
@bpamiri bpamiri merged commit b838d0e into develop Apr 12, 2026
3 checks passed
@bpamiri bpamiri deleted the peter/cli-testing branch April 12, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant