checkpoint!
This commit is contained in:
36
reproduce_issue.py
Normal file
36
reproduce_issue.py
Normal file
@@ -0,0 +1,36 @@
|
||||
import pytest
|
||||
from models import Ticket
|
||||
from dag_engine import TrackDAG, ExecutionEngine
|
||||
|
||||
def test_auto_queue_and_step_mode():
|
||||
t1 = Ticket(id="T1", description="Task 1", status="todo", assigned_to="worker")
|
||||
t2 = Ticket(id="T2", description="Task 2", status="todo", assigned_to="worker", step_mode=True)
|
||||
|
||||
dag = TrackDAG([t1, t2])
|
||||
# Expectation: ExecutionEngine takes auto_queue parameter
|
||||
try:
|
||||
engine = ExecutionEngine(dag, auto_queue=True)
|
||||
except TypeError:
|
||||
pytest.fail("ExecutionEngine does not accept auto_queue parameter")
|
||||
|
||||
# Tick 1: T1 should be 'in-progress' because auto_queue=True
|
||||
# T2 should remain 'todo' because step_mode=True
|
||||
engine.tick()
|
||||
|
||||
assert t1.status == "in_progress"
|
||||
assert t2.status == "todo"
|
||||
|
||||
# Approve T2
|
||||
try:
|
||||
engine.approve_task("T2")
|
||||
except AttributeError:
|
||||
pytest.fail("ExecutionEngine does not have approve_task method")
|
||||
|
||||
assert t2.status == "in_progress"
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
test_auto_queue_and_step_mode()
|
||||
print("Test passed (unexpectedly)")
|
||||
except Exception as e:
|
||||
print(f"Test failed as expected: {e}")
|
||||
Reference in New Issue
Block a user