Skip to content

feat: add basectl workspace test to run tests across all managed workspace projects #2104

Description

@codeforester

Problem

basectl test <project> works well for per-project test execution, but there is no workspace-level equivalent. Validating a cross-repo change (e.g., a shared library update affecting multiple downstream projects) requires developers to loop manually across repos or write a one-off shell script.

The workspace manifest already has complete knowledge of which repos are managed and what test commands they declare — this knowledge is currently unused at the workspace level.

Proposed solution

Add basectl workspace test [options] that:

  1. Reads the workspace manifest to discover all managed projects.
  2. For each project (or a filtered subset), runs the project's declared test command from base_manifest.yaml.
  3. Emits per-project pass/fail results in the same structured format as workspace check --format json.

Proposed interface

basectl workspace test                          # run tests for all workspace projects
basectl workspace test --projects proj1,proj2  # run tests for specified projects only
basectl workspace test --fail-fast             # stop on first project failure
basectl workspace test --format json           # structured JSON output

Execution model

  • Serial execution by default (consistent with docs/check-parallelism.md — predictable output, no interleaved logs).
  • Each project's test command runs in the project directory with its environment activated (same as basectl test <project>).
  • Summary at end: N passed, M failed, K skipped (no test command declared).

Acceptance criteria

  • basectl workspace test is implemented as a new workspace subcommand.
  • Runs declared test_commands for each managed project in the workspace manifest.
  • --projects filter selects a subset of projects by name.
  • --fail-fast stops after the first failing project.
  • --format json emits structured output consistent with other workspace JSON outputs.
  • Projects with no test_commands declared are skipped with a skip notice (not an error).
  • Command is registered in docs/stability-tiers.md (Experimental initially).
  • Help text and .ai-context/COMMANDS.md updated.
  • Integration tests covering: all-pass, one-fail, fail-fast, --projects filter, skipped (no test command).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or product improvement

Type

No type

Projects

  • Status
    Backlog

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions