Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit 67d947c

Browse files
committed
Fix broken tests due to field name change and status not being correct
1 parent 5ce073d commit 67d947c

5 files changed

Lines changed: 12 additions & 2 deletions

File tree

packages/jumpstarter-testing/jumpstarter_testing/pytest_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from jumpstarter_driver_power.driver import MockPower
22
from pytest import Pytester
33

4+
from jumpstarter.common import ExporterStatus
45
from jumpstarter.config.env import JMP_DRIVERS_ALLOW, JUMPSTARTER_HOST
56
from jumpstarter.exporter import Session
67

@@ -18,6 +19,8 @@ def test_simple(self, client):
1819

1920
with Session(root_device=MockPower()) as session:
2021
with session.serve_unix() as path:
22+
# For local testing, set status to LEASE_READY since there's no lease/hook flow
23+
session.update_status(ExporterStatus.LEASE_READY)
2124
monkeypatch.setenv(JUMPSTARTER_HOST, str(path))
2225
monkeypatch.setenv(JMP_DRIVERS_ALLOW, "UNSAFE")
2326
result = pytester.runpytest()

packages/jumpstarter/jumpstarter/client/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async def check_exporter_status(self):
8989
status = ExporterStatus.from_proto(response.status)
9090

9191
if status != ExporterStatus.LEASE_READY:
92-
raise ExporterNotReady(f"Exporter status is {status}: {response.status_message}")
92+
raise ExporterNotReady(f"Exporter status is {status}: {response.message}")
9393

9494
except AioRpcError as e:
9595
# If GetStatus is not implemented, assume ready for backward compatibility

packages/jumpstarter/jumpstarter/common/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@
2222

2323
@asynccontextmanager
2424
async def serve_async(root_device: "Driver", portal: BlockingPortal, stack: ExitStack):
25+
from jumpstarter.common import ExporterStatus
26+
2527
with Session(root_device=root_device) as session:
2628
async with session.serve_unix_async() as path:
29+
# For local testing, set status to LEASE_READY since there's no lease/hook flow
30+
session.update_status(ExporterStatus.LEASE_READY)
2731
# SAFETY: the root_device instance is constructed locally thus considered trusted
2832
async with client_from_path(path, portal, stack, allow=[], unsafe=True) as client:
2933
try:

packages/jumpstarter/jumpstarter/config/exporter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ def delete(cls, alias: str) -> Path:
183183
@asynccontextmanager
184184
async def serve_unix_async(self):
185185
# dynamic import to avoid circular imports
186+
from jumpstarter.common import ExporterStatus
186187
from jumpstarter.exporter import Session
187188

188189
with Session(
@@ -193,6 +194,8 @@ async def serve_unix_async(self):
193194
).instantiate(),
194195
) as session:
195196
async with session.serve_unix_async() as path:
197+
# For local usage, set status to LEASE_READY since there's no lease/hook flow
198+
session.update_status(ExporterStatus.LEASE_READY)
196199
yield path
197200

198201
@contextmanager

packages/jumpstarter/jumpstarter/exporter/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,5 @@ async def GetStatus(self, request, context):
174174
logger.debug("GetStatus() -> %s", self._current_status)
175175
return jumpstarter_pb2.GetStatusResponse(
176176
status=self._current_status.to_proto(),
177-
status_message=self._status_message,
177+
message=self._status_message,
178178
)

0 commit comments

Comments
 (0)