@@ -36,6 +36,9 @@ public function testValidJobMaximal(): void
3636 'parallelism ' => null ,
3737 'type ' => 'standard ' ,
3838 'branchType ' => BranchType::DEFAULT ->value ,
39+ 'orchestrationTaskId ' => '123 ' ,
40+ 'onlyOrchestrationTaskIds ' => ['45 ' , '67 ' ],
41+ 'previousJobId ' => '789 ' ,
3942 ];
4043 $ definition = new FullJobDefinition ();
4144 $ processedData = $ definition ->processData ($ expectedData );
@@ -93,6 +96,9 @@ public function testValidJobFull(): void
9396 'orchestrationJobId ' => '123456789 ' ,
9497 'runnerId ' => $ runnerId ,
9598 'branchType ' => 'dev ' ,
99+ 'orchestrationTaskId ' => null ,
100+ 'onlyOrchestrationTaskIds ' => null ,
101+ 'previousJobId ' => null ,
96102 ];
97103 unset($ data ['extraKey ' ]);
98104 unset($ data ['backend ' ]['backendExtraKey ' ]);
@@ -403,6 +409,150 @@ public function invalidJobProvider(): array
403409 ],
404410 '#The value "invalid" is not allowed for path "job.branchType". Permissible values: "default", "dev"# ' ,
405411 ],
412+ 'orchestrationTaskId not string ' => [
413+ [
414+ '#tokenString ' => getenv ('TEST_STORAGE_API_TOKEN ' ),
415+ 'id ' => '12345 ' ,
416+ 'runId ' => '12345 ' ,
417+ 'tokenId ' => '1234 ' ,
418+ 'projectId ' => '123 ' ,
419+ 'status ' => 'created ' ,
420+ 'desiredStatus ' => 'processing ' ,
421+ 'configId ' => '123 ' ,
422+ 'componentId ' => 'keboola.test ' ,
423+ 'mode ' => 'run ' ,
424+ 'orchestrationTaskId ' => 134 ,
425+ ],
426+ '/Invalid configuration for path "job.orchestrationTaskId": value must be a string/ ' ,
427+ ],
428+ 'orchestrationTaskId empty string ' => [
429+ [
430+ '#tokenString ' => getenv ('TEST_STORAGE_API_TOKEN ' ),
431+ 'id ' => '12345 ' ,
432+ 'runId ' => '12345 ' ,
433+ 'tokenId ' => '1234 ' ,
434+ 'projectId ' => '123 ' ,
435+ 'status ' => 'created ' ,
436+ 'desiredStatus ' => 'processing ' ,
437+ 'configId ' => '123 ' ,
438+ 'componentId ' => 'keboola.test ' ,
439+ 'mode ' => 'run ' ,
440+ 'orchestrationTaskId ' => '' ,
441+ ],
442+ '/Invalid configuration for path "job.orchestrationTaskId": value cannot be empty string/ ' ,
443+ ],
444+ 'onlyOrchestrationTaskIds not list ' => [
445+ [
446+ '#tokenString ' => getenv ('TEST_STORAGE_API_TOKEN ' ),
447+ 'id ' => '12345 ' ,
448+ 'runId ' => '12345 ' ,
449+ 'tokenId ' => '1234 ' ,
450+ 'projectId ' => '123 ' ,
451+ 'status ' => 'created ' ,
452+ 'desiredStatus ' => 'processing ' ,
453+ 'configId ' => '123 ' ,
454+ 'componentId ' => 'keboola.test ' ,
455+ 'mode ' => 'run ' ,
456+ 'onlyOrchestrationTaskIds ' => '123 ' ,
457+ ],
458+ '/Invalid configuration for path "job.onlyOrchestrationTaskIds": value must be an array/ ' ,
459+ ],
460+ 'onlyOrchestrationTaskIds empty list ' => [
461+ [
462+ '#tokenString ' => getenv ('TEST_STORAGE_API_TOKEN ' ),
463+ 'id ' => '12345 ' ,
464+ 'runId ' => '12345 ' ,
465+ 'tokenId ' => '1234 ' ,
466+ 'projectId ' => '123 ' ,
467+ 'status ' => 'created ' ,
468+ 'desiredStatus ' => 'processing ' ,
469+ 'configId ' => '123 ' ,
470+ 'componentId ' => 'keboola.test ' ,
471+ 'mode ' => 'run ' ,
472+ 'onlyOrchestrationTaskIds ' => [],
473+ ],
474+ '/Invalid configuration for path "job.onlyOrchestrationTaskIds": value cannot be empty list/ ' ,
475+ ],
476+ 'onlyOrchestrationTaskIds with non-string item ' => [
477+ [
478+ '#tokenString ' => getenv ('TEST_STORAGE_API_TOKEN ' ),
479+ 'id ' => '12345 ' ,
480+ 'runId ' => '12345 ' ,
481+ 'tokenId ' => '1234 ' ,
482+ 'projectId ' => '123 ' ,
483+ 'status ' => 'created ' ,
484+ 'desiredStatus ' => 'processing ' ,
485+ 'configId ' => '123 ' ,
486+ 'componentId ' => 'keboola.test ' ,
487+ 'mode ' => 'run ' ,
488+ 'onlyOrchestrationTaskIds ' => [123 ],
489+ ],
490+ '/Invalid configuration for path "job.onlyOrchestrationTaskIds": items must be strings/ ' ,
491+ ],
492+ 'onlyOrchestrationTaskIds with null item ' => [
493+ [
494+ '#tokenString ' => getenv ('TEST_STORAGE_API_TOKEN ' ),
495+ 'id ' => '12345 ' ,
496+ 'runId ' => '12345 ' ,
497+ 'tokenId ' => '1234 ' ,
498+ 'projectId ' => '123 ' ,
499+ 'status ' => 'created ' ,
500+ 'desiredStatus ' => 'processing ' ,
501+ 'configId ' => '123 ' ,
502+ 'componentId ' => 'keboola.test ' ,
503+ 'mode ' => 'run ' ,
504+ 'onlyOrchestrationTaskIds ' => [null ],
505+ ],
506+ '/Invalid configuration for path "job.onlyOrchestrationTaskIds": items must be strings/ ' ,
507+ ],
508+ 'onlyOrchestrationTaskIds with empty item ' => [
509+ [
510+ '#tokenString ' => getenv ('TEST_STORAGE_API_TOKEN ' ),
511+ 'id ' => '12345 ' ,
512+ 'runId ' => '12345 ' ,
513+ 'tokenId ' => '1234 ' ,
514+ 'projectId ' => '123 ' ,
515+ 'status ' => 'created ' ,
516+ 'desiredStatus ' => 'processing ' ,
517+ 'configId ' => '123 ' ,
518+ 'componentId ' => 'keboola.test ' ,
519+ 'mode ' => 'run ' ,
520+ 'onlyOrchestrationTaskIds ' => ['' ],
521+ ],
522+ '/Invalid configuration for path "job.onlyOrchestrationTaskIds": item cannot be empty string/ ' ,
523+ ],
524+ 'previousJobId not string ' => [
525+ [
526+ '#tokenString ' => getenv ('TEST_STORAGE_API_TOKEN ' ),
527+ 'id ' => '12345 ' ,
528+ 'runId ' => '12345 ' ,
529+ 'tokenId ' => '1234 ' ,
530+ 'projectId ' => '123 ' ,
531+ 'status ' => 'created ' ,
532+ 'desiredStatus ' => 'processing ' ,
533+ 'configId ' => '123 ' ,
534+ 'componentId ' => 'keboola.test ' ,
535+ 'mode ' => 'run ' ,
536+ 'previousJobId ' => 134 ,
537+ ],
538+ '/Invalid configuration for path "job.previousJobId": value must be a string/ ' ,
539+ ],
540+ 'previousJobId empty string ' => [
541+ [
542+ '#tokenString ' => getenv ('TEST_STORAGE_API_TOKEN ' ),
543+ 'id ' => '12345 ' ,
544+ 'runId ' => '12345 ' ,
545+ 'tokenId ' => '1234 ' ,
546+ 'projectId ' => '123 ' ,
547+ 'status ' => 'created ' ,
548+ 'desiredStatus ' => 'processing ' ,
549+ 'configId ' => '123 ' ,
550+ 'componentId ' => 'keboola.test ' ,
551+ 'mode ' => 'run ' ,
552+ 'previousJobId ' => '' ,
553+ ],
554+ '/Invalid configuration for path "job.previousJobId": value cannot be empty string/ ' ,
555+ ],
406556 ];
407557 }
408558
0 commit comments