9
9
)
10
10
11
11
// From Coder organization images
12
- const ubuntuImgID = "5f443b16-30652892427b955601330fa5"
12
+ // const ubuntuImgID = "5f443b16-30652892427b955601330fa5"
13
13
14
14
func TestEnvsCLI (t * testing.T ) {
15
15
t .Parallel ()
@@ -37,6 +37,18 @@ func TestEnvsCLI(t *testing.T) {
37
37
tcli .StderrEmpty (),
38
38
)
39
39
40
+ // Image unset.
41
+ c .Run (ctx , "coder envs create test-env" ).Assert (t ,
42
+ tcli .StderrMatches (regexp .QuoteMeta ("fatal: required flag(s) \" image\" not set" )),
43
+ tcli .Error (),
44
+ )
45
+
46
+ // Image not imported.
47
+ c .Run (ctx , "coder envs create test-env --image doesntmatter" ).Assert (t ,
48
+ tcli .StderrMatches (regexp .QuoteMeta ("fatal: image not found - did you forget to import this image?" )),
49
+ tcli .Error (),
50
+ )
51
+
40
52
// TODO(Faris) : uncomment this when we can safely purge the environments
41
53
// the integrations tests would create in the sidecar
42
54
// Successfully create environment.
@@ -46,24 +58,12 @@ func TestEnvsCLI(t *testing.T) {
46
58
// tcli.StderrMatches(regexp.QuoteMeta("Successfully created environment \"test-ubuntu\"")),
47
59
// )
48
60
49
- // Invalid environment name should fail.
50
- c .Run (ctx , "coder envs create --org Coder --image " + ubuntuImgID + " this-IS-an-invalid-EnvironmentName" ).Assert (t ,
51
- tcli .Error (),
52
- tcli .StderrMatches (regexp .QuoteMeta ("fatal: image not found - did you forget to import this image?" )),
53
- )
54
-
55
61
// TODO(Faris) : uncomment this when we can safely purge the environments
56
62
// the integrations tests would create in the sidecar
57
63
// Successfully provision environment with fractional resource amounts
58
64
// c.Run(ctx, fmt.Sprintf(`coder envs create -i %s -c 1.2 -m 1.4 non-whole-resource-amounts`, ubuntuImgID)).Assert(t,
59
65
// tcli.Success(),
60
66
// tcli.StderrMatches(regexp.QuoteMeta("Successfully created environment \"non-whole-resource-amounts\"")),
61
67
// )
62
-
63
- // Image does not exist should fail.
64
- c .Run (ctx , "coder envs create --org Coder --image does-not-exist env-will-not-be-created" ).Assert (t ,
65
- tcli .Error (),
66
- tcli .StderrMatches (regexp .QuoteMeta ("fatal: image not found - did you forget to import this image?" )),
67
- )
68
68
})
69
69
}
0 commit comments