Skip to content

Split oversized basectl BATS suites by subcommand area #293

@codeforester

Description

@codeforester

Finding

The main BATS coverage for basectl has grown into two very large files:

  • cli/bash/commands/basectl/tests/basectl.bats is roughly 1,900 lines and covers help, gh, onboard, update, default runtime shell behavior, projects, test, clean, doctor, activate, wrapper dispatch, launchers, runtime prompt, and baserc behavior.
  • cli/bash/commands/basectl/tests/setup.bats is roughly 1,840 lines and covers setup/check/update-profile behavior, completions, shell startup, JSON output, notifications, test overrides, and profile config.

The tests are valuable, but the file boundaries no longer match the command boundaries. This makes focused changes harder to review and increases the chance that unrelated fixtures remain coupled.

Proposed direction

Split BATS coverage by subcommand or behavior area, for example:

  • gh.bats
  • onboard.bats
  • update.bats
  • projects.bats
  • test.bats
  • clean.bats
  • doctor.bats
  • activate.bats
  • setup.bats
  • check.bats
  • update-profile.bats
  • runtime-shell.bats
  • completions.bats

Move shared helpers into a common test helper file rather than duplicating setup logic.

Acceptance criteria

  • No single basectl BATS file remains a catch-all for unrelated subcommands.
  • Shared helpers are centralized and still easy to understand.
  • bin/base-test continues to run the complete BATS suite.
  • Existing BATS assertions pass without behavior changes.

Parent audit: #287

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions