Skip to content

Commit a6ae2bc

Browse files
committed
Fix smoketests
1 parent 95b7692 commit a6ae2bc

8 files changed

Lines changed: 30 additions & 36 deletions

tests/smoketests/sdk/test_async_blueprint.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async def test_blueprint_create_basic(self, async_sdk_client: AsyncRunloopSDK) -
2222
name = unique_name("sdk-async-blueprint-basic")
2323
blueprint = await async_sdk_client.blueprint.create(
2424
name=name,
25-
dockerfile="FROM ubuntu:20.04\nRUN apt-get update && apt-get install -y curl",
25+
dockerfile="FROM ubuntu:22.04\nRUN apt-get update && apt-get install -y curl",
2626
)
2727

2828
try:
@@ -43,7 +43,7 @@ async def test_blueprint_create_with_system_setup(self, async_sdk_client: AsyncR
4343
name = unique_name("sdk-async-blueprint-setup")
4444
blueprint = await async_sdk_client.blueprint.create(
4545
name=name,
46-
dockerfile="FROM ubuntu:20.04",
46+
dockerfile="FROM ubuntu:22.04",
4747
system_setup_commands=[
4848
"sudo apt-get update",
4949
"sudo apt-get install -y wget",
@@ -64,7 +64,7 @@ async def test_blueprint_get_info(self, async_sdk_client: AsyncRunloopSDK) -> No
6464
name = unique_name("sdk-async-blueprint-info")
6565
blueprint = await async_sdk_client.blueprint.create(
6666
name=name,
67-
dockerfile="FROM ubuntu:20.04\nRUN echo 'test'",
67+
dockerfile="FROM ubuntu:22.04\nRUN echo 'test'",
6868
)
6969

7070
try:
@@ -81,7 +81,7 @@ async def test_blueprint_delete(self, async_sdk_client: AsyncRunloopSDK) -> None
8181
"""Test deleting a blueprint."""
8282
blueprint = await async_sdk_client.blueprint.create(
8383
name=unique_name("sdk-async-blueprint-delete"),
84-
dockerfile="FROM ubuntu:20.04",
84+
dockerfile="FROM ubuntu:22.04",
8585
)
8686

8787
blueprint_id = blueprint.id
@@ -102,7 +102,7 @@ async def test_blueprint_with_base_blueprint(self, async_sdk_client: AsyncRunloo
102102
# Create base blueprint
103103
base_blueprint = await async_sdk_client.blueprint.create(
104104
name=unique_name("sdk-async-blueprint-base"),
105-
dockerfile="FROM ubuntu:20.04\nRUN apt-get update && apt-get install -y curl",
105+
dockerfile="FROM ubuntu:22.04\nRUN apt-get update && apt-get install -y curl",
106106
)
107107

108108
try:
@@ -135,7 +135,7 @@ async def test_blueprint_with_metadata(self, async_sdk_client: AsyncRunloopSDK)
135135

136136
blueprint = await async_sdk_client.blueprint.create(
137137
name=name,
138-
dockerfile="FROM ubuntu:20.04",
138+
dockerfile="FROM ubuntu:22.04",
139139
metadata=metadata,
140140
)
141141

@@ -168,7 +168,7 @@ async def test_get_blueprint_by_id(self, async_sdk_client: AsyncRunloopSDK) -> N
168168
# Create a blueprint
169169
created = await async_sdk_client.blueprint.create(
170170
name=unique_name("sdk-async-blueprint-retrieve"),
171-
dockerfile="FROM ubuntu:20.04",
171+
dockerfile="FROM ubuntu:22.04",
172172
)
173173

174174
try:
@@ -190,7 +190,7 @@ async def test_list_blueprints_by_name(self, async_sdk_client: AsyncRunloopSDK)
190190
# Create a blueprint with a specific name
191191
blueprint = await async_sdk_client.blueprint.create(
192192
name=blueprint_name,
193-
dockerfile="FROM ubuntu:20.04",
193+
dockerfile="FROM ubuntu:22.04",
194194
)
195195

196196
try:
@@ -216,7 +216,7 @@ async def test_create_devbox_from_blueprint(self, async_sdk_client: AsyncRunloop
216216
# Create a blueprint
217217
blueprint = await async_sdk_client.blueprint.create(
218218
name=unique_name("sdk-async-blueprint-for-devbox"),
219-
dockerfile="FROM ubuntu:20.04\nRUN apt-get update && apt-get install -y python3",
219+
dockerfile="FROM ubuntu:22.04\nRUN apt-get update && apt-get install -y python3",
220220
)
221221

222222
try:
@@ -255,7 +255,7 @@ async def test_blueprint_invalid_dockerfile(self, async_sdk_client: AsyncRunloop
255255
try:
256256
blueprint = await async_sdk_client.blueprint.create(
257257
name=unique_name("sdk-async-blueprint-invalid"),
258-
dockerfile="FROM ubuntu:20.04\nRUN INVALID_COMMAND_THAT_DOES_NOT_EXIST",
258+
dockerfile="FROM ubuntu:22.04\nRUN INVALID_COMMAND_THAT_DOES_NOT_EXIST",
259259
)
260260
# If it somehow succeeds, verify it failed during build
261261
info = await blueprint.get_info()

tests/smoketests/sdk/test_async_devbox.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ async def test_create_from_blueprint_id(self, async_sdk_client: AsyncRunloopSDK)
466466
# First create a blueprint
467467
blueprint = await async_sdk_client.blueprint.create(
468468
name=unique_name("sdk-async-blueprint-for-devbox"),
469-
dockerfile="FROM ubuntu:20.04\nRUN apt-get update && apt-get install -y curl",
469+
dockerfile="FROM ubuntu:22.04\nRUN apt-get update && apt-get install -y curl",
470470
)
471471

472472
try:
@@ -494,7 +494,7 @@ async def test_create_from_blueprint_name(self, async_sdk_client: AsyncRunloopSD
494494
# Create blueprint
495495
blueprint = await async_sdk_client.blueprint.create(
496496
name=blueprint_name,
497-
dockerfile="FROM ubuntu:20.04\nRUN apt-get update && apt-get install -y wget",
497+
dockerfile="FROM ubuntu:22.04\nRUN apt-get update && apt-get install -y wget",
498498
)
499499

500500
try:

tests/smoketests/sdk/test_async_network_policy.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,9 @@ async def test_network_policy_delete(self, async_sdk_client: AsyncRunloopSDK) ->
8888
allowed_hostnames=["example.com"],
8989
)
9090

91-
policy_id = network_policy.id
9291
result = await network_policy.delete()
9392

9493
assert result is not None
95-
# Verify it's deleted
96-
info = await async_sdk_client.api.network_policies.retrieve(policy_id)
97-
assert info.id == policy_id
9894

9995

10096
class TestAsyncNetworkPolicyCreationVariations:

tests/smoketests/sdk/test_async_scenario.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ async def test_scenario_builder_with_blueprint(self, async_sdk_client: AsyncRunl
207207
"""Test creating/updating a scenario from a blueprint."""
208208
blueprint = await async_sdk_client.blueprint.create(
209209
name=unique_name("sdk-smoketest-async-scenario-bp"),
210-
dockerfile="FROM ubuntu:20.04",
210+
dockerfile="FROM ubuntu:22.04",
211211
)
212212

213213
builder = (
@@ -233,7 +233,7 @@ async def test_scenario_builder_with_snapshot(self, async_sdk_client: AsyncRunlo
233233
# Create blueprint -> devbox -> snapshot chain
234234
blueprint = await async_sdk_client.blueprint.create(
235235
name=unique_name("sdk-smoketest-async-scenario-snap-bp"),
236-
dockerfile="FROM ubuntu:20.04",
236+
dockerfile="FROM ubuntu:22.04",
237237
)
238238
devbox = await async_sdk_client.devbox.create(blueprint_id=blueprint.id)
239239
snapshot = await devbox.snapshot_disk(name=unique_name("sdk-smoketest-async-scenario-snap"))

tests/smoketests/sdk/test_blueprint.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_blueprint_create_basic(self, sdk_client: RunloopSDK) -> None:
2222
name = unique_name("sdk-blueprint-basic")
2323
blueprint = sdk_client.blueprint.create(
2424
name=name,
25-
dockerfile="FROM ubuntu:20.04\nRUN apt-get update && apt-get install -y curl",
25+
dockerfile="FROM ubuntu:22.04\nRUN apt-get update && apt-get install -y curl",
2626
)
2727

2828
try:
@@ -43,7 +43,7 @@ def test_blueprint_create_with_system_setup(self, sdk_client: RunloopSDK) -> Non
4343
name = unique_name("sdk-blueprint-setup")
4444
blueprint = sdk_client.blueprint.create(
4545
name=name,
46-
dockerfile="FROM ubuntu:20.04",
46+
dockerfile="FROM ubuntu:22.04",
4747
system_setup_commands=[
4848
"sudo apt-get update",
4949
"sudo apt-get install -y wget",
@@ -64,7 +64,7 @@ def test_blueprint_get_info(self, sdk_client: RunloopSDK) -> None:
6464
name = unique_name("sdk-blueprint-info")
6565
blueprint = sdk_client.blueprint.create(
6666
name=name,
67-
dockerfile="FROM ubuntu:20.04\nRUN echo 'test'",
67+
dockerfile="FROM ubuntu:22.04\nRUN echo 'test'",
6868
)
6969

7070
try:
@@ -81,7 +81,7 @@ def test_blueprint_delete(self, sdk_client: RunloopSDK) -> None:
8181
"""Test deleting a blueprint."""
8282
blueprint = sdk_client.blueprint.create(
8383
name=unique_name("sdk-blueprint-delete"),
84-
dockerfile="FROM ubuntu:20.04",
84+
dockerfile="FROM ubuntu:22.04",
8585
)
8686

8787
blueprint_id = blueprint.id
@@ -102,7 +102,7 @@ def test_blueprint_with_base_blueprint(self, sdk_client: RunloopSDK) -> None:
102102
# Create base blueprint
103103
base_blueprint = sdk_client.blueprint.create(
104104
name=unique_name("sdk-blueprint-base"),
105-
dockerfile="FROM ubuntu:20.04\nRUN apt-get update && apt-get install -y curl",
105+
dockerfile="FROM ubuntu:22.04\nRUN apt-get update && apt-get install -y curl",
106106
)
107107

108108
try:
@@ -135,7 +135,7 @@ def test_blueprint_with_metadata(self, sdk_client: RunloopSDK) -> None:
135135

136136
blueprint = sdk_client.blueprint.create(
137137
name=name,
138-
dockerfile="FROM ubuntu:20.04",
138+
dockerfile="FROM ubuntu:22.04",
139139
metadata=metadata,
140140
)
141141

@@ -168,7 +168,7 @@ def test_get_blueprint_by_id(self, sdk_client: RunloopSDK) -> None:
168168
# Create a blueprint
169169
created = sdk_client.blueprint.create(
170170
name=unique_name("sdk-blueprint-retrieve"),
171-
dockerfile="FROM ubuntu:20.04",
171+
dockerfile="FROM ubuntu:22.04",
172172
)
173173

174174
try:
@@ -190,7 +190,7 @@ def test_list_blueprints_by_name(self, sdk_client: RunloopSDK) -> None:
190190
# Create a blueprint with a specific name
191191
blueprint = sdk_client.blueprint.create(
192192
name=blueprint_name,
193-
dockerfile="FROM ubuntu:20.04",
193+
dockerfile="FROM ubuntu:22.04",
194194
)
195195

196196
try:
@@ -216,7 +216,7 @@ def test_create_devbox_from_blueprint(self, sdk_client: RunloopSDK) -> None:
216216
# Create a blueprint
217217
blueprint = sdk_client.blueprint.create(
218218
name=unique_name("sdk-blueprint-for-devbox"),
219-
dockerfile="FROM ubuntu:20.04\nRUN apt-get update && apt-get install -y python3",
219+
dockerfile="FROM ubuntu:22.04\nRUN apt-get update && apt-get install -y python3",
220220
)
221221

222222
try:
@@ -255,7 +255,7 @@ def test_blueprint_invalid_dockerfile(self, sdk_client: RunloopSDK) -> None:
255255
try:
256256
blueprint = sdk_client.blueprint.create(
257257
name=unique_name("sdk-blueprint-invalid"),
258-
dockerfile="FROM ubuntu:20.04\nRUN INVALID_COMMAND_THAT_DOES_NOT_EXIST",
258+
dockerfile="FROM ubuntu:22.04\nRUN INVALID_COMMAND_THAT_DOES_NOT_EXIST",
259259
)
260260
# If it somehow succeeds, verify it failed during build
261261
info = blueprint.get_info()

tests/smoketests/sdk/test_devbox.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ def test_resume_async(self, sdk_client: RunloopSDK) -> None:
364364
name=unique_name("sdk-devbox-resume-async"),
365365
launch_parameters={"resource_size_request": "SMALL", "keep_alive_time_seconds": 60 * 5},
366366
)
367+
# wait for devbox to be running
368+
devbox.await_running(polling_config=PollingConfig(timeout_seconds=120.0, interval_seconds=5.0))
367369

368370
try:
369371
# Suspend the devbox
@@ -463,7 +465,7 @@ def test_create_from_blueprint_id(self, sdk_client: RunloopSDK) -> None:
463465
# First create a blueprint
464466
blueprint = sdk_client.blueprint.create(
465467
name=unique_name("sdk-blueprint-for-devbox"),
466-
dockerfile="FROM ubuntu:20.04\nRUN apt-get update && apt-get install -y curl",
468+
dockerfile="FROM ubuntu:22.04\nRUN apt-get update && apt-get install -y curl",
467469
)
468470

469471
try:
@@ -491,7 +493,7 @@ def test_create_from_blueprint_name(self, sdk_client: RunloopSDK) -> None:
491493
# Create blueprint
492494
blueprint = sdk_client.blueprint.create(
493495
name=blueprint_name,
494-
dockerfile="FROM ubuntu:20.04\nRUN apt-get update && apt-get install -y wget",
496+
dockerfile="FROM ubuntu:22.04\nRUN apt-get update && apt-get install -y wget",
495497
)
496498

497499
try:

tests/smoketests/sdk/test_network_policy.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,9 @@ def test_network_policy_delete(self, sdk_client: RunloopSDK) -> None:
8888
allowed_hostnames=["example.com"],
8989
)
9090

91-
policy_id = network_policy.id
9291
result = network_policy.delete()
9392

9493
assert result is not None
95-
# Verify it's deleted
96-
info = sdk_client.api.network_policies.retrieve(policy_id)
97-
assert info.id == policy_id
9894

9995

10096
class TestNetworkPolicyCreationVariations:

tests/smoketests/sdk/test_scenario.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def test_scenario_builder_with_blueprint(self, sdk_client: RunloopSDK) -> None:
206206
"""Test creating/updating a scenario from a blueprint."""
207207
blueprint = sdk_client.blueprint.create(
208208
name=unique_name("sdk-smoketest-scenario-bp"),
209-
dockerfile="FROM ubuntu:20.04",
209+
dockerfile="FROM ubuntu:22.04",
210210
)
211211

212212
builder = (
@@ -232,7 +232,7 @@ def test_scenario_builder_with_snapshot(self, sdk_client: RunloopSDK) -> None:
232232
# Create blueprint -> devbox -> snapshot chain
233233
blueprint = sdk_client.blueprint.create(
234234
name=unique_name("sdk-smoketest-scenario-snap-bp"),
235-
dockerfile="FROM ubuntu:20.04",
235+
dockerfile="FROM ubuntu:22.04",
236236
)
237237
devbox = sdk_client.devbox.create(blueprint_id=blueprint.id)
238238
snapshot = devbox.snapshot_disk(name=unique_name("sdk-smoketest-scenario-snap"))

0 commit comments

Comments
 (0)