beads/cmd/bd/protocol/status_validation_test.go
quartz 801965ae2d feat(test): parallelize protocol tests for 3x speedup (bd-dgp)
Add t.Parallel() to all 45 top-level test functions in cmd/bd/protocol.
Each test already creates a fully isolated workspace (unique Dolt prefix,
temp dir, git repo) so parallelization is safe. Reduces test time from
~135s to ~42s on the same machine.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Executed-By: beads/polecats/quartz
Rig: beads
Role: polecats
2026-02-27 20:04:00 -08:00

44 lines
1.2 KiB
Go

package protocol
import (
"strings"
"testing"
)
// TestProtocol_UpdateRejectsGarbageStatus verifies that bd update --status
// with an invalid status value exits non-zero.
func TestProtocol_UpdateRejectsGarbageStatus(t *testing.T) {
t.Parallel()
w := newWorkspace(t)
id := w.create("Test issue")
out, code := w.runExpectError("update", id, "--status", "bogus")
if code != 1 {
t.Errorf("expected exit code 1, got %d", code)
}
if !strings.Contains(out, "invalid status") {
t.Errorf("expected 'invalid status' in output, got: %s", out)
}
}
// TestProtocol_UpdateAcceptsBuiltinStatuses verifies that built-in status
// values are accepted without error.
func TestProtocol_UpdateAcceptsBuiltinStatuses(t *testing.T) {
t.Parallel()
w := newWorkspace(t)
id := w.create("Test issue")
w.run("update", id, "--status", "in_progress")
w.run("update", id, "--status", "open")
}
// TestProtocol_UpdateAcceptsCustomStatus verifies that custom statuses
// configured via bd config are accepted by update.
func TestProtocol_UpdateAcceptsCustomStatus(t *testing.T) {
t.Parallel()
w := newWorkspace(t)
id := w.create("Test issue")
w.run("config", "set", "status.custom", "awaiting_review,testing")
w.run("update", id, "--status", "awaiting_review")
}