summaryrefslogtreecommitdiff
path: root/integrationtests
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-13 14:05:38 +0300
committerPaul Buetow <paul@buetow.org>2026-04-13 14:05:38 +0300
commit604f5aa7603498c4f7cc9a649a86d525b824e6c9 (patch)
tree814adfdd098e1594b74cbda3396b06723a469d3b /integrationtests
parent00981e0d9cd0bc00c3e21ec0124ffbcc52b4762a (diff)
Release v0.33.0: ask dependency UX and start gatingv0.33.0
Show only task alias IDs on ask info Depends lines. Block ask start until every dependency is completed. Bump version to 0.33.0. Made-with: Cursor
Diffstat (limited to 'integrationtests')
-rw-r--r--integrationtests/ask_test.go55
1 files changed, 51 insertions, 4 deletions
diff --git a/integrationtests/ask_test.go b/integrationtests/ask_test.go
index c122ede..9dab14e 100644
--- a/integrationtests/ask_test.go
+++ b/integrationtests/ask_test.go
@@ -640,10 +640,7 @@ func TestInfoShowsAllDependencies(t *testing.T) {
alias1 := mustTaskAlias(t, ctx, dependency1)
alias2 := mustTaskAlias(t, ctx, dependency2)
- wantDepends := []string{
- alias1 + " (" + dependency1 + ")",
- alias2 + " (" + dependency2 + ")",
- }
+ wantDepends := []string{alias1, alias2}
slices.Sort(wantDepends)
if !slices.Equal(ti.Depends, wantDepends) {
t.Fatalf("info dependencies = %+v, want %+v", ti.Depends, wantDepends)
@@ -702,6 +699,56 @@ func TestStart(t *testing.T) {
}
}
+func TestStartBlockedUntilDependenciesCompleted(t *testing.T) {
+ ctx, cancel := context.WithTimeout(context.Background(), 45*time.Second)
+ defer cancel()
+ t.Setenv("XDG_CACHE_HOME", t.TempDir())
+
+ dep, err := createTask(ctx, "integration test dependency for start gate")
+ if err != nil {
+ t.Fatalf("failed to create dependency task: %v", err)
+ }
+ defer deleteTask(ctx, dep)
+
+ dependent, err := createTask(ctx, "integration test dependent for start gate")
+ if err != nil {
+ t.Fatalf("failed to create dependent task: %v", err)
+ }
+ defer deleteTask(ctx, dependent)
+
+ if _, stderr, code := runAsk(ctx, []string{"dep", "add", dependent, dep}); code != 0 {
+ t.Fatalf("dep add failed with code %d: stderr=%s", code, stderr.String())
+ }
+
+ _, stderr, code := runAsk(ctx, []string{"start", dependent})
+ if code == 0 {
+ t.Fatalf("start should fail when a dependency is not completed")
+ }
+ if !strings.Contains(stderr.String(), "cannot start until all dependencies are completed") {
+ t.Fatalf("stderr = %q, want dependency gate message", stderr.String())
+ }
+
+ if _, stderr, code := runAsk(ctx, []string{"done", dep}); code != 0 {
+ t.Fatalf("done on dependency failed with code %d: stderr=%s", code, stderr.String())
+ }
+
+ stdout, stderr, code := runAsk(ctx, []string{"start", dependent})
+ if code != 0 {
+ t.Fatalf("start should succeed after dependency is completed: code=%d stderr=%s", code, stderr.String())
+ }
+ if !strings.Contains(stdout.String(), "ok ") {
+ t.Fatalf("start stdout = %q, want success line", stdout.String())
+ }
+
+ ti, ok := getTaskInfoFast(ctx, dependent)
+ if !ok {
+ t.Fatalf("could not get task info after start")
+ }
+ if ti.Started != "yes" {
+ t.Errorf("task started state = %q, want yes", ti.Started)
+ }
+}
+
func TestStop(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()