4
4
"testing"
5
5
6
6
"github.com/scaleway/scaleway-cli/v2/core"
7
- "github.com/scaleway/scaleway-cli/v2/internal/interactive"
8
7
block "github.com/scaleway/scaleway-cli/v2/internal/namespaces/block/v1alpha1"
9
8
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/instance/v1"
10
9
"github.com/scaleway/scaleway-cli/v2/internal/testhelpers"
@@ -18,15 +17,13 @@ import (
18
17
// These tests needs to be run in sequence
19
18
// since they are using the interactive print
20
19
func Test_ServerTerminate (t * testing.T ) {
21
- interactive .IsInteractive = true
22
-
23
20
t .Run ("without IP" , core .Test (& core.TestConfig {
24
21
Commands : instance .GetCommands (),
25
22
BeforeFunc : core .ExecStoreBeforeCmd (
26
23
"Server" ,
27
- testServerCommand ("image=ubuntu-jammy ip=new -w" ),
24
+ testServerCommand ("image=ubuntu-jammy ip=new root-volume=local:10GB -w" ),
28
25
),
29
- Cmd : `scw instance server terminate {{ .Server.ID }} with-block=true ` ,
26
+ Cmd : `scw instance server terminate {{ .Server.ID }}` ,
30
27
Check : core .TestCheckCombine (
31
28
core .TestCheckGolden (),
32
29
core .TestCheckExitCode (0 ),
@@ -48,16 +45,15 @@ func Test_ServerTerminate(t *testing.T) {
48
45
AfterFunc : core .ExecAfterCmd (
49
46
`scw instance ip delete {{ index .Server.PublicIP.ID }}` ,
50
47
),
51
- DisableParallel : true ,
52
48
}))
53
49
54
50
t .Run ("with IP" , core .Test (& core.TestConfig {
55
51
Commands : instance .GetCommands (),
56
52
BeforeFunc : core .ExecStoreBeforeCmd (
57
53
"Server" ,
58
- testServerCommand ("image=ubuntu-jammy ip=new -w" ),
54
+ testServerCommand ("image=ubuntu-jammy ip=new root-volume=local:10GB -w" ),
59
55
),
60
- Cmd : `scw instance server terminate {{ .Server.ID }} with-ip=true with-block=true ` ,
56
+ Cmd : `scw instance server terminate {{ .Server.ID }} with-ip=true` ,
61
57
Check : core .TestCheckCombine (
62
58
core .TestCheckGolden (),
63
59
core .TestCheckExitCode (0 ),
@@ -77,7 +73,6 @@ func Test_ServerTerminate(t *testing.T) {
77
73
require .IsType (t , & scw.PermissionsDeniedError {}, err )
78
74
},
79
75
),
80
- DisableParallel : true ,
81
76
}))
82
77
83
78
t .Run ("without block" , core .Test (& core.TestConfig {
@@ -104,7 +99,6 @@ func Test_ServerTerminate(t *testing.T) {
104
99
),
105
100
core .ExecAfterCmd (`scw block volume delete {{ (index .Server.Volumes "0").ID }}` ),
106
101
),
107
- DisableParallel : true ,
108
102
}))
109
103
110
104
t .Run ("with block" , core .Test (& core.TestConfig {
@@ -141,10 +135,7 @@ func Test_ServerTerminate(t *testing.T) {
141
135
require .IsType (t , & scw.ResourceNotFoundError {}, err )
142
136
},
143
137
),
144
- DisableParallel : true ,
145
138
}))
146
-
147
- interactive .IsInteractive = false
148
139
}
149
140
150
141
// These tests needs to be run in sequence
0 commit comments