/cmd/bd: migrate more tests

This commit is contained in:
coffeegoddd☕️✨ 2026-07-15 15:23:06 -07:00
commit 529586be2a
13 changed files with 243 additions and 125 deletions

View file

@ -43,11 +43,13 @@ func bdProxiedBlockedCapture(t *testing.T, bd string, p proxiedProject, args ...
}
func TestProxiedServerBlocked(t *testing.T) {
requireProxiedServerEnv(t)
requireSharedProxiedServer(t)
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("json_and_text_with_blockers", func(t *testing.T) {
p := bdProxiedInit(t, bd, "bk1")
t.Parallel()
p := newSharedProxiedProject(t, bd, "bk1")
blocker := bdProxiedCreate(t, bd, p.dir, "The blocker")
dependent := bdProxiedCreate(t, bd, p.dir, "I am blocked", "--deps", "depends-on:"+blocker.ID)
@ -80,7 +82,8 @@ func TestProxiedServerBlocked(t *testing.T) {
})
t.Run("empty_case", func(t *testing.T) {
p := bdProxiedInit(t, bd, "bk2")
t.Parallel()
p := newSharedProxiedProject(t, bd, "bk2")
bdProxiedCreate(t, bd, p.dir, "Nothing blocked here")
out, err := bdProxiedRun(t, bd, p.dir, "blocked", "--json")
@ -102,7 +105,8 @@ func TestProxiedServerBlocked(t *testing.T) {
})
t.Run("parent_filter_restricts_to_descendants", func(t *testing.T) {
p := bdProxiedInit(t, bd, "bk3")
t.Parallel()
p := newSharedProxiedProject(t, bd, "bk3")
parent := bdProxiedCreate(t, bd, p.dir, "Parent epic", "--type", "epic")
blocker := bdProxiedCreate(t, bd, p.dir, "Inside blocker")
inside := bdProxiedCreate(t, bd, p.dir, "Inside blocked", "--parent", parent.ID, "--deps", "depends-on:"+blocker.ID)

View file

@ -66,12 +66,14 @@ func bdProxiedCommentsJSON(t *testing.T, bd, dir string, args ...string) []*type
}
func TestProxiedServerComment(t *testing.T) {
requireProxiedServerEnv(t)
requireSharedProxiedServer(t)
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("comment_shorthand_then_list", func(t *testing.T) {
p := bdProxiedInit(t, bd, "cm")
t.Parallel()
p := newSharedProxiedProject(t, bd, "cm")
issue := bdProxiedCreate(t, bd, p.dir, "Needs a comment")
out := bdProxiedComment(t, bd, p.dir, issue.ID, "first thoughts")
@ -86,7 +88,8 @@ func TestProxiedServerComment(t *testing.T) {
})
t.Run("comments_add_subcommand", func(t *testing.T) {
p := bdProxiedInit(t, bd, "ca")
t.Parallel()
p := newSharedProxiedProject(t, bd, "ca")
issue := bdProxiedCreate(t, bd, p.dir, "Add via subcommand")
if _, _, err := bdProxiedRunBuffers(t, bd, p.dir, "comments", "add", issue.ID, "via add"); err != nil {
@ -103,7 +106,8 @@ func TestProxiedServerComment(t *testing.T) {
})
t.Run("multiple_comments_ordered", func(t *testing.T) {
p := bdProxiedInit(t, bd, "mo")
t.Parallel()
p := newSharedProxiedProject(t, bd, "mo")
issue := bdProxiedCreate(t, bd, p.dir, "Multi comment")
bdProxiedComment(t, bd, p.dir, issue.ID, "one")
@ -120,7 +124,8 @@ func TestProxiedServerComment(t *testing.T) {
})
t.Run("comment_json_output", func(t *testing.T) {
p := bdProxiedInit(t, bd, "cj")
t.Parallel()
p := newSharedProxiedProject(t, bd, "cj")
issue := bdProxiedCreate(t, bd, p.dir, "JSON comment")
stdout, stderr, err := bdProxiedRunBuffers(t, bd, p.dir, "comment", "--json", issue.ID, "json body")
@ -147,7 +152,8 @@ func TestProxiedServerComment(t *testing.T) {
})
t.Run("no_comments_message", func(t *testing.T) {
p := bdProxiedInit(t, bd, "nc")
t.Parallel()
p := newSharedProxiedProject(t, bd, "nc")
issue := bdProxiedCreate(t, bd, p.dir, "Uncommented")
out := bdProxiedComments(t, bd, p.dir, issue.ID)
@ -157,7 +163,8 @@ func TestProxiedServerComment(t *testing.T) {
})
t.Run("empty_text_fails", func(t *testing.T) {
p := bdProxiedInit(t, bd, "et")
t.Parallel()
p := newSharedProxiedProject(t, bd, "et")
issue := bdProxiedCreate(t, bd, p.dir, "Empty text")
out := bdProxiedCommentFail(t, bd, p.dir, issue.ID, "")
@ -167,7 +174,8 @@ func TestProxiedServerComment(t *testing.T) {
})
t.Run("missing_issue_fails", func(t *testing.T) {
p := bdProxiedInit(t, bd, "mi")
t.Parallel()
p := newSharedProxiedProject(t, bd, "mi")
out := bdProxiedCommentFail(t, bd, p.dir, "mi-99999", "orphan comment")
if !strings.Contains(out, "not found") {
t.Errorf("expected not-found error, got:\n%s", out)
@ -175,7 +183,8 @@ func TestProxiedServerComment(t *testing.T) {
})
t.Run("comments_add_json", func(t *testing.T) {
p := bdProxiedInit(t, bd, "aj")
t.Parallel()
p := newSharedProxiedProject(t, bd, "aj")
issue := bdProxiedCreate(t, bd, p.dir, "Add JSON")
stdout, stderr, err := bdProxiedRunBuffers(t, bd, p.dir, "comments", "add", issue.ID, "add json body", "--json")
@ -199,7 +208,8 @@ func TestProxiedServerComment(t *testing.T) {
})
t.Run("comment_from_file", func(t *testing.T) {
p := bdProxiedInit(t, bd, "cf")
t.Parallel()
p := newSharedProxiedProject(t, bd, "cf")
issue := bdProxiedCreate(t, bd, p.dir, "Comment from file")
file := filepath.Join(t.TempDir(), "body.txt")
@ -219,7 +229,8 @@ func TestProxiedServerComment(t *testing.T) {
})
t.Run("comments_add_from_file", func(t *testing.T) {
p := bdProxiedInit(t, bd, "af")
t.Parallel()
p := newSharedProxiedProject(t, bd, "af")
issue := bdProxiedCreate(t, bd, p.dir, "Add from file")
file := filepath.Join(t.TempDir(), "note.txt")
@ -238,7 +249,8 @@ func TestProxiedServerComment(t *testing.T) {
})
t.Run("comments_list_local_time", func(t *testing.T) {
p := bdProxiedInit(t, bd, "lt")
t.Parallel()
p := newSharedProxiedProject(t, bd, "lt")
issue := bdProxiedCreate(t, bd, p.dir, "Local time")
bdProxiedComment(t, bd, p.dir, issue.ID, "timed comment")
@ -249,7 +261,8 @@ func TestProxiedServerComment(t *testing.T) {
})
t.Run("comment_on_wisp_routes_to_wisp_comments", func(t *testing.T) {
p := bdProxiedInit(t, bd, "wc")
t.Parallel()
p := newSharedProxiedProject(t, bd, "wc")
wisp := bdProxiedCreate(t, bd, p.dir, "Wisp target", "--ephemeral")
out := bdProxiedComment(t, bd, p.dir, wisp.ID, "wisp comment")
@ -281,7 +294,8 @@ func TestProxiedServerComment(t *testing.T) {
})
t.Run("comments_add_on_wisp", func(t *testing.T) {
p := bdProxiedInit(t, bd, "wa")
t.Parallel()
p := newSharedProxiedProject(t, bd, "wa")
wisp := bdProxiedCreate(t, bd, p.dir, "Wisp add target", "--ephemeral")
if _, stderr, err := bdProxiedRunBuffers(t, bd, p.dir, "comments", "add", wisp.ID, "wisp via add"); err != nil {

View file

@ -13,11 +13,13 @@ import (
)
func TestProxiedServerContext(t *testing.T) {
requireProxiedServerEnv(t)
requireSharedProxiedServer(t)
t.Parallel()
bd := buildEmbeddedBD(t)
p := bdProxiedInit(t, bd, "ctx")
p := newSharedProxiedProject(t, bd, "ctx")
t.Run("default_text", func(t *testing.T) {
t.Parallel()
stdout, stderr, err := bdProxiedRunBuffers(t, bd, p.dir, "context")
if err != nil {
t.Fatalf("bd context failed: %v\nstdout:\n%s\nstderr:\n%s", err, stdout, stderr)
@ -31,6 +33,7 @@ func TestProxiedServerContext(t *testing.T) {
})
t.Run("json_fields", func(t *testing.T) {
t.Parallel()
info := proxiedContextJSON(t, bd, p)
if info.DoltMode != configfile.DoltModeProxiedServer {
@ -57,6 +60,7 @@ func TestProxiedServerContext(t *testing.T) {
})
t.Run("concurrent", func(t *testing.T) {
t.Parallel()
const numWorkers = 8
errs := make([]error, numWorkers)
modes := make([]string, numWorkers)

View file

@ -10,7 +10,8 @@ import (
)
func TestProxiedServerDoltRemoteRemove(t *testing.T) {
requireProxiedServerEnv(t)
requireSharedProxiedServer(t)
t.Parallel()
bd := buildEmbeddedBD(t)
seedRemote := func(t *testing.T, p proxiedProject, name, url string) {
@ -34,7 +35,8 @@ func TestProxiedServerDoltRemoteRemove(t *testing.T) {
}
t.Run("removes_existing_remote", func(t *testing.T) {
p := bdProxiedInit(t, bd, "prr1")
t.Parallel()
p := newSharedProxiedProject(t, bd, "prr1")
seedRemote(t, p, "backup", "https://doltremoteapi.dolthub.com/org/backup")
out, err := bdProxiedRun(t, bd, p.dir, "dolt", "remote", "remove", "backup")
@ -50,7 +52,8 @@ func TestProxiedServerDoltRemoteRemove(t *testing.T) {
})
t.Run("json_output", func(t *testing.T) {
p := bdProxiedInit(t, bd, "prr2")
t.Parallel()
p := newSharedProxiedProject(t, bd, "prr2")
seedRemote(t, p, "backup", "https://doltremoteapi.dolthub.com/org/backup")
out, err := bdProxiedRun(t, bd, p.dir, "dolt", "remote", "remove", "--json", "backup")
@ -78,7 +81,8 @@ func TestProxiedServerDoltRemoteRemove(t *testing.T) {
})
t.Run("nonexistent_remote_errors", func(t *testing.T) {
p := bdProxiedInit(t, bd, "prr3")
t.Parallel()
p := newSharedProxiedProject(t, bd, "prr3")
out, err := bdProxiedRun(t, bd, p.dir, "dolt", "remote", "remove", "ghost")
if err == nil {
t.Fatalf("expected error removing nonexistent remote, got:\n%s", out)

View file

@ -152,7 +152,7 @@ func runInitProxiedServer(cmd *cobra.Command, ctx context.Context, in initProxie
if err != nil {
return fmt.Errorf("failed to open uow provider: %v", err)
}
defer initUOWProvider.Close(ctx)
defer func() { _ = initUOWProvider.Close(ctx) }()
remoteURL := resolveProxiedInitRemoteURL(ctx, gitUC, in)

View file

@ -51,12 +51,14 @@ func bdProxiedLabelListJSON(t *testing.T, bd, dir, issueID string) []string {
}
func TestProxiedServerLabel(t *testing.T) {
requireProxiedServerEnv(t)
requireSharedProxiedServer(t)
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("add_list_remove", func(t *testing.T) {
p := bdProxiedInit(t, bd, "la")
t.Parallel()
p := newSharedProxiedProject(t, bd, "la")
issue := bdProxiedCreate(t, bd, p.dir, "Label target")
out := bdProxiedLabel(t, bd, p.dir, "add", issue.ID, "alpha,beta")
@ -82,7 +84,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("add_multiple_issues", func(t *testing.T) {
p := bdProxiedInit(t, bd, "lm")
t.Parallel()
p := newSharedProxiedProject(t, bd, "lm")
a := bdProxiedCreate(t, bd, p.dir, "Issue A")
b := bdProxiedCreate(t, bd, p.dir, "Issue B")
@ -97,7 +100,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("list_empty", func(t *testing.T) {
p := bdProxiedInit(t, bd, "le")
t.Parallel()
p := newSharedProxiedProject(t, bd, "le")
issue := bdProxiedCreate(t, bd, p.dir, "No labels")
out := bdProxiedLabel(t, bd, p.dir, "list", issue.ID)
if !strings.Contains(out, "no labels") {
@ -106,7 +110,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("list_all", func(t *testing.T) {
p := bdProxiedInit(t, bd, "ll")
t.Parallel()
p := newSharedProxiedProject(t, bd, "ll")
a := bdProxiedCreate(t, bd, p.dir, "A")
b := bdProxiedCreate(t, bd, p.dir, "B")
bdProxiedLabel(t, bd, p.dir, "add", a.ID, "common")
@ -141,7 +146,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("propagate", func(t *testing.T) {
p := bdProxiedInit(t, bd, "lp")
t.Parallel()
p := newSharedProxiedProject(t, bd, "lp")
parent := bdProxiedCreate(t, bd, p.dir, "Parent epic", "--type", "epic")
c1 := bdProxiedCreate(t, bd, p.dir, "Child 1", "--parent", parent.ID)
c2 := bdProxiedCreate(t, bd, p.dir, "Child 2", "--parent", parent.ID)
@ -159,7 +165,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("propagate_no_children", func(t *testing.T) {
p := bdProxiedInit(t, bd, "pn")
t.Parallel()
p := newSharedProxiedProject(t, bd, "pn")
lonely := bdProxiedCreate(t, bd, p.dir, "Lonely")
out := bdProxiedLabel(t, bd, p.dir, "propagate", lonely.ID, "nope")
if !strings.Contains(out, "No children found") {
@ -168,7 +175,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("add_json", func(t *testing.T) {
p := bdProxiedInit(t, bd, "aj")
t.Parallel()
p := newSharedProxiedProject(t, bd, "aj")
issue := bdProxiedCreate(t, bd, p.dir, "Add JSON")
stdout, stderr, err := bdProxiedRunBuffers(t, bd, p.dir, "label", "add", issue.ID, "j1,j2", "--json")
@ -198,7 +206,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("remove_json", func(t *testing.T) {
p := bdProxiedInit(t, bd, "rj")
t.Parallel()
p := newSharedProxiedProject(t, bd, "rj")
issue := bdProxiedCreate(t, bd, p.dir, "Remove JSON")
bdProxiedLabel(t, bd, p.dir, "add", issue.ID, "rmj")
@ -223,7 +232,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("add_duplicate_idempotent", func(t *testing.T) {
p := bdProxiedInit(t, bd, "di")
t.Parallel()
p := newSharedProxiedProject(t, bd, "di")
issue := bdProxiedCreate(t, bd, p.dir, "Dup label")
bdProxiedLabel(t, bd, p.dir, "add", issue.ID, "dup")
bdProxiedLabel(t, bd, p.dir, "add", issue.ID, "dup")
@ -234,7 +244,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("remove_comma_separated_multi", func(t *testing.T) {
p := bdProxiedInit(t, bd, "rm")
t.Parallel()
p := newSharedProxiedProject(t, bd, "rm")
issue := bdProxiedCreate(t, bd, p.dir, "Multi remove")
bdProxiedLabel(t, bd, p.dir, "add", issue.ID, "rm-a,rm-b,rm-keep")
@ -245,7 +256,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("remove_batch", func(t *testing.T) {
p := bdProxiedInit(t, bd, "rb")
t.Parallel()
p := newSharedProxiedProject(t, bd, "rb")
a := bdProxiedCreate(t, bd, p.dir, "Batch rm A")
b := bdProxiedCreate(t, bd, p.dir, "Batch rm B")
bdProxiedLabel(t, bd, p.dir, "add", a.ID, b.ID, "batch-rm")
@ -259,7 +271,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("list_text", func(t *testing.T) {
p := bdProxiedInit(t, bd, "lx")
t.Parallel()
p := newSharedProxiedProject(t, bd, "lx")
issue := bdProxiedCreate(t, bd, p.dir, "Text list")
bdProxiedLabel(t, bd, p.dir, "add", issue.ID, "alpha,beta")
@ -270,7 +283,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("propagate_json", func(t *testing.T) {
p := bdProxiedInit(t, bd, "pj")
t.Parallel()
p := newSharedProxiedProject(t, bd, "pj")
parent := bdProxiedCreate(t, bd, p.dir, "JSON propagate", "--type", "epic")
child := bdProxiedCreate(t, bd, p.dir, "JSON prop child", "--parent", parent.ID)
@ -296,7 +310,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("add_empty_label_rejected", func(t *testing.T) {
p := bdProxiedInit(t, bd, "el")
t.Parallel()
p := newSharedProxiedProject(t, bd, "el")
issue := bdProxiedCreate(t, bd, p.dir, "Empty label")
out := bdProxiedLabelFail(t, bd, p.dir, "add", issue.ID, "")
if !strings.Contains(out, "empty") {
@ -305,7 +320,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("provides_label_rejected", func(t *testing.T) {
p := bdProxiedInit(t, bd, "pv")
t.Parallel()
p := newSharedProxiedProject(t, bd, "pv")
issue := bdProxiedCreate(t, bd, p.dir, "Provides guard")
out := bdProxiedLabelFail(t, bd, p.dir, "add", issue.ID, "provides:foo")
if !strings.Contains(out, "provides:") {
@ -314,7 +330,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("provides_in_comma_list_rejected", func(t *testing.T) {
p := bdProxiedInit(t, bd, "pc")
t.Parallel()
p := newSharedProxiedProject(t, bd, "pc")
issue := bdProxiedCreate(t, bd, p.dir, "Provides in list")
out := bdProxiedLabelFail(t, bd, p.dir, "add", issue.ID, "ok-label,provides:auth")
if !strings.Contains(out, "provides:") {
@ -326,7 +343,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("wisp_label_routes_to_wisp_labels", func(t *testing.T) {
p := bdProxiedInit(t, bd, "lw")
t.Parallel()
p := newSharedProxiedProject(t, bd, "lw")
wisp := bdProxiedCreate(t, bd, p.dir, "Wisp target", "--ephemeral")
bdProxiedLabel(t, bd, p.dir, "add", wisp.ID, "wlabel")
@ -354,7 +372,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("wisp_label_remove_routes_to_wisp_labels", func(t *testing.T) {
p := bdProxiedInit(t, bd, "wr")
t.Parallel()
p := newSharedProxiedProject(t, bd, "wr")
wisp := bdProxiedCreate(t, bd, p.dir, "Wisp remove target", "--ephemeral")
bdProxiedLabel(t, bd, p.dir, "add", wisp.ID, "keep,drop")
@ -376,7 +395,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("list_all_includes_wisp_labels", func(t *testing.T) {
p := bdProxiedInit(t, bd, "law")
t.Parallel()
p := newSharedProxiedProject(t, bd, "law")
perm := bdProxiedCreate(t, bd, p.dir, "Perm issue")
wisp := bdProxiedCreate(t, bd, p.dir, "Wisp issue", "--ephemeral")
bdProxiedLabel(t, bd, p.dir, "add", perm.ID, "shared")
@ -411,7 +431,8 @@ func TestProxiedServerLabel(t *testing.T) {
})
t.Run("propagate_to_wisp_children", func(t *testing.T) {
p := bdProxiedInit(t, bd, "pw")
t.Parallel()
p := newSharedProxiedProject(t, bd, "pw")
parent := bdProxiedCreate(t, bd, p.dir, "Wisp parent", "--ephemeral", "--type", "epic")
child := bdProxiedCreate(t, bd, p.dir, "Wisp child", "--ephemeral", "--parent", parent.ID)

View file

@ -14,9 +14,10 @@ import (
)
func TestProxiedServerList(t *testing.T) {
requireProxiedServerEnv(t)
requireSharedProxiedServer(t)
t.Parallel()
bd := buildEmbeddedBD(t)
p := bdProxiedInit(t, bd, "lst")
p := newSharedProxiedProject(t, bd, "lst")
seed := seedProxiedListData(t, bd, p)
// --- A. Basic filtering ---
@ -499,7 +500,7 @@ func TestProxiedServerList(t *testing.T) {
t.Run("empty_database", func(t *testing.T) {
// Fresh proxied project with no seeded issues.
empty := bdProxiedInit(t, bd, "lst-empty")
empty := newSharedProxiedProject(t, bd, "lst-empty")
issues := bdProxiedListJSON(t, bd, empty)
if len(issues) != 0 {
t.Errorf("expected 0 issues in empty proxied database, got %d", len(issues))
@ -732,7 +733,7 @@ func TestProxiedServerList(t *testing.T) {
t.Run("concurrent_create_and_list", func(t *testing.T) {
// Isolated project: race test creates 20 issues; keep them out of
// the shared fixture so subsequent runs aren't polluted.
race := bdProxiedInit(t, bd, "lst-race")
race := newSharedProxiedProject(t, bd, "lst-race")
const (
workers = 4

View file

@ -43,11 +43,13 @@ func bdProxiedPruneFail(t *testing.T, bd, dir string, args ...string) string {
}
func TestProxiedServerPrune(t *testing.T) {
requireProxiedServerEnv(t)
requireSharedProxiedServer(t)
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("requires_filter", func(t *testing.T) {
p := bdProxiedInit(t, bd, "prf")
t.Parallel()
p := newSharedProxiedProject(t, bd, "prf")
out := bdProxiedPruneFail(t, bd, p.dir)
if !strings.Contains(out, "requires --older-than or --pattern") {
t.Errorf("expected requires-filter error, got: %s", out)
@ -55,7 +57,8 @@ func TestProxiedServerPrune(t *testing.T) {
})
t.Run("dry_run_deletes_nothing", func(t *testing.T) {
p := bdProxiedInit(t, bd, "pdr")
t.Parallel()
p := newSharedProxiedProject(t, bd, "pdr")
issue := bdProxiedCreate(t, bd, p.dir, "Prune me")
bdProxiedClose(t, bd, p.dir, issue.ID)
out := bdProxiedPrune(t, bd, p.dir, "--pattern", "*", "--dry-run")
@ -69,7 +72,8 @@ func TestProxiedServerPrune(t *testing.T) {
})
t.Run("force_deletes_closed", func(t *testing.T) {
p := bdProxiedInit(t, bd, "pfd")
t.Parallel()
p := newSharedProxiedProject(t, bd, "pfd")
issue := bdProxiedCreate(t, bd, p.dir, "Delete me")
bdProxiedClose(t, bd, p.dir, issue.ID)
bdProxiedPrune(t, bd, p.dir, "--pattern", "*", "--force")
@ -80,7 +84,8 @@ func TestProxiedServerPrune(t *testing.T) {
})
t.Run("skips_open", func(t *testing.T) {
p := bdProxiedInit(t, bd, "pso")
t.Parallel()
p := newSharedProxiedProject(t, bd, "pso")
open := bdProxiedCreate(t, bd, p.dir, "Still open")
closed := bdProxiedCreate(t, bd, p.dir, "Now closed")
bdProxiedClose(t, bd, p.dir, closed.ID)
@ -95,7 +100,8 @@ func TestProxiedServerPrune(t *testing.T) {
})
t.Run("reference_aware_skip", func(t *testing.T) {
p := bdProxiedInit(t, bd, "pras")
t.Parallel()
p := newSharedProxiedProject(t, bd, "pras")
referenced := bdProxiedCreate(t, bd, p.dir, "Cited decision")
_ = bdProxiedCreate(t, bd, p.dir, "Open citer",
"--description", "per "+referenced.ID+" we decided X")
@ -112,7 +118,8 @@ func TestProxiedServerPrune(t *testing.T) {
})
t.Run("ignore_references_deletes_referenced", func(t *testing.T) {
p := bdProxiedInit(t, bd, "pir")
t.Parallel()
p := newSharedProxiedProject(t, bd, "pir")
referenced := bdProxiedCreate(t, bd, p.dir, "Cited decision")
_ = bdProxiedCreate(t, bd, p.dir, "Open citer",
"--description", "per "+referenced.ID+" we decided X")
@ -126,7 +133,8 @@ func TestProxiedServerPrune(t *testing.T) {
})
t.Run("json_output", func(t *testing.T) {
p := bdProxiedInit(t, bd, "pjo")
t.Parallel()
p := newSharedProxiedProject(t, bd, "pjo")
a := bdProxiedCreate(t, bd, p.dir, "JSON prune A")
b := bdProxiedCreate(t, bd, p.dir, "JSON prune B")
bdProxiedClose(t, bd, p.dir, a.ID, b.ID)
@ -159,7 +167,8 @@ func TestProxiedServerPrune(t *testing.T) {
})
t.Run("commits_deletion", func(t *testing.T) {
p := bdProxiedInit(t, bd, "pcd")
t.Parallel()
p := newSharedProxiedProject(t, bd, "pcd")
issue := bdProxiedCreate(t, bd, p.dir, "Commit prune")
bdProxiedClose(t, bd, p.dir, issue.ID)
db := openProxiedDB(t, p)

View file

@ -57,9 +57,10 @@ func bdProxiedQueryFail(t *testing.T, bd string, p proxiedProject, args ...strin
}
func TestProxiedServerQuery(t *testing.T) {
requireProxiedServerEnv(t)
requireSharedProxiedServer(t)
t.Parallel()
bd := buildEmbeddedBD(t)
p := bdProxiedInit(t, bd, "qry")
p := newSharedProxiedProject(t, bd, "qry")
seed := seedProxiedListData(t, bd, p)
t.Run("filter_only_and_chain", func(t *testing.T) {

View file

@ -14,11 +14,13 @@ import (
)
func TestProxiedServerReadyWisp(t *testing.T) {
requireProxiedServerEnv(t)
requireSharedProxiedServer(t)
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("claim_include_ephemeral_claims_wisp", func(t *testing.T) {
p := bdProxiedInit(t, bd, "rwc")
t.Parallel()
p := newSharedProxiedProject(t, bd, "rwc")
wisp := bdProxiedCreate(t, bd, p.dir, "Wisp to claim", "--ephemeral", "--label", "wclaim")
out, err := bdProxiedRun(t, bd, p.dir,
@ -58,7 +60,8 @@ func TestProxiedServerReadyWisp(t *testing.T) {
})
t.Run("mol_on_wisp_molecule_currently_errors", func(t *testing.T) {
p := bdProxiedInit(t, bd, "rwm")
t.Parallel()
p := newSharedProxiedProject(t, bd, "rwm")
mol := bdProxiedCreate(t, bd, p.dir, "Wisp mol", "--ephemeral", "--type", "molecule")
bdProxiedCreate(t, bd, p.dir, "Wisp step", "--ephemeral", "--parent", mol.ID)
stdout, stderr, err := bdProxiedRunBuffers(t, bd, p.dir, "ready", "--mol", mol.ID, "--json")
@ -72,7 +75,8 @@ func TestProxiedServerReadyWisp(t *testing.T) {
})
t.Run("wisp_blocked_by_wisp_hidden_and_listed_in_blocked", func(t *testing.T) {
p := bdProxiedInit(t, bd, "rwwb")
t.Parallel()
p := newSharedProxiedProject(t, bd, "rwwb")
blocker := bdProxiedCreate(t, bd, p.dir, "Wisp blocker", "--ephemeral")
dependent := bdProxiedCreate(t, bd, p.dir, "Wisp dependent", "--ephemeral")
@ -111,7 +115,8 @@ func TestProxiedServerReadyWisp(t *testing.T) {
})
t.Run("cross_table_issue_blocked_by_wisp", func(t *testing.T) {
p := bdProxiedInit(t, bd, "rwci")
t.Parallel()
p := newSharedProxiedProject(t, bd, "rwci")
wispBlocker := bdProxiedCreate(t, bd, p.dir, "Wisp blocker for issue", "--ephemeral")
issue := bdProxiedCreate(t, bd, p.dir, "Issue blocked by wisp")
@ -158,7 +163,8 @@ func TestProxiedServerReadyWisp(t *testing.T) {
})
t.Run("cross_table_wisp_blocked_by_issue", func(t *testing.T) {
p := bdProxiedInit(t, bd, "rwcw")
t.Parallel()
p := newSharedProxiedProject(t, bd, "rwcw")
issueBlocker := bdProxiedCreate(t, bd, p.dir, "Issue blocker for wisp")
wisp := bdProxiedCreate(t, bd, p.dir, "Wisp blocked by issue", "--ephemeral")
@ -205,7 +211,8 @@ func TestProxiedServerReadyWisp(t *testing.T) {
})
t.Run("blocked_lists_blocked_wisp", func(t *testing.T) {
p := bdProxiedInit(t, bd, "rwbl")
t.Parallel()
p := newSharedProxiedProject(t, bd, "rwbl")
blocker := bdProxiedCreate(t, bd, p.dir, "Blocker wisp", "--ephemeral")
dependent := bdProxiedCreate(t, bd, p.dir, "Dependent wisp", "--ephemeral")
@ -238,7 +245,8 @@ func TestProxiedServerReadyWisp(t *testing.T) {
})
t.Run("explain_enriches_wisp_blocker_details", func(t *testing.T) {
p := bdProxiedInit(t, bd, "rwexb")
t.Parallel()
p := newSharedProxiedProject(t, bd, "rwexb")
wispBlocker := bdProxiedCreate(t, bd, p.dir,
"Wisp blocker title", "--ephemeral", "-p", "1")
issue := bdProxiedCreate(t, bd, p.dir, "Blocked issue")
@ -303,7 +311,8 @@ func TestProxiedServerReadyWisp(t *testing.T) {
})
t.Run("explain_detects_cycle_in_wisp_dependencies", func(t *testing.T) {
p := bdProxiedInit(t, bd, "rwcy")
t.Parallel()
p := newSharedProxiedProject(t, bd, "rwcy")
a := bdProxiedCreate(t, bd, p.dir, "Wisp cycle A", "--ephemeral")
b := bdProxiedCreate(t, bd, p.dir, "Wisp cycle B", "--ephemeral")
@ -353,7 +362,8 @@ func TestProxiedServerReadyWisp(t *testing.T) {
})
t.Run("empty_state_hint_when_only_wisps_exist", func(t *testing.T) {
p := bdProxiedInit(t, bd, "rwes")
t.Parallel()
p := newSharedProxiedProject(t, bd, "rwes")
bdProxiedCreate(t, bd, p.dir, "Lonely wisp", "--ephemeral")
stdout, _ := bdProxiedReadyCapture(t, bd, p)
if !strings.Contains(stdout, "No open issues") {

View file

@ -61,11 +61,12 @@ func searchResultIDs(results []map[string]interface{}) map[string]bool {
}
func TestProxiedServerSearch(t *testing.T) {
requireProxiedServerEnv(t)
requireSharedProxiedServer(t)
t.Parallel()
bd := buildEmbeddedBD(t)
p := bdProxiedInit(t, bd, "sp")
p := newSharedProxiedProject(t, bd, "sp")
taskA := bdProxiedCreate(t, bd, p.dir, "Alpha task", "--type", "task", "--priority", "1", "--assignee", "alice", "--description", "Important alpha work", "--label", "urgent")
taskB := bdProxiedCreate(t, bd, p.dir, "Beta bug", "--type", "bug", "--priority", "3", "--assignee", "bob", "--description", "Beta bug description", "--label", "backend")
taskC := bdProxiedCreate(t, bd, p.dir, "Gamma feature", "--type", "feature", "--priority", "2", "--label", "urgent", "--label", "frontend")
@ -330,7 +331,7 @@ func TestProxiedServerSearch(t *testing.T) {
})
t.Run("wisp_appears_in_search", func(t *testing.T) {
wp := bdProxiedInit(t, bd, "sw")
wp := newSharedProxiedProject(t, bd, "sw")
wisp := bdProxiedCreate(t, bd, wp.dir, "Wispy alpha search target", "--ephemeral")
if !searchResultIDs(bdProxiedSearchJSON(t, bd, wp.dir, "Wispy"))[wisp.ID] {
t.Errorf("expected ephemeral wisp %s to appear in search results", wisp.ID)
@ -338,7 +339,7 @@ func TestProxiedServerSearch(t *testing.T) {
})
t.Run("wisp_labels_hydrated_from_wisp_labels", func(t *testing.T) {
wp := bdProxiedInit(t, bd, "swl")
wp := newSharedProxiedProject(t, bd, "swl")
wisp := bdProxiedCreate(t, bd, wp.dir, "Wisp label search", "--ephemeral")
bdProxiedLabel(t, bd, wp.dir, "add", wisp.ID, "wlabel")

View file

@ -13,11 +13,13 @@ import (
)
func TestProxiedServerShow(t *testing.T) {
requireProxiedServerEnv(t)
requireSharedProxiedServer(t)
t.Parallel()
bd := buildEmbeddedBD(t)
t.Run("show_single_issue", func(t *testing.T) {
p := bdProxiedInit(t, bd, "ssi")
t.Parallel()
p := newSharedProxiedProject(t, bd, "ssi")
issue := bdProxiedCreate(t, bd, p.dir, "Show me", "--type", "task")
out := bdProxiedShowRaw(t, bd, p.dir, issue.ID)
@ -30,7 +32,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_multiple_issues", func(t *testing.T) {
p := bdProxiedInit(t, bd, "smi")
t.Parallel()
p := newSharedProxiedProject(t, bd, "smi")
issue1 := bdProxiedCreate(t, bd, p.dir, "Multi 1", "--type", "task")
issue2 := bdProxiedCreate(t, bd, p.dir, "Multi 2", "--type", "task")
@ -44,14 +47,16 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_nonexistent_id_exits_nonzero", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sne")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sne")
stdout, stderr := bdProxiedShowFail(t, bd, p.dir, "sne-nonexistent999")
_ = stdout
_ = stderr
})
t.Run("show_no_args_errors", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sna")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sna")
stdout, stderr := bdProxiedShowFail(t, bd, p.dir)
combined := stdout + stderr
if !strings.Contains(combined, "at least one issue ID") {
@ -60,7 +65,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_json_fields_round_trip", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sjf")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sjf")
issue := bdProxiedCreate(t, bd, p.dir, "JSON show", "--type", "task",
"--description", "A description", "-p", "1")
@ -86,7 +92,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_json_includes_labels", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sjl")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sjl")
issue := bdProxiedCreate(t, bd, p.dir, "Labeled show", "--type", "task", "-l", "bug")
m := bdProxiedShowDetailsFirst(t, bd, p.dir, issue.ID)
@ -106,7 +113,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_json_includes_dependencies", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sjd")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sjd")
blocker := bdProxiedCreate(t, bd, p.dir, "Blocker", "--type", "task")
blocked := bdProxiedCreate(t, bd, p.dir, "Blocked",
"--type", "task", "--deps", "blocked-by:"+blocker.ID)
@ -126,7 +134,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_json_count_fields_default", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sjc")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sjc")
blocker := bdProxiedCreate(t, bd, p.dir, "Blocker", "--type", "task")
blocked := bdProxiedCreate(t, bd, p.dir, "Blocked",
"--type", "task", "--deps", "blocked-by:"+blocker.ID)
@ -153,7 +162,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_json_includes_comments_under_flag", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sjic")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sjic")
issue := bdProxiedCreate(t, bd, p.dir, "Commented", "--type", "task")
db := openProxiedDB(t, p)
@ -173,7 +183,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_json_includes_dependents_under_flag", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sjidep")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sjidep")
hub := bdProxiedCreate(t, bd, p.dir, "Hub", "--type", "task")
bdProxiedCreate(t, bd, p.dir, "Spoke 1", "--type", "task", "--deps", "blocked-by:"+hub.ID)
bdProxiedCreate(t, bd, p.dir, "Spoke 2", "--type", "task", "--deps", "blocked-by:"+hub.ID)
@ -191,7 +202,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_json_epic_progress", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sjep")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sjep")
epic := bdProxiedCreate(t, bd, p.dir, "Epic progress", "--type", "epic")
child1 := bdProxiedCreate(t, bd, p.dir, "Epic child 1", "--type", "task", "--parent", epic.ID)
bdProxiedCreate(t, bd, p.dir, "Epic child 2", "--type", "task", "--parent", epic.ID)
@ -215,7 +227,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_json_parent_derived", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sjp")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sjp")
parent := bdProxiedCreate(t, bd, p.dir, "Parent", "--type", "epic")
child := bdProxiedCreate(t, bd, p.dir, "Child", "--type", "task", "--parent", parent.ID)
@ -226,7 +239,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_short", func(t *testing.T) {
p := bdProxiedInit(t, bd, "ssh")
t.Parallel()
p := newSharedProxiedProject(t, bd, "ssh")
issue := bdProxiedCreate(t, bd, p.dir, "Short show", "--type", "task")
out := bdProxiedShowRaw(t, bd, p.dir, issue.ID, "--short")
lines := strings.Split(strings.TrimSpace(out), "\n")
@ -239,7 +253,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_long", func(t *testing.T) {
p := bdProxiedInit(t, bd, "slong")
t.Parallel()
p := newSharedProxiedProject(t, bd, "slong")
issue := bdProxiedCreate(t, bd, p.dir, "Long show", "--type", "task",
"--description", "Desc", "--assignee", "alice")
out := bdProxiedShowRaw(t, bd, p.dir, issue.ID, "--long")
@ -249,7 +264,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_id_flag", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sid")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sid")
issue := bdProxiedCreate(t, bd, p.dir, "ID flag test", "--type", "task")
out := bdProxiedShowRaw(t, bd, p.dir, "--id", issue.ID, "--short")
@ -269,7 +285,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_local_time_no_error", func(t *testing.T) {
p := bdProxiedInit(t, bd, "slt")
t.Parallel()
p := newSharedProxiedProject(t, bd, "slt")
issue := bdProxiedCreate(t, bd, p.dir, "Local time", "--type", "task")
out := bdProxiedShowRaw(t, bd, p.dir, issue.ID, "--local-time")
if !strings.Contains(out, "Local time") {
@ -278,7 +295,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_external_ref_rendered", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sxr")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sxr")
issue := bdProxiedCreate(t, bd, p.dir, "External ref test",
"--type", "task", "--external-ref", "https://example.com/spec.md")
out := bdProxiedShowRaw(t, bd, p.dir, issue.ID)
@ -291,7 +309,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_no_external_ref_omits_line", func(t *testing.T) {
p := bdProxiedInit(t, bd, "snx")
t.Parallel()
p := newSharedProxiedProject(t, bd, "snx")
issue := bdProxiedCreate(t, bd, p.dir, "No ref test", "--type", "task")
out := bdProxiedShowRaw(t, bd, p.dir, issue.ID)
if strings.Contains(out, "External:") {
@ -300,7 +319,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_not_found_json_envelope", func(t *testing.T) {
p := bdProxiedInit(t, bd, "snj")
t.Parallel()
p := newSharedProxiedProject(t, bd, "snj")
stdout, _ := bdProxiedShowFail(t, bd, p.dir, "snj-bogus", "--json")
if stdout == "" {
t.Fatal("expected JSON error on stdout, got empty")
@ -315,7 +335,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("view_alias_dispatches_to_proxied", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sva")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sva")
issue := bdProxiedCreate(t, bd, p.dir, "View alias", "--type", "task")
out, err := bdProxiedRun(t, bd, p.dir, "view", issue.ID, "--short")
if err != nil {
@ -327,7 +348,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_concurrent_json_and_short", func(t *testing.T) {
p := bdProxiedInit(t, bd, "scn")
t.Parallel()
p := newSharedProxiedProject(t, bd, "scn")
const (
numWorkers = 8
issuesPerWorker = 3
@ -375,7 +397,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_wisp_id_routes_to_wisp_uc", func(t *testing.T) {
p := bdProxiedInit(t, bd, "swr")
t.Parallel()
p := newSharedProxiedProject(t, bd, "swr")
wisp := bdProxiedCreate(t, bd, p.dir, "Wisp default", "--type", "task", "--ephemeral")
out := bdProxiedShowRaw(t, bd, p.dir, wisp.ID)
@ -393,7 +416,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_refs_lists_referrers", func(t *testing.T) {
p := bdProxiedInit(t, bd, "srl")
t.Parallel()
p := newSharedProxiedProject(t, bd, "srl")
parent := bdProxiedCreate(t, bd, p.dir, "Refs parent", "--type", "task")
child := bdProxiedCreate(t, bd, p.dir, "Refs child",
"--type", "task", "--deps", "blocked-by:"+parent.ID)
@ -405,7 +429,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_refs_groups_by_type", func(t *testing.T) {
p := bdProxiedInit(t, bd, "srg")
t.Parallel()
p := newSharedProxiedProject(t, bd, "srg")
hub := bdProxiedCreate(t, bd, p.dir, "Refs hub", "--type", "task")
bdProxiedCreate(t, bd, p.dir, "Blocker A",
"--type", "task", "--deps", "blocked-by:"+hub.ID)
@ -422,7 +447,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_refs_empty", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sre")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sre")
issue := bdProxiedCreate(t, bd, p.dir, "No refs", "--type", "task")
out := bdProxiedShowRaw(t, bd, p.dir, issue.ID, "--refs")
if !strings.Contains(out, "No references found") {
@ -431,7 +457,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_refs_json_map_shape", func(t *testing.T) {
p := bdProxiedInit(t, bd, "srj")
t.Parallel()
p := newSharedProxiedProject(t, bd, "srj")
parent := bdProxiedCreate(t, bd, p.dir, "Refs parent J", "--type", "task")
child := bdProxiedCreate(t, bd, p.dir, "Refs child J",
"--type", "task", "--deps", "blocked-by:"+parent.ID)
@ -464,7 +491,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_wisp_refs", func(t *testing.T) {
p := bdProxiedInit(t, bd, "swrefs")
t.Parallel()
p := newSharedProxiedProject(t, bd, "swrefs")
wisp := bdProxiedCreate(t, bd, p.dir, "Wisp ref target", "--type", "task", "--ephemeral")
referrer := bdProxiedCreate(t, bd, p.dir, "Wisp referrer",
"--type", "task", "--ephemeral", "--deps", "blocked-by:"+wisp.ID)
@ -476,7 +504,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_children", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sc")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sc")
parent := bdProxiedCreate(t, bd, p.dir, "Children parent", "--type", "epic")
child := bdProxiedCreate(t, bd, p.dir, "Children child",
"--type", "task", "--parent", parent.ID)
@ -488,7 +517,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_children_empty", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sce")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sce")
issue := bdProxiedCreate(t, bd, p.dir, "No children", "--type", "task")
out := bdProxiedShowRaw(t, bd, p.dir, issue.ID, "--children")
if !strings.Contains(out, "No children found") {
@ -497,7 +527,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_children_short", func(t *testing.T) {
p := bdProxiedInit(t, bd, "scs")
t.Parallel()
p := newSharedProxiedProject(t, bd, "scs")
parent := bdProxiedCreate(t, bd, p.dir, "Parent S", "--type", "epic")
child := bdProxiedCreate(t, bd, p.dir, "Child S",
"--type", "task", "--parent", parent.ID)
@ -509,7 +540,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_children_json_map_shape", func(t *testing.T) {
p := bdProxiedInit(t, bd, "scj")
t.Parallel()
p := newSharedProxiedProject(t, bd, "scj")
parent := bdProxiedCreate(t, bd, p.dir, "Parent J", "--type", "epic")
child := bdProxiedCreate(t, bd, p.dir, "Child J",
"--type", "task", "--parent", parent.ID)
@ -545,7 +577,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_wisp_children", func(t *testing.T) {
p := bdProxiedInit(t, bd, "swc")
t.Parallel()
p := newSharedProxiedProject(t, bd, "swc")
epicW := bdProxiedCreate(t, bd, p.dir, "Wisp epic", "--type", "epic", "--ephemeral")
childW := bdProxiedCreate(t, bd, p.dir, "Wisp child",
"--type", "task", "--ephemeral", "--parent", epicW.ID)
@ -557,7 +590,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_as_of_historical_title", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sao")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sao")
issue := bdProxiedCreate(t, bd, p.dir, "AsOf original", "--type", "task")
hash := proxiedCurrentCommit(t, p)
@ -574,7 +608,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_as_of_invalid_ref_errors", func(t *testing.T) {
p := bdProxiedInit(t, bd, "saoi")
t.Parallel()
p := newSharedProxiedProject(t, bd, "saoi")
issue := bdProxiedCreate(t, bd, p.dir, "AsOf invalid", "--type", "task")
_, stderr, _ := bdProxiedRunBuffers(t, bd, p.dir, "show", issue.ID, "--as-of", "'; DROP TABLE issues; --")
@ -584,7 +619,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_as_of_short_mode", func(t *testing.T) {
p := bdProxiedInit(t, bd, "saos")
t.Parallel()
p := newSharedProxiedProject(t, bd, "saos")
issue := bdProxiedCreate(t, bd, p.dir, "AsOf short", "--type", "task")
hash := proxiedCurrentCommit(t, p)
bdProxiedUpdateOne(t, bd, p.dir, issue.ID, "--title", "AsOf short updated")
@ -599,7 +635,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_as_of_json_array", func(t *testing.T) {
p := bdProxiedInit(t, bd, "saoj")
t.Parallel()
p := newSharedProxiedProject(t, bd, "saoj")
issue := bdProxiedCreate(t, bd, p.dir, "AsOf JSON", "--type", "task")
hash := proxiedCurrentCommit(t, p)
bdProxiedUpdateOne(t, bd, p.dir, issue.ID, "--title", "AsOf JSON updated")
@ -614,7 +651,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_thread_walks_to_root", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sthr")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sthr")
root := bdProxiedCreate(t, bd, p.dir, "Root msg", "--type", "task")
mid := bdProxiedCreate(t, bd, p.dir, "Mid reply",
"--type", "task", "--deps", "replies-to:"+root.ID)
@ -630,7 +668,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_thread_collects_replies", func(t *testing.T) {
p := bdProxiedInit(t, bd, "stbr")
t.Parallel()
p := newSharedProxiedProject(t, bd, "stbr")
root := bdProxiedCreate(t, bd, p.dir, "Branch root", "--type", "task")
a := bdProxiedCreate(t, bd, p.dir, "Reply A",
"--type", "task", "--deps", "replies-to:"+root.ID)
@ -648,7 +687,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_thread_json_emits_array", func(t *testing.T) {
p := bdProxiedInit(t, bd, "stj")
t.Parallel()
p := newSharedProxiedProject(t, bd, "stj")
root := bdProxiedCreate(t, bd, p.dir, "Thread JSON root", "--type", "task")
reply := bdProxiedCreate(t, bd, p.dir, "Thread JSON reply",
"--type", "task", "--deps", "replies-to:"+root.ID)
@ -676,7 +716,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_thread_orphan_message_renders_alone", func(t *testing.T) {
p := bdProxiedInit(t, bd, "sto")
t.Parallel()
p := newSharedProxiedProject(t, bd, "sto")
orphan := bdProxiedCreate(t, bd, p.dir, "Orphan msg", "--type", "task")
out := bdProxiedShowRaw(t, bd, p.dir, orphan.ID, "--thread")
if !strings.Contains(out, orphan.ID) {
@ -688,7 +729,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_current_with_in_progress", func(t *testing.T) {
p := bdProxiedInit(t, bd, "scur")
t.Parallel()
p := newSharedProxiedProject(t, bd, "scur")
issue := bdProxiedCreate(t, bd, p.dir, "In progress", "--type", "task")
bdProxiedUpdateOne(t, bd, p.dir, issue.ID,
"--status", "in_progress", "--assignee", "alice", "--actor", "alice")
@ -703,7 +745,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_current_prefers_in_progress_over_hooked", func(t *testing.T) {
p := bdProxiedInit(t, bd, "scp")
t.Parallel()
p := newSharedProxiedProject(t, bd, "scp")
hooked := bdProxiedCreate(t, bd, p.dir, "Hooked one", "--type", "task")
inProg := bdProxiedCreate(t, bd, p.dir, "InProg one", "--type", "task")
bdProxiedUpdateOne(t, bd, p.dir, hooked.ID,
@ -724,7 +767,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_current_with_id_fails", func(t *testing.T) {
p := bdProxiedInit(t, bd, "scid")
t.Parallel()
p := newSharedProxiedProject(t, bd, "scid")
issue := bdProxiedCreate(t, bd, p.dir, "Conflict", "--type", "task")
stdout, stderr := bdProxiedShowFail(t, bd, p.dir, "--current", issue.ID)
combined := stdout + stderr
@ -734,7 +778,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_current_no_match_errors", func(t *testing.T) {
p := bdProxiedInit(t, bd, "scnm")
t.Parallel()
p := newSharedProxiedProject(t, bd, "scnm")
stdout, stderr := bdProxiedShowFail(t, bd, p.dir, "--current")
combined := stdout + stderr
if !strings.Contains(combined, "no current issue found") {
@ -743,7 +788,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_watch_rejected_in_proxied_mode", func(t *testing.T) {
p := bdProxiedInit(t, bd, "swt")
t.Parallel()
p := newSharedProxiedProject(t, bd, "swt")
issue := bdProxiedCreate(t, bd, p.dir, "Watch test", "--type", "task")
stdout, stderr := bdProxiedShowFail(t, bd, p.dir, issue.ID, "--watch")
combined := stdout + stderr
@ -753,7 +799,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_wisp_comments_default_count_only", func(t *testing.T) {
p := bdProxiedInit(t, bd, "swcc")
t.Parallel()
p := newSharedProxiedProject(t, bd, "swcc")
wisp := bdProxiedCreate(t, bd, p.dir, "Wisp w/comments", "--type", "task", "--ephemeral")
db := openProxiedDB(t, p)
@ -778,7 +825,8 @@ func TestProxiedServerShow(t *testing.T) {
})
t.Run("show_wisp_comments_include_streams", func(t *testing.T) {
p := bdProxiedInit(t, bd, "swci")
t.Parallel()
p := newSharedProxiedProject(t, bd, "swci")
wisp := bdProxiedCreate(t, bd, p.dir, "Wisp stream", "--type", "task", "--ephemeral")
db := openProxiedDB(t, p)

View file

@ -46,9 +46,10 @@ func bdProxiedSQLFail(t *testing.T, bd, dir string, args ...string) string {
}
func TestProxiedServerSQL(t *testing.T) {
requireProxiedServerEnv(t)
requireSharedProxiedServer(t)
t.Parallel()
bd := buildEmbeddedBD(t)
p := bdProxiedInit(t, bd, "sql")
p := newSharedProxiedProject(t, bd, "sql")
one := bdProxiedCreate(t, bd, p.dir, "Test issue one", "--type", "task", "--priority", "1")
two := bdProxiedCreate(t, bd, p.dir, "Test issue two", "--type", "bug", "--priority", "2")