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:
186
186
187
187
# Match @xtriggers.
188
188
REC_XTRIG = re .compile (r'@[\w\-+%]+' )
189
- REC_XTRIG_OR = re .compile (r'@.*\s*\|\s *@.*' )
189
+ REC_XTRIG_OR = re .compile (r'@.*\|.*|.*\|. *@.*' )
190
190
191
191
# Match fully qualified parameterized single nodes.
192
192
REC_NODE_FULL = re .compile (
Original file line number Diff line number Diff line change 35
35
from cylc .flow .pathutil import get_workflow_run_pub_db_path
36
36
37
37
Fixture = Any
38
+ param = pytest .param
38
39
39
40
40
41
@pytest .mark .parametrize (
@@ -489,9 +490,20 @@ def test_xtrig_signature_validation(
489
490
validate (id_ )
490
491
491
492
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
+ )
492
503
def test_xtrig_or_fails_validation (
493
504
flow : "Fixture" ,
494
505
validate : "Fixture" ,
506
+ left : str
495
507
):
496
508
"""Xtriggers cannot be chained with the 'or'
497
509
@@ -506,7 +518,7 @@ def test_xtrig_or_fails_validation(
506
518
"xrandom" : "xrandom(100)" ,
507
519
"echo" : "echo(succeed=True)"
508
520
},
509
- "graph" : {"R1" : "@xrandom | @echo => foo " },
521
+ "graph" : {"R1" : f" { left } => fin " },
510
522
}
511
523
}
512
524
)
You can’t perform that action at this time.
0 commit comments