@@ -43,6 +43,9 @@ func TestYamlDocument_parseSingleJobReference(t *testing.T) {
43
43
- test:
44
44
requires:
45
45
- setup: [success, canceled]`
46
+ const jobRef7 = `
47
+ - deploy:
48
+ serial-group: deploy-group`
46
49
47
50
type fields struct {
48
51
Content []byte
@@ -415,6 +418,59 @@ func TestYamlDocument_parseSingleJobReference(t *testing.T) {
415
418
Parameters : make (map [string ]ast.ParameterValue ),
416
419
},
417
420
},
421
+ {
422
+ name : "Job reference with serial group" ,
423
+ fields : fields {Content : []byte (jobRef7 )},
424
+ args : args {jobRefNode : getFirstChildOfType (GetRootNode ([]byte (jobRef7 )), "block_sequence_item" )},
425
+ want : ast.JobRef {
426
+ JobName : "deploy" ,
427
+ JobRefRange : protocol.Range {
428
+ Start : protocol.Position {
429
+ Line : 1 ,
430
+ Character : 0 ,
431
+ },
432
+ End : protocol.Position {
433
+ Line : 2 ,
434
+ Character : 30 ,
435
+ },
436
+ },
437
+ JobNameRange : protocol.Range {
438
+ Start : protocol.Position {
439
+ Line : 1 ,
440
+ Character : 2 ,
441
+ },
442
+ End : protocol.Position {
443
+ Line : 1 ,
444
+ Character : 8 ,
445
+ },
446
+ },
447
+ StepName : "deploy" ,
448
+ StepNameRange : protocol.Range {
449
+ Start : protocol.Position {
450
+ Line : 1 ,
451
+ Character : 2 ,
452
+ },
453
+ End : protocol.Position {
454
+ Line : 1 ,
455
+ Character : 8 ,
456
+ },
457
+ },
458
+ Parameters : make (map [string ]ast.ParameterValue ),
459
+ HasMatrix : false ,
460
+ MatrixParams : make (map [string ][]ast.ParameterValue ),
461
+ SerialGroup : "deploy-group" ,
462
+ SerialGroupRange : protocol.Range {
463
+ Start : protocol.Position {
464
+ Line : 2 ,
465
+ Character : 18 ,
466
+ },
467
+ End : protocol.Position {
468
+ Line : 2 ,
469
+ Character : 30 ,
470
+ },
471
+ },
472
+ },
473
+ },
418
474
}
419
475
for _ , tt := range tests {
420
476
t .Run (tt .name , func (t * testing.T ) {
0 commit comments