Skip to content

Commit d09d2ea

Browse files
authored
test: Migrate from g5 to g6 instances, fix test failures caused by invalid labels (#367)
* move test upload logic to git submodule, and use it in e2e workflow * update script folder name * migrate g5 to g6 and fix label too long error in tests * remove test script folder
1 parent d8c3b8a commit d09d2ea

File tree

9 files changed

+20
-20
lines changed

9 files changed

+20
-20
lines changed

test/fixtures/linode_instances.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"hypervisor": "kvm",
99
"id": 123,
1010
"status": "running",
11-
"type": "g5-standard-1",
11+
"type": "g6-standard-1",
1212
"alerts": {
1313
"network_in": 5,
1414
"network_out": 5,

test/fixtures/linode_types.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"network_out": 1000,
3232
"vcpus": 1,
3333
"gpus": 0,
34-
"id": "g5-nanode-1",
34+
"id": "g6-nanode-1",
3535
"label": "Linode 1024",
3636
"price": {
3737
"hourly": 0.0075,
@@ -127,7 +127,7 @@
127127
"network_out": 1000,
128128
"vcpus": 1,
129129
"gpus": 0,
130-
"id": "g5-standard-1",
130+
"id": "g6-standard-1",
131131
"label": "Linode 2048",
132132
"price": {
133133
"hourly": 0.015,
@@ -175,7 +175,7 @@
175175
"network_out": 1000,
176176
"vcpus": 2,
177177
"gpus": 1,
178-
"id": "g5-gpu-2",
178+
"id": "g6-gpu-2",
179179
"label": "Linode 4096",
180180
"price": {
181181
"hourly": 0.03,

test/fixtures/tags_something.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"hypervisor": "kvm",
1111
"id": 123,
1212
"status": "running",
13-
"type": "g5-standard-1",
13+
"type": "g6-standard-1",
1414
"alerts": {
1515
"network_in": 5,
1616
"network_out": 5,

test/integration/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def create_vpc_with_subnet_and_linode(
308308
label = "TestSDK-" + timestamp
309309

310310
instance, password = test_linode_client.linode.instance_create(
311-
"g5-standard-4", vpc.region, image="linode/debian11", label=label
311+
"g6-standard-1", vpc.region, image="linode/debian11", label=label
312312
)
313313

314314
yield vpc, subnet, instance, password

test/integration/helpers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88

99
def get_test_label():
10-
unique_timestamp = str(time.time_ns())
11-
label = "IntTestSDK_" + unique_timestamp
10+
unique_timestamp = str(time.time_ns())[:-3]
11+
label = "test_" + unique_timestamp
1212
return label
1313

1414

1515
def get_rand_nanosec_test_label():
16-
unique_timestamp = str(time.time_ns())
17-
label = "IntTestSDK_" + unique_timestamp
16+
unique_timestamp = str(time.time_ns())[:-3]
17+
label = "test_" + unique_timestamp
1818
return label
1919

2020

test/integration/linode_client/test_linode_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def test_cluster_create_with_api_objects(test_linode_client):
276276
version = client.lke.versions()[0]
277277
region = client.regions().first()
278278
node_pools = client.lke.node_pool(node_type, 3)
279-
label = get_test_label() + "-cluster"
279+
label = get_test_label()
280280

281281
cluster = client.lke.cluster_create(region, label, node_pools, version)
282282

test/integration/models/test_linode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def test_linode_firewalls(linode_with_volume_firewall):
349349
firewalls = linode.firewalls()
350350

351351
assert len(firewalls) > 0
352-
assert "TestSDK" in firewalls[0].label
352+
assert "test" in firewalls[0].label
353353

354354

355355
def test_linode_volumes(linode_with_volume_firewall):
@@ -358,7 +358,7 @@ def test_linode_volumes(linode_with_volume_firewall):
358358
volumes = linode.volumes()
359359

360360
assert len(volumes) > 0
361-
assert "TestSDK" in volumes[0].label
361+
assert "test" in volumes[0].label
362362

363363

364364
def wait_for_disk_status(disk: Disk, timeout):

test/unit/linode_client_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ def test_instance_create(self):
559559
"""
560560
with self.mock_post("linode/instances/123") as m:
561561
l = self.client.linode.instance_create(
562-
"g5-standard-1", "us-east-1a"
562+
"g6-standard-1", "us-east-1a"
563563
)
564564

565565
self.assertIsNotNone(l)
@@ -568,7 +568,7 @@ def test_instance_create(self):
568568
self.assertEqual(m.call_url, "/linode/instances")
569569

570570
self.assertEqual(
571-
m.call_data, {"region": "us-east-1a", "type": "g5-standard-1"}
571+
m.call_data, {"region": "us-east-1a", "type": "g6-standard-1"}
572572
)
573573

574574
def test_instance_create_with_image(self):
@@ -577,7 +577,7 @@ def test_instance_create_with_image(self):
577577
"""
578578
with self.mock_post("linode/instances/123") as m:
579579
l, pw = self.client.linode.instance_create(
580-
"g5-standard-1", "us-east-1a", image="linode/debian9"
580+
"g6-standard-1", "us-east-1a", image="linode/debian9"
581581
)
582582

583583
self.assertIsNotNone(l)
@@ -589,7 +589,7 @@ def test_instance_create_with_image(self):
589589
m.call_data,
590590
{
591591
"region": "us-east-1a",
592-
"type": "g5-standard-1",
592+
"type": "g6-standard-1",
593593
"image": "linode/debian9",
594594
"root_pass": pw,
595595
},
@@ -708,7 +708,7 @@ def test_cluster_create_with_api_objects(self):
708708
)
709709
self.assertEqual(m.call_data["region"], "ap-west")
710710
self.assertEqual(
711-
m.call_data["node_pools"], [{"type": "g5-nanode-1", "count": 3}]
711+
m.call_data["node_pools"], [{"type": "g6-nanode-1", "count": 3}]
712712
)
713713
self.assertEqual(m.call_data["k8s_version"], "1.19")
714714

test/unit/objects/linode_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ def test_get_type_by_id(self):
560560
"""
561561
Tests that a Linode type is loaded correctly by ID
562562
"""
563-
t = Type(self.client, "g5-nanode-1")
563+
t = Type(self.client, "g6-nanode-1")
564564
self.assertEqual(t._populated, False)
565565

566566
self.assertEqual(t.vcpus, 1)
@@ -574,7 +574,7 @@ def test_get_type_gpu(self):
574574
"""
575575
Tests that gpu types load up right
576576
"""
577-
t = Type(self.client, "g5-gpu-2")
577+
t = Type(self.client, "g6-gpu-2")
578578
self.assertEqual(t._populated, False)
579579

580580
self.assertEqual(t.gpus, 1)

0 commit comments

Comments
 (0)