File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ definitions:
89
89
maxLength : 4096
90
90
tests :
91
91
$ref : ' #/definitions/job-test'
92
+ replaces :
93
+ $ref : ' #/definitions/replace-list'
92
94
required :
93
95
- name
94
96
- version
@@ -328,6 +330,31 @@ definitions:
328
330
maxLength : 63
329
331
pattern : ' ^[a-z]([a-z0-9-]*[a-z0-9])?$'
330
332
333
+ # A 'replaces' object.
334
+ # A job definition can include this 'replaces' list
335
+ # to identify a Job (and collection) it replaces.
336
+ # A job can replace more than one Job, but each jab that's replaced
337
+ # must include the job and collection it belongs to.
338
+ replace-list :
339
+ type : array
340
+ items :
341
+ type : object
342
+ additionalProperties : false
343
+ properties :
344
+ collection :
345
+ type : string
346
+ minLength : 1
347
+ maxLength : 80
348
+ pattern : ' ^[a-z]{1}[a-z0-9-]*$'
349
+ job :
350
+ type : string
351
+ minLength : 1
352
+ maxLength : 80
353
+ pattern : ' ^[a-z]{1}[a-z0-9-]*$'
354
+ required :
355
+ - collection
356
+ - job
357
+
331
358
# Test groups.
332
359
# A list of groups that have a name and optional compose-file.
333
360
test-groups :
Original file line number Diff line number Diff line change @@ -346,3 +346,15 @@ def test_validate_test_run_groups_without_ordinal():
346
346
347
347
# Assert
348
348
assert error == "'ordinal' is a required property"
349
+
350
+
351
+ def test_validate_replaces ():
352
+ text : Dict [str , Any ] = deepcopy (_MINIMAL )
353
+ demo_job : Dict [str , Any ] = text ["jobs" ]["demo" ]
354
+ demo_job ["replaces" ] = [{"collection" : "test-collection" , "job" : "test-job" }]
355
+
356
+ # Act
357
+ error = decoder .validate_job_schema (text )
358
+
359
+ # Assert
360
+ assert error is None
You can’t perform that action at this time.
0 commit comments