Skip to content

Commit 9e41b42

Browse files
committed
test(cli): add integration test for describe command
1 parent f86c546 commit 9e41b42

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
//go:build integration
2+
3+
package main
4+
5+
import (
6+
"context"
7+
"testing"
8+
"time"
9+
10+
"github.com/altuslabsxyz/devnet-builder/internal/client"
11+
)
12+
13+
func TestDescribeIntegration(t *testing.T) {
14+
c, err := client.New()
15+
if err != nil {
16+
t.Skip("daemon not running, skipping integration test")
17+
}
18+
defer c.Close()
19+
20+
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
21+
defer cancel()
22+
23+
devnets, err := c.ListDevnets(ctx)
24+
if err != nil {
25+
t.Fatalf("failed to list devnets: %v", err)
26+
}
27+
28+
if len(devnets) == 0 {
29+
t.Skip("no devnets found, skipping")
30+
}
31+
32+
// Get first devnet
33+
devnet, err := c.GetDevnet(ctx, devnets[0].Metadata.Name)
34+
if err != nil {
35+
t.Fatalf("failed to get devnet: %v", err)
36+
}
37+
38+
// Verify we have conditions (after the controller changes)
39+
if len(devnet.Status.Conditions) == 0 {
40+
t.Log("warning: no conditions found on devnet")
41+
}
42+
}

0 commit comments

Comments
 (0)