From 022cab0dbb3c655f102983a49fb2144153551d70 Mon Sep 17 00:00:00 2001 From: Molecule AI SDK-Dev Date: Mon, 11 May 2026 03:15:47 +0000 Subject: [PATCH] =?UTF-8?q?docs(cli):=20update=20KI-005=20=E2=80=94=20test?= =?UTF-8?q?s=20now=20exist=20(32=20integration=20tests)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit known-issues.md claimed "There are no tests at all" but cmd/molecule/ molecule_test.go ships 32 table-driven integration tests covering the full CLI command surface (workspace CRUD, agent ops, delegation, config, completion, error paths). Mark KI-005 as resolved. Co-Authored-By: Claude Opus 4.7 --- known-issues.md | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/known-issues.md b/known-issues.md index 71d4e69..9ea8147 100644 --- a/known-issues.md +++ b/known-issues.md @@ -130,24 +130,29 @@ is set to `.` (repo root) since the main package is at `cmd/molecule`. ## KI-005 — No integration test for the full CLI lifecycle -**File:** `tests/` (does not exist) -**Status:** Not yet implemented +**File:** `cmd/molecule/molecule_test.go`, `internal/` +**Status:** ✅ Resolved **Severity:** Medium -### Symptom -There are no tests at all (per `go test ./...` — no packages match). -As subcommands are built, there is no test harness for end-to-end CLI testing -(e.g. `molecule workspace create --name test --output json` → verify JSON output). +### Resolution +`cmd/molecule/molecule_test.go` contains 32 table-driven integration tests +covering the full CLI command surface. Each test: +- Starts a `httptest.Server` that mirrors the platform REST API (workspace CRUD, + agent inspection, delegation, health, audit, config, completion scripts). +- Builds the `molecule` binary via `go build -o /molecule .` +- Executes it with `exec.Command` and validates stdout/stderr output. -### Impact -Each subcommand will be shipped without regression protection. Manual testing -is required for every release. The absence of a `tests/` directory also means -there is no fixture for CLI integration testing with recorded API responses. +Test coverage includes: +- Root help, workspace/agent/platform/config help +- `workspace list`, `workspace inspect`, `workspace create`, `workspace delete`, + `workspace restart`, `workspace audit`, `workspace delegate` +- `agent list`, `agent inspect`, `agent send`, `agent peers` +- `platform health`, `platform audit` +- `config init`, `config list` +- `init`, `init --force` +- `completion bash/zsh/fish/powershell` +- Error paths: missing workspace, missing agent, unknown subcommand, + missing required args, duplicate init -### Suggested fix -Add `tests/` with: -- `cmd/molecule/molecule_test.go` — table-driven tests for each subcommand - using `exec.Command("molecule", ...)` against a built binary -- Use `molecule-sdk-python` fixture server or recorded API responses for - offline testing -- Add `go test ./...` to CI; require >0 test packages before merge +Run `go test ./...` from the repo root to execute. No live platform required — +all tests use `httptest.Server` fixtures.