Add persistent lifecycle checkpoints and resumable inbox processing
This commit is contained in:
1 parent
f832b038a5
commit
e985e1d5f0
15 files changed
+1401
-1
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import pytest
|
||||
|
||||
from viano_bug_analysis.lifecycle import LifecycleError, State
|
||||
from viano_bug_analysis.lifecycle.state import ACTIVE, ORDER, check_transition
|
||||
|
||||
|
||||
@pytest.mark.parametrize("before,after", list(zip(ORDER, ORDER[1:])))
|
||||
def test_forward_transitions(before, after):
|
||||
check_transition(before, after)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("state", list(ACTIVE))
|
||||
def test_block_failure_and_progress_checkpoint(state):
|
||||
check_transition(state, State.BLOCKED)
|
||||
check_transition(state, State.FAILED_TO_ANALYZE)
|
||||
check_transition(state, state)
|
||||
check_transition(State.BLOCKED, state, state)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("before,after", [(State.NEW, State.BUILDING_CASE), (State.HANDED_OFF, State.VALIDATED), (State.BLOCKED, State.INTERPRETING_CASE), (State.FAILED_TO_ANALYZE, State.BUILDING_CASE), (State.OUTPUT_READY, State.NEW)])
|
||||
def test_forbidden_transitions(before, after):
|
||||
with pytest.raises(LifecycleError, match="Cannot transition"):
|
||||
check_transition(before, after)
|
||||
|
||||
|
||||
def test_reopening():
|
||||
check_transition(State.HANDED_OFF, State.REOPENED)
|
||||
check_transition(State.FAILED_TO_ANALYZE, State.REOPENED)
|
||||
check_transition(State.REOPENED, State.BUILDING_CASE)
|
||||
Reference in new issue
Block a user