Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LKE node pool tests #556

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
264 changes: 162 additions & 102 deletions test/integration/fixtures/TestLKENodePoolNode_Delete.yaml

Large diffs are not rendered by default.

Large diffs are not rendered by default.

260 changes: 159 additions & 101 deletions test/integration/fixtures/TestLKENodePool_GetFound.yaml

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion test/integration/fixtures/TestLKENodePool_GetMissing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ interactions:
- HEAD, GET, OPTIONS, POST, PUT, DELETE
Access-Control-Allow-Origin:
- '*'
Akamai-Internal-Account:
- '*'
Cache-Control:
- max-age=0, no-cache, no-store
Connection:
Expand All @@ -31,7 +33,7 @@ interactions:
Content-Type:
- application/json
Expires:
- Mon, 01 Jul 2024 17:48:55 GMT
- Fri, 19 Jul 2024 17:03:54 GMT
Pragma:
- no-cache
Vary:
Expand Down
282 changes: 171 additions & 111 deletions test/integration/fixtures/TestLKENodePool_Update.yaml

Large diffs are not rendered by default.

264 changes: 161 additions & 103 deletions test/integration/fixtures/TestLKENodePools_List.yaml

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions test/integration/lke_node_pools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestLKENodePool_GetMissing(t *testing.T) {
}

func TestLKENodePool_GetFound(t *testing.T) {
client, lkeCluster, pool, teardown, err := setupLKENodePool(t, "fixtures/TestLKENodePool_GetFound", nil)
client, lkeCluster, pool, teardown, err := setupLKENodePool(t, "fixtures/TestLKENodePool_GetFound", &testLKENodePoolCreateOpts)
if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -72,7 +72,7 @@ func TestLKENodePool_GetFound(t *testing.T) {
}

func TestLKENodePools_List(t *testing.T) {
client, lkeCluster, _, teardown, err := setupLKENodePool(t, "fixtures/TestLKENodePools_List", nil)
client, lkeCluster, _, teardown, err := setupLKENodePool(t, "fixtures/TestLKENodePools_List", &testLKENodePoolCreateOpts)
if err != nil {
t.Error(err)
}
Expand All @@ -88,7 +88,7 @@ func TestLKENodePools_List(t *testing.T) {
}

func TestLKENodePoolNode_Delete(t *testing.T) {
client, lkeCluster, nodePool, teardown, err := setupLKENodePool(t, "fixtures/TestLKENodePoolNode_Delete", nil)
client, lkeCluster, nodePool, teardown, err := setupLKENodePool(t, "fixtures/TestLKENodePoolNode_Delete", &testLKENodePoolCreateOpts)
if err != nil {
t.Error(err)
}
Expand All @@ -111,7 +111,7 @@ func TestLKENodePoolNode_Delete(t *testing.T) {
}

func TestLKENodePool_Update(t *testing.T) {
client, lkeCluster, nodePool, teardown, err := setupLKENodePool(t, "fixtures/TestLKENodePool_Update", nil)
client, lkeCluster, nodePool, teardown, err := setupLKENodePool(t, "fixtures/TestLKENodePool_Update", &testLKENodePoolCreateOpts)
if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -188,6 +188,8 @@ func TestLKENodePool_CreateWithLabelsAndTaints(t *testing.T) {
Value: "bar",
Effect: linodego.LKENodePoolTaintEffectNoSchedule,
}},
Count: 1,
Type: "g6-standard-1",
}
_, _, nodePool, teardown, err := setupLKENodePool(t, "fixtures/TestLKENodePool_CreateWithLabelsAndTaints", createOpts)
if err != nil {
Expand All @@ -208,15 +210,12 @@ func setupLKENodePool(t *testing.T, fixturesYaml string, nodePoolCreateOpts *lin
var fixtureTeardown func()
client, lkeCluster, fixtureTeardown, err := setupLKECluster(t, []clusterModifier{func(createOpts *linodego.LKEClusterCreateOptions) {
createOpts.Label = "go-lke-test-def"
if nodePoolCreateOpts != nil {
createOpts.NodePools = []linodego.LKENodePoolCreateOptions{*nodePoolCreateOpts}
}
}}, fixturesYaml)
if err != nil {
t.Errorf("Error creating lkeCluster, got error %v", err)
}

pool, err := client.CreateLKENodePool(context.Background(), lkeCluster.ID, testLKENodePoolCreateOpts)
pool, err := client.CreateLKENodePool(context.Background(), lkeCluster.ID, *nodePoolCreateOpts)
if err != nil {
t.Errorf("Error creating LKE Node Pool, got error %v", err)
}
Expand Down