@@ -44,20 +44,28 @@ func TestRestores(t *testing.T) {
44
44
g .GenerateProjectAndCluster ("backupRestores" )
45
45
require .NotEmpty (t , g .ClusterName )
46
46
47
- g2 := internal .NewAtlasE2ETestGenerator (t , internal .WithSnapshot (), internal .WithBackup ())
48
- g2 .GenerateProjectAndCluster ("backupRestores2" )
49
- require .NotEmpty (t , g2 .ClusterName )
47
+ projectID := g .ProjectID
48
+ clusterName := g .ClusterName
49
+
50
+ g .ProjectID = ""
51
+ g .ClusterName = ""
52
+
53
+ g .GenerateProjectAndCluster ("backupRestores2" )
54
+ require .NotEmpty (t , g .ClusterName )
55
+
56
+ projectID2 := g .ProjectID
57
+ clusterName2 := g .ClusterName
50
58
51
59
g .Run ("Create snapshot" , func (t * testing.T ) { //nolint:thelper // g.Run replaces t.Run
52
60
cmd := exec .Command (cliPath ,
53
61
backupsEntity ,
54
62
snapshotsEntity ,
55
63
"create" ,
56
- g . ClusterName ,
64
+ clusterName ,
57
65
"--desc" ,
58
66
"test-snapshot" ,
59
67
"--projectId" ,
60
- g . ProjectID ,
68
+ projectID ,
61
69
"-o=json" )
62
70
cmd .Env = os .Environ ()
63
71
resp , err := internal .RunAndGetStdOut (cmd )
@@ -77,9 +85,9 @@ func TestRestores(t *testing.T) {
77
85
"watch" ,
78
86
snapshotID ,
79
87
"--clusterName" ,
80
- g . ClusterName ,
88
+ clusterName ,
81
89
"--projectId" ,
82
- g . ProjectID )
90
+ projectID )
83
91
cmd .Env = os .Environ ()
84
92
resp , _ := internal .RunAndGetStdOut (cmd )
85
93
t .Log (string (resp ))
@@ -92,15 +100,15 @@ func TestRestores(t *testing.T) {
92
100
"start" ,
93
101
"automated" ,
94
102
"--clusterName" ,
95
- g . ClusterName ,
103
+ clusterName ,
96
104
"--snapshotId" ,
97
105
snapshotID ,
98
106
"--projectId" ,
99
- g . ProjectID ,
107
+ projectID ,
100
108
"--targetProjectId" ,
101
- g2 . ProjectID ,
109
+ projectID2 ,
102
110
"--targetClusterName" ,
103
- g2 . ClusterName ,
111
+ clusterName2 ,
104
112
"-o=json" )
105
113
cmd .Env = os .Environ ()
106
114
resp , err := internal .RunAndGetStdOut (cmd )
@@ -118,9 +126,9 @@ func TestRestores(t *testing.T) {
118
126
"watch" ,
119
127
restoreJobID ,
120
128
"--clusterName" ,
121
- g . ClusterName ,
129
+ clusterName ,
122
130
"--projectId" ,
123
- g . ProjectID ,
131
+ projectID ,
124
132
"-o=json" )
125
133
cmd .Env = os .Environ ()
126
134
resp , err := internal .RunAndGetStdOut (cmd )
@@ -133,9 +141,9 @@ func TestRestores(t *testing.T) {
133
141
backupsEntity ,
134
142
restoresEntity ,
135
143
"list" ,
136
- g . ClusterName ,
144
+ clusterName ,
137
145
"--projectId" ,
138
- g . ProjectID ,
146
+ projectID ,
139
147
"-o=json" )
140
148
cmd .Env = os .Environ ()
141
149
resp , err := internal .RunAndGetStdOut (cmd )
@@ -153,9 +161,9 @@ func TestRestores(t *testing.T) {
153
161
"describe" ,
154
162
restoreJobID ,
155
163
"--clusterName" ,
156
- g . ClusterName ,
164
+ clusterName ,
157
165
"--projectId" ,
158
- g . ProjectID ,
166
+ projectID ,
159
167
"-o=json" )
160
168
cmd .Env = os .Environ ()
161
169
resp , err := internal .RunAndGetStdOut (cmd )
@@ -174,11 +182,11 @@ func TestRestores(t *testing.T) {
174
182
"start" ,
175
183
"download" ,
176
184
"--clusterName" ,
177
- g . ClusterName ,
185
+ clusterName ,
178
186
"--snapshotId" ,
179
187
snapshotID ,
180
188
"--projectId" ,
181
- g . ProjectID ,
189
+ projectID ,
182
190
"-o=json" )
183
191
cmd .Env = os .Environ ()
184
192
resp , err := internal .RunAndGetStdOut (cmd )
@@ -196,9 +204,9 @@ func TestRestores(t *testing.T) {
196
204
"watch" ,
197
205
restoreJobID ,
198
206
"--clusterName" ,
199
- g . ClusterName ,
207
+ clusterName ,
200
208
"--projectId" ,
201
- g . ProjectID ,
209
+ projectID ,
202
210
"-o=json" )
203
211
cmd .Env = os .Environ ()
204
212
resp , err := internal .RunAndGetStdOut (cmd )
@@ -213,9 +221,9 @@ func TestRestores(t *testing.T) {
213
221
"delete" ,
214
222
snapshotID ,
215
223
"--clusterName" ,
216
- g . ClusterName ,
224
+ clusterName ,
217
225
"--projectId" ,
218
- g . ProjectID ,
226
+ projectID ,
219
227
"--force" )
220
228
cmd .Env = os .Environ ()
221
229
resp , err := internal .RunAndGetStdOut (cmd )
@@ -233,9 +241,9 @@ func TestRestores(t *testing.T) {
233
241
"watch" ,
234
242
snapshotID ,
235
243
"--clusterName" ,
236
- g . ClusterName ,
244
+ clusterName ,
237
245
"--projectId" ,
238
- g . ProjectID )
246
+ projectID )
239
247
cmd .Env = os .Environ ()
240
248
resp , _ := internal .RunAndGetStdOut (cmd )
241
249
t .Log (string (resp ))
0 commit comments