Skip to content

Commit

Permalink
fix(baremetal): update test to fix nightly (#4348)
Browse files Browse the repository at this point in the history
  • Loading branch information
Laure-di authored Dec 11, 2024
1 parent 634745e commit ea3fdc9
Show file tree
Hide file tree
Showing 5 changed files with 1,682 additions and 1,243 deletions.
12 changes: 6 additions & 6 deletions internal/namespaces/baremetal/v1/custom_server_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@ func Test_CreateServer(t *testing.T) {
t.Run("Simple", func(t *testing.T) {
t.Run("Default", core.Test(&core.TestConfig{
Commands: baremetal.GetCommands(),
Cmd: "scw baremetal server create zone=nl-ams-1 type=GP-BM2-S -w",
Cmd: "scw baremetal server create zone=fr-par-1 type=EM-B220E-NVME -w",
Check: core.TestCheckCombine(
core.TestCheckGolden(),
core.TestCheckExitCode(0),
),
AfterFunc: core.ExecAfterCmd("scw baremetal server delete {{ .CmdResult.ID }} zone=nl-ams-1"),
AfterFunc: core.ExecAfterCmd("scw baremetal server delete {{ .CmdResult.ID }} zone=fr-par-1"),
},
))

t.Run("With name", core.Test(&core.TestConfig{
Commands: baremetal.GetCommands(),
Cmd: "scw baremetal server create name=test-create-server-with-name zone=nl-ams-1 type=GP-BM2-S -w",
Cmd: "scw baremetal server create name=test-create-server-with-name zone=fr-par-1 type=EM-B220E-NVME -w",
Check: core.TestCheckCombine(
func(t *testing.T, ctx *core.CheckFuncCtx) {
t.Helper()
assert.Equal(t, "test-create-server-with-name", ctx.Result.(*baremetalSDK.Server).Name)
},
core.TestCheckExitCode(0),
),
AfterFunc: core.ExecAfterCmd("scw baremetal server delete {{ .CmdResult.ID }} zone=nl-ams-1"),
AfterFunc: core.ExecAfterCmd("scw baremetal server delete {{ .CmdResult.ID }} zone=fr-par-1"),
}))

t.Run("Tags", core.Test(&core.TestConfig{
Commands: baremetal.GetCommands(),
Cmd: "scw baremetal server create tags.0=prod tags.1=blue zone=nl-ams-1 type=GP-BM2-S -w",
Cmd: "scw baremetal server create tags.0=prod tags.1=blue zone=fr-par-1 type=EM-B220E-NVME -w",
Check: core.TestCheckCombine(
func(t *testing.T, ctx *core.CheckFuncCtx) {
t.Helper()
Expand All @@ -48,7 +48,7 @@ func Test_CreateServer(t *testing.T) {
},
core.TestCheckExitCode(0),
),
AfterFunc: core.ExecAfterCmd("scw baremetal server delete {{ .CmdResult.ID }} zone=nl-ams-1"),
AfterFunc: core.ExecAfterCmd("scw baremetal server delete {{ .CmdResult.ID }} zone=fr-par-1"),
}))
})
}
Loading

0 comments on commit ea3fdc9

Please sign in to comment.