Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
1ntEgr8 committed Nov 22, 2024
1 parent bf658fe commit 7873e73
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions tests/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,7 @@ def test_service():
r"Registered worker \(id=1234, name=test_worker\)", response.message
)

# Register an incorrect TaskGraph
request = erdos_scheduler_pb2.RegisterTaskGraphRequest(
id="task-graph",
name="TPCH Query 4 50 50",
timestamp=1234567890,
dependencies=[
{"key": {"id": 0, "name": "stage 0"}, "children_ids": [1, 2]},
],
)
response = stub.RegisterTaskGraph(request)
assert not response.success and re.search(
r"Failed to load TPCH query 4. Exception: Structure of dependencies provided for query number 4 does not match that of canonical dependencies",
response.message,
)


# Try to fetch placements for an unregistered task graph
# Get placements for the task, should be empty
request = erdos_scheduler_pb2.GetPlacementsRequest(
Expand All @@ -73,6 +59,22 @@ def test_service():
response.message,
)

# TODO: move to environment ready
# Register an incorrect TaskGraph
# request = erdos_scheduler_pb2.RegisterTaskGraphRequest(
# id="task-graph",
# name="TPCH Query 4 50 50",
# timestamp=1234567890,
# dependencies=[
# {"key": {"id": 0, "name": "stage 0"}, "children_ids": [1, 2]},
# ],
# )
# response = stub.RegisterTaskGraph(request)
# assert not response.success and re.search(
# r"Failed to load TPCH query 4. Exception: Structure of dependencies provided for query number 4 does not match that of canonical dependencies",
# response.message,
# )

# Register a correct TaskGraph
request = erdos_scheduler_pb2.RegisterTaskGraphRequest(
id="task-graph-0",
Expand All @@ -90,7 +92,7 @@ def test_service():
assert (
response.success
and re.search(
r"Registered task graph 'Q4\[task-graph-0\]@1' successfully",
r"Registered task graph 'task-graph-0' successfully",
response.message,
)
and response.num_executors == 10
Expand Down

0 comments on commit 7873e73

Please sign in to comment.