Skip to content

Commit 56cb8db

Browse files
committed
fix
1 parent 8ac6f44 commit 56cb8db

File tree

1 file changed

+33
-25
lines changed

1 file changed

+33
-25
lines changed

test/e2e/backup_restores_test.go

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,28 @@ func TestRestores(t *testing.T) {
3737
g.generateProjectAndCluster("backupRestores")
3838
require.NotEmpty(t, g.clusterName)
3939

40-
g2 := newAtlasE2ETestGenerator(t, withSnapshot())
41-
g2.generateProjectAndCluster("backupRestores2")
42-
require.NotEmpty(t, g2.clusterName)
40+
projectID := g.projectID
41+
clusterName := g.clusterName
42+
43+
g.projectID = ""
44+
g.clusterName = ""
45+
46+
g.generateProjectAndCluster("backupRestores2")
47+
require.NotEmpty(t, g.clusterName)
48+
49+
projectID2 := g.projectID
50+
clusterName2 := g.clusterName
4351

4452
t.Run("Create snapshot", func(t *testing.T) {
4553
cmd := exec.Command(cliPath,
4654
backupsEntity,
4755
snapshotsEntity,
4856
"create",
49-
g.clusterName,
57+
clusterName,
5058
"--desc",
5159
"test-snapshot",
5260
"--projectId",
53-
g.projectID,
61+
projectID,
5462
"-o=json")
5563
cmd.Env = os.Environ()
5664
resp, err := RunAndGetStdOut(cmd)
@@ -70,9 +78,9 @@ func TestRestores(t *testing.T) {
7078
"watch",
7179
snapshotID,
7280
"--clusterName",
73-
g.clusterName,
81+
clusterName,
7482
"--projectId",
75-
g.projectID)
83+
projectID)
7684
cmd.Env = os.Environ()
7785
resp, _ := RunAndGetStdOut(cmd)
7886
t.Log(string(resp))
@@ -85,15 +93,15 @@ func TestRestores(t *testing.T) {
8593
"start",
8694
"automated",
8795
"--clusterName",
88-
g.clusterName,
96+
clusterName,
8997
"--snapshotId",
9098
snapshotID,
9199
"--projectId",
92-
g.projectID,
100+
projectID,
93101
"--targetProjectId",
94-
g2.projectID,
102+
projectID2,
95103
"--targetClusterName",
96-
g2.clusterName,
104+
clusterName2,
97105
"-o=json")
98106
cmd.Env = os.Environ()
99107
resp, err := RunAndGetStdOut(cmd)
@@ -111,9 +119,9 @@ func TestRestores(t *testing.T) {
111119
"watch",
112120
restoreJobID,
113121
"--clusterName",
114-
g.clusterName,
122+
clusterName,
115123
"--projectId",
116-
g.projectID,
124+
projectID,
117125
"-o=json")
118126
cmd.Env = os.Environ()
119127
resp, err := RunAndGetStdOut(cmd)
@@ -126,9 +134,9 @@ func TestRestores(t *testing.T) {
126134
backupsEntity,
127135
restoresEntity,
128136
"list",
129-
g.clusterName,
137+
clusterName,
130138
"--projectId",
131-
g.projectID,
139+
projectID,
132140
"-o=json")
133141
cmd.Env = os.Environ()
134142
resp, err := RunAndGetStdOut(cmd)
@@ -146,9 +154,9 @@ func TestRestores(t *testing.T) {
146154
"describe",
147155
restoreJobID,
148156
"--clusterName",
149-
g.clusterName,
157+
clusterName,
150158
"--projectId",
151-
g.projectID,
159+
projectID,
152160
"-o=json")
153161
cmd.Env = os.Environ()
154162
resp, err := RunAndGetStdOut(cmd)
@@ -167,11 +175,11 @@ func TestRestores(t *testing.T) {
167175
"start",
168176
"download",
169177
"--clusterName",
170-
g.clusterName,
178+
clusterName,
171179
"--snapshotId",
172180
snapshotID,
173181
"--projectId",
174-
g.projectID,
182+
projectID,
175183
"-o=json")
176184
cmd.Env = os.Environ()
177185
resp, err := RunAndGetStdOut(cmd)
@@ -189,9 +197,9 @@ func TestRestores(t *testing.T) {
189197
"watch",
190198
restoreJobID,
191199
"--clusterName",
192-
g.clusterName,
200+
clusterName,
193201
"--projectId",
194-
g.projectID,
202+
projectID,
195203
"-o=json")
196204
cmd.Env = os.Environ()
197205
resp, err := RunAndGetStdOut(cmd)
@@ -206,9 +214,9 @@ func TestRestores(t *testing.T) {
206214
"delete",
207215
snapshotID,
208216
"--clusterName",
209-
g.clusterName,
217+
clusterName,
210218
"--projectId",
211-
g.projectID,
219+
projectID,
212220
"--force")
213221
cmd.Env = os.Environ()
214222
resp, err := RunAndGetStdOut(cmd)
@@ -226,9 +234,9 @@ func TestRestores(t *testing.T) {
226234
"watch",
227235
snapshotID,
228236
"--clusterName",
229-
g.clusterName,
237+
clusterName,
230238
"--projectId",
231-
g.projectID)
239+
projectID)
232240
cmd.Env = os.Environ()
233241
resp, _ := RunAndGetStdOut(cmd)
234242
t.Log(string(resp))

0 commit comments

Comments
 (0)