Skip to content
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
2 changes: 1 addition & 1 deletion api/instance/v1/image_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestWaitForImage(t *testing.T) {
func createImage(t *testing.T, instanceAPI *API, imageName string) (*Image, func()) {
serverRes, err := instanceAPI.CreateServer(&CreateServerRequest{
CommercialType: "DEV1-M",
Image: "ubuntu-bionic",
Image: "ubuntu_focal",
})
testhelpers.AssertNoError(t, err)

Expand Down
6 changes: 3 additions & 3 deletions api/instance/v1/server_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ func TestAPI_CreateServer(t *testing.T) {
res, err := instanceAPI.CreateServer(&CreateServerRequest{
Zone: scw.ZoneFrPar1,
CommercialType: "GP1-XS",
Image: "ubuntu-bionic",
Image: "ubuntu_focal",
})

testhelpers.AssertNoError(t, err)
// this UUID might change when running the cassette later when the image "ubuntu-bionic" got a new version
testhelpers.Equals(t, "f974feac-abae-4365-b988-8ec7d1cec10d", res.Server.Image.ID)
// this UUID might change when running the cassette later when the image "ubuntu_focal" got a new version
testhelpers.Equals(t, "365a8b9c-0c6e-4875-a887-dc3213db9e20", res.Server.Image.ID)
err = instanceAPI.DeleteServer(&DeleteServerRequest{
Zone: scw.ZoneFrPar1,
ServerID: res.Server.ID,
Expand Down
2 changes: 1 addition & 1 deletion api/instance/v1/snapshot_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestWaitForSnapshot(t *testing.T) {
func createSnapshot(t *testing.T, instanceAPI *API, snapshotName string) (*Snapshot, func()) {
serverRes, err := instanceAPI.CreateServer(&CreateServerRequest{
CommercialType: "DEV1-M",
Image: "ubuntu-bionic",
Image: "ubuntu_focal",
})
testhelpers.AssertNoError(t, err)

Expand Down
528 changes: 170 additions & 358 deletions api/instance/v1/testdata/create-server.yaml

Large diffs are not rendered by default.

214 changes: 113 additions & 101 deletions api/instance/v1/testdata/image-wait-test.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api/instance/v1/testdata/snapshot-wait-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ interactions:
"zone": "ams1"}, {"compatible_commercial_types": ["VC1S", "VC1M", "VC1L", "START1-XS",
"START1-S", "START1-M", "START1-L", "X64-15GB", "X64-30GB", "X64-60GB", "X64-120GB",
"RENDER-S", "GP1-XS", "GP1-S", "GP1-M", "GP1-L", "GP1-XL", "DEV1-S", "DEV1-M",
"DEV1-L", "DEV1-XL"], "arch": "x86_64", "id": "ce6c9d21-0ff3-4355-b385-c930c9f22d9d",
"DEV1-L", "DEV1-XL"], "arch": "x86_64", "id": "365a8b9c-0c6e-4875-a887-dc3213db9e20",
"zone": "par1"}], "name": "2020-04-28T15:08:03.913957+00:00"}], "current_public_version":
"61cf23b2-447a-48d4-9cfe-02b965fa651b", "label": "ubuntu_focal", "organization":
{"id": "51b656e3-4865-41e8-adbc-0c45bdd780db", "name": "Instances User Resources
Expand Down
12 changes: 6 additions & 6 deletions api/marketplace/v1/marketplace_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ func TestGetImageByLabel(t *testing.T) {
imageID, err := marketplaceAPI.GetLocalImageIDByLabel(&GetLocalImageIDByLabelRequest{
Zone: scw.ZoneFrPar1,
CommercialType: "DEV1-S",
ImageLabel: "ubuntu-bionic",
ImageLabel: "ubuntu_focal",
})
testhelpers.AssertNoError(t, err)

// ubuntu-bionic DEV1-S at par1: f974feac-abae-4365-b988-8ec7d1cec10d
testhelpers.Equals(t, "f974feac-abae-4365-b988-8ec7d1cec10d", imageID)
// ubuntu_focal DEV1-S at par1: 365a8b9c-0c6e-4875-a887-dc3213db9e20
testhelpers.Equals(t, "365a8b9c-0c6e-4875-a887-dc3213db9e20", imageID)
})

t.Run("matching input for GetLocalImageIDByLabel with lowercase image label", func(t *testing.T) {
Expand All @@ -37,12 +37,12 @@ func TestGetImageByLabel(t *testing.T) {
imageID, err := marketplaceAPI.GetLocalImageIDByLabel(&GetLocalImageIDByLabelRequest{
Zone: scw.ZoneFrPar1,
CommercialType: "dev1-s",
ImageLabel: "ubuntu-bionic",
ImageLabel: "ubuntu_focal",
})
testhelpers.AssertNoError(t, err)

// ubuntu-bionic DEV1-S at par1: f974feac-abae-4365-b988-8ec7d1cec10d
testhelpers.Equals(t, "f974feac-abae-4365-b988-8ec7d1cec10d", imageID)
// ubuntu_focal DEV1-S at par1: 365a8b9c-0c6e-4875-a887-dc3213db9e20
testhelpers.Equals(t, "365a8b9c-0c6e-4875-a887-dc3213db9e20", imageID)
})

t.Run("non-matching label for GetLocalImageIDByLabel", func(t *testing.T) {
Expand Down
1,299 changes: 384 additions & 915 deletions api/marketplace/v1/testdata/go-vcr.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func Example_createServer() {
instanceAPI := instance.NewAPI(client)

serverType := "DEV1-S"
image := "ubuntu-bionic"
image := "ubuntu_focal"

// Create a new DEV1-S server
createRes, err := instanceAPI.CreateServer(&instance.CreateServerRequest{
Expand Down