Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit d0c6b8b

Browse files
author
Faris Huskovic
committed
use t.Skip()
1 parent a45da90 commit d0c6b8b

File tree

1 file changed

+62
-61
lines changed

1 file changed

+62
-61
lines changed

ci/integration/secrets_test.go

+62-61
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,81 @@
11
package integration
22

33
import (
4-
// "context"
5-
// "fmt"
6-
// "regexp"
4+
"context"
5+
"fmt"
6+
"regexp"
77
"testing"
8-
//"cdr.dev/coder-cli/pkg/tcli"
8+
9+
"cdr.dev/coder-cli/pkg/tcli"
910
)
1011

1112
func TestSecrets(t *testing.T) {
12-
// t.Parallel()
13-
// run(t, "secrets-cli-tests", func(t *testing.T, ctx context.Context, c *tcli.ContainerRunner) {
14-
// headlessLogin(ctx, t, c)
13+
run(t, "secrets-cli-tests", func(t *testing.T, ctx context.Context, c *tcli.ContainerRunner) {
14+
t.Skip()
15+
headlessLogin(ctx, t, c)
1516

16-
// c.Run(ctx, "coder secrets ls").Assert(t,
17-
// tcli.Success(),
18-
// )
17+
c.Run(ctx, "coder secrets ls").Assert(t,
18+
tcli.Success(),
19+
)
1920

20-
// name, value := randString(8), randString(8)
21+
name, value := randString(8), randString(8)
2122

22-
// c.Run(ctx, "coder secrets create").Assert(t,
23-
// tcli.Error(),
24-
// )
23+
c.Run(ctx, "coder secrets create").Assert(t,
24+
tcli.Error(),
25+
)
2526

26-
// // this tests the "Value:" prompt fallback
27-
// c.Run(ctx, fmt.Sprintf("echo %s | coder secrets create %s --from-prompt", value, name)).Assert(t,
28-
// tcli.Success(),
29-
// tcli.StderrEmpty(),
30-
// )
27+
// this tests the "Value:" prompt fallback
28+
c.Run(ctx, fmt.Sprintf("echo %s | coder secrets create %s --from-prompt", value, name)).Assert(t,
29+
tcli.Success(),
30+
tcli.StderrEmpty(),
31+
)
3132

32-
// c.Run(ctx, "coder secrets ls").Assert(t,
33-
// tcli.Success(),
34-
// tcli.StderrEmpty(),
35-
// tcli.StdoutMatches("Value"),
36-
// tcli.StdoutMatches(regexp.QuoteMeta(name)),
37-
// )
33+
c.Run(ctx, "coder secrets ls").Assert(t,
34+
tcli.Success(),
35+
tcli.StderrEmpty(),
36+
tcli.StdoutMatches("Value"),
37+
tcli.StdoutMatches(regexp.QuoteMeta(name)),
38+
)
3839

39-
// c.Run(ctx, "coder secrets view "+name).Assert(t,
40-
// tcli.Success(),
41-
// tcli.StderrEmpty(),
42-
// tcli.StdoutMatches(regexp.QuoteMeta(value)),
43-
// )
40+
c.Run(ctx, "coder secrets view "+name).Assert(t,
41+
tcli.Success(),
42+
tcli.StderrEmpty(),
43+
tcli.StdoutMatches(regexp.QuoteMeta(value)),
44+
)
4445

45-
// c.Run(ctx, "coder secrets rm").Assert(t,
46-
// tcli.Error(),
47-
// )
48-
// c.Run(ctx, "coder secrets rm "+name).Assert(t,
49-
// tcli.Success(),
50-
// )
51-
// c.Run(ctx, "coder secrets view "+name).Assert(t,
52-
// tcli.Error(),
53-
// tcli.StdoutEmpty(),
54-
// )
46+
c.Run(ctx, "coder secrets rm").Assert(t,
47+
tcli.Error(),
48+
)
49+
c.Run(ctx, "coder secrets rm "+name).Assert(t,
50+
tcli.Success(),
51+
)
52+
c.Run(ctx, "coder secrets view "+name).Assert(t,
53+
tcli.Error(),
54+
tcli.StdoutEmpty(),
55+
)
5556

56-
// name, value = randString(8), randString(8)
57+
name, value = randString(8), randString(8)
5758

58-
// c.Run(ctx, fmt.Sprintf("coder secrets create %s --from-literal %s", name, value)).Assert(t,
59-
// tcli.Success(),
60-
// tcli.StderrEmpty(),
61-
// )
59+
c.Run(ctx, fmt.Sprintf("coder secrets create %s --from-literal %s", name, value)).Assert(t,
60+
tcli.Success(),
61+
tcli.StderrEmpty(),
62+
)
6263

63-
// c.Run(ctx, "coder secrets view "+name).Assert(t,
64-
// tcli.Success(),
65-
// tcli.StdoutMatches(regexp.QuoteMeta(value)),
66-
// )
64+
c.Run(ctx, "coder secrets view "+name).Assert(t,
65+
tcli.Success(),
66+
tcli.StdoutMatches(regexp.QuoteMeta(value)),
67+
)
6768

68-
// name, value = randString(8), randString(8)
69-
// c.Run(ctx, fmt.Sprintf("echo %s > ~/secret.json", value)).Assert(t,
70-
// tcli.Success(),
71-
// )
72-
// c.Run(ctx, fmt.Sprintf("coder secrets create %s --from-file ~/secret.json", name)).Assert(t,
73-
// tcli.Success(),
74-
// )
75-
// c.Run(ctx, "coder secrets view "+name).Assert(t,
76-
// tcli.Success(),
77-
// tcli.StdoutMatches(regexp.QuoteMeta(value)),
78-
// )
79-
// })
69+
name, value = randString(8), randString(8)
70+
c.Run(ctx, fmt.Sprintf("echo %s > ~/secret.json", value)).Assert(t,
71+
tcli.Success(),
72+
)
73+
c.Run(ctx, fmt.Sprintf("coder secrets create %s --from-file ~/secret.json", name)).Assert(t,
74+
tcli.Success(),
75+
)
76+
c.Run(ctx, "coder secrets view "+name).Assert(t,
77+
tcli.Success(),
78+
tcli.StdoutMatches(regexp.QuoteMeta(value)),
79+
)
80+
})
8081
}

0 commit comments

Comments
 (0)