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
25 lines
683 B
Go
25 lines
683 B
Go
package protocol
|
|
|
|
import "testing"
|
|
|
|
// TestProtocol_StaleRejectsNonPositiveDays asserts that bd stale rejects
|
|
// --days values less than 1. Zero and negative days are nonsensical for
|
|
// a staleness check and should fail with a non-zero exit code.
|
|
func TestProtocol_StaleRejectsNonPositiveDays(t *testing.T) {
|
|
t.Parallel()
|
|
w := newWorkspace(t)
|
|
|
|
t.Run("zero", func(t *testing.T) {
|
|
_, err := w.tryRun("stale", "--days", "0")
|
|
if err == nil {
|
|
t.Error("bd stale --days 0 should fail but exited 0")
|
|
}
|
|
})
|
|
|
|
t.Run("negative", func(t *testing.T) {
|
|
_, err := w.tryRun("stale", "--days", "-1")
|
|
if err == nil {
|
|
t.Error("bd stale --days -1 should fail but exited 0")
|
|
}
|
|
})
|
|
}
|