Pipelines: cancel a run, look up a workload's step, keep cancelled runs cancelled

This commit is contained in:
claude authored and rektdie committed 2026-10-11 22:28:16 +02:00
1 parent 2b80f804af
commit 71b4803120
4 files changed
+179 -7

No files matched your search

+23
View File
@@ -312,6 +312,29 @@ class PlanTests(unittest.TestCase):
plan.fires[0].payload['priority'] = '99'
self.assertEqual(graph['steps']['ltc']['payload']['priority'], '0')
class FollowedEdgesTests(unittest.TestCase):
def test_only_the_edges_that_were_gone_along(self):
graph = stc_then_ltc()
self.assertEqual(followed_edges(graph, [('stc', 'ltc', 'passed')]), { 0 })
self.assertEqual(followed_edges(graph, [('stc', 'retry', 'failed')]), { 1 })
def test_nothing_followed_yet(self):
self.assertEqual(followed_edges(stc_then_ltc(), []), set())
def test_the_outcome_has_to_match_the_edge(self):
# stc -> ltc is only for a pass, so a fail that reached ltc some other way is not it
self.assertEqual(followed_edges(stc_then_ltc(), [('stc', 'ltc', 'failed')]), set())
def test_an_any_edge_matches_every_outcome(self):
graph = stc_then_ltc(); graph['edges'] = [{ 'from' : 'stc', 'on' : 'any', 'to' : 'ltc' }]
for outcome in OUTCOMES:
self.assertEqual(followed_edges(graph, [('stc', 'ltc', outcome)]), { 0 })
def test_a_loop_is_one_edge_however_often_it_is_gone_along(self):
graph = stc_then_ltc(); graph['edges'][1]['to'] = 'stc'
self.assertEqual(followed_edges(graph, [('stc', 'stc', 'failed')] * 3), { 1 })
class RunStatusTests(unittest.TestCase):
def test_status(self):