File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ class GraphParser:
186186
187187 # Match @xtriggers.
188188 REC_XTRIG = re .compile (r'@[\w\-+%]+' )
189- REC_XTRIG_OR = re .compile (r'@.*\s*\|\s *@.*' )
189+ REC_XTRIG_OR = re .compile (r'@.*\|.*|.*\|. *@.*' )
190190
191191 # Match fully qualified parameterized single nodes.
192192 REC_NODE_FULL = re .compile (
Original file line number Diff line number Diff line change 3535from cylc .flow .pathutil import get_workflow_run_pub_db_path
3636
3737Fixture = Any
38+ param = pytest .param
3839
3940
4041@pytest .mark .parametrize (
@@ -489,9 +490,20 @@ def test_xtrig_signature_validation(
489490 validate (id_ )
490491
491492
493+ @pytest .mark .parametrize (
494+ 'left' ,
495+ (
496+ param ('@xrandom | @echo' , id = 'xtrig-or-xtrig' ),
497+ param ('@xrandom | task' , id = 'xtrig-or-task' ),
498+ param ('task | @echo' , id = 'task-or-xtrig' ),
499+ param ('@xrandom | foo & bar' , id = 'xtrig-or-complex' ),
500+ param ('@xrandom & bar | foo' , id = 'complex-or-xtrig' ),
501+ )
502+ )
492503def test_xtrig_or_fails_validation (
493504 flow : "Fixture" ,
494505 validate : "Fixture" ,
506+ left : str
495507):
496508 """Xtriggers cannot be chained with the 'or'
497509
@@ -506,7 +518,7 @@ def test_xtrig_or_fails_validation(
506518 "xrandom" : "xrandom(100)" ,
507519 "echo" : "echo(succeed=True)"
508520 },
509- "graph" : {"R1" : "@xrandom | @echo => foo " },
521+ "graph" : {"R1" : f" { left } => fin " },
510522 }
511523 }
512524 )
You can’t perform that action at this time.
0 commit comments