Skip to content
Draft
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
4 changes: 4 additions & 0 deletions test/integration/account_events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package integration
import (
"context"
"testing"
"time"

"github.com/linode/linodego"
)
Expand All @@ -21,6 +22,9 @@ func TestAccountEvents_List_smoke(t *testing.T) {
t.Error(err)
}

// Sometimes it takes a bit longer to create a config
time.Sleep(time.Second * 3)

f := linodego.Filter{}
f.AddField(linodego.Eq, "entity.id", instance.ID)
f.AddField(linodego.Eq, "entity.type", "linode")
Expand Down
2 changes: 1 addition & 1 deletion test/integration/domains_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func setupDomain(t *testing.T, fixturesYaml string) (*linodego.Client, *linodego
client, fixtureTeardown := createTestClient(t, fixturesYaml)

createOpts := testDomainCreateOpts
createOpts.Domain = "linodego-blue-test.com"
createOpts.Domain = "linodego-blue-" + randString(6, digits) + "-test.com"

domain, err := client.CreateDomain(context.Background(), createOpts)
if err != nil {
Expand Down
642 changes: 358 additions & 284 deletions test/integration/fixtures/TestAccountEvents_List.yaml

Large diffs are not rendered by default.

699 changes: 430 additions & 269 deletions test/integration/fixtures/TestVolume_Create.yaml

Large diffs are not rendered by default.

657 changes: 383 additions & 274 deletions test/integration/fixtures/TestVolume_List.yaml

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions test/integration/lke_clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,14 @@ func TestLKECluster_Enterprise_BYOVPC_smoke(t *testing.T) {
// bring your own vpc
client, fixtureTeardown := createTestClient(t, "fixtures/TestLKECluster_Enterprise_VPC_smoke")

region := "no-osl-1"
region := getRegionsWithCaps(t, client, []string{linodego.CapabilityLKE, linodego.CapabilityDiskEncryption})[1]
vpc, vpcTeardown, err := createVPC(t, client, []vpcModifier{func(l *linodego.Client, options *linodego.VPCCreateOptions) {
options.Region = region
options.IPv6 = []linodego.VPCCreateOptionsIPv6{
{
Range: linodego.Pointer("/52"),
},
}
}}...)

client, lkeCluster, teardown, err := setupLKECluster(t, []clusterModifier{func(createOpts *linodego.LKEClusterCreateOptions) {
Expand Down Expand Up @@ -441,7 +446,7 @@ func setupLKECluster(t *testing.T, clusterModifiers []clusterModifier, fixturesY
}

if createOpts.Region == "" {
createOpts.Region = getRegionsWithCaps(t, client, []string{"Kubernetes", "LA Disk Encryption"})[0]
createOpts.Region = getRegionsWithCaps(t, client, []string{linodego.CapabilityLKE, linodego.CapabilityDiskEncryption})[0]
}

if createOpts.K8sVersion == "" {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func createPostgresDatabase(t *testing.T, client *linodego.Client,
Label: "go-postgres-testing-def" + randLabel(),
Region: getRegionsWithCaps(t, client, []string{"Managed Databases"})[0],
Type: "g6-nanode-1",
Engine: "postgresql/14",
Engine: "postgresql/16",
ClusterSize: 3,
AllowList: []string{"203.0.113.1", "192.0.1.0/24"},
}
Expand Down
7 changes: 6 additions & 1 deletion test/integration/volumes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"github.com/linode/linodego"
"github.com/stretchr/testify/require"
)

type volumeModifier func(*linodego.Client, *linodego.VolumeCreateOptions)
Expand All @@ -15,10 +16,11 @@ func TestVolume_Create_smoke(t *testing.T) {
defer teardown()

createOpts := linodego.VolumeCreateOptions{
Label: "go-vol-test-create",
Label: "go-vol-test-create-" + randString(6, digits),
Region: getRegionsWithCaps(t, client, []string{"Linodes"})[0],
}
volume, err := client.CreateVolume(context.Background(), createOpts)

if err != nil {
t.Errorf("Error listing volumes, expected struct, got error %v", err)
}
Expand All @@ -29,6 +31,9 @@ func TestVolume_Create_smoke(t *testing.T) {
assertDateSet(t, volume.Created)
assertDateSet(t, volume.Updated)

volume, err = client.WaitForVolumeStatus(context.Background(), volume.ID, linodego.VolumeActive, 30)
require.NoErrorf(t, err, "Error waiting for volume to be active: %v", err)

// volumes deleted too fast tend to stick, adding a few seconds to catch up
time.Sleep(time.Second * 5)
if err := client.DeleteVolume(context.Background(), volume.ID); err != nil {
Expand Down
Loading