@@ -8,7 +8,8 @@ $schema: http://json-schema.org/draft-07/schema#
8
8
title : Data Manager Job Definition
9
9
description : >-
10
10
Defines one or more jobs that can be executed
11
- by the Data manager Job Operator
11
+ by the Data manager Job Operator, and tests that can be automated
12
+ by the Job Tester (jote)
12
13
13
14
type : object
14
15
properties :
@@ -91,11 +92,13 @@ definitions:
91
92
type : string
92
93
minLength : 1
93
94
maxLength : 4096
95
+ tests :
96
+ $ref : ' #/definitions/job-test'
94
97
required :
98
+ - name
95
99
- version
96
100
- image
97
101
- command
98
- - name
99
102
100
103
# A Job container image
101
104
# The 'type' is optional and is used to indicate
@@ -159,8 +162,7 @@ definitions:
159
162
environment :
160
163
type : array
161
164
items :
162
- anyOf :
163
- - $ref : ' #/definitions/environment-value-from'
165
+ $ref : ' #/definitions/environment-value-from'
164
166
165
167
# An Image environment from something else.
166
168
environment-value-from :
@@ -260,3 +262,95 @@ definitions:
260
262
minLength : 1
261
263
maxLength : 63
262
264
pattern : ' ^[a-z]([a-z0-9-]*[a-z0-9])?$'
265
+
266
+ # An individual Test.
267
+ # Consists of a identity (i.e. 'test-filter-molecules')
268
+ # followed by a Test object.
269
+ job-test :
270
+ type : object
271
+ additionalProperties : false
272
+ patternProperties :
273
+ ' ^[a-z]{1}[a-z0-9-]{0,79}$ ' :
274
+ $ref : ' #/definitions/test'
275
+ minProperties : 1
276
+
277
+ # An individual Test
278
+ test :
279
+ type : object
280
+ additionalProperties : false
281
+ properties :
282
+ run-level :
283
+ type : integer
284
+ minimum : 1
285
+ maximum : 100
286
+ ignore :
287
+ type : ' null'
288
+ inputs :
289
+ $ref : ' #/definitions/test-input'
290
+ options :
291
+ $ref : ' #/definitions/test-option'
292
+ checks :
293
+ type : object
294
+ properties :
295
+ exitCode :
296
+ type : integer
297
+ outputs :
298
+ type : array
299
+ items :
300
+ $ref : ' #/definitions/test-checks-output'
301
+ required :
302
+ - exitCode
303
+
304
+ # A test input
305
+ test-input :
306
+ type : object
307
+ additionalProperties : false
308
+ patternProperties :
309
+ ' ^[a-zA-Z]{1}[a-zA-Z0-9_-]{0,31}$ ' :
310
+ type : string
311
+
312
+ # A test option
313
+ test-option :
314
+ type : object
315
+ additionalProperties : false
316
+ patternProperties :
317
+ ' ^[a-zA-Z]{1}[a-zA-Z0-9_-]{0,31}$ ' :
318
+ oneOf :
319
+ - type : string
320
+ - type : number
321
+
322
+ # Test output checks
323
+ test-checks-output :
324
+ type : object
325
+ propertiies :
326
+ name :
327
+ type : string
328
+ checks :
329
+ type : array
330
+ items :
331
+ anyOf :
332
+ - $ref : ' #/definitions/test-checks-output-exists'
333
+ - $ref : ' #/definitions/test-checks-output-linecount'
334
+ required :
335
+ - name
336
+
337
+ # A test output check (for a file existing or not existing)
338
+ test-checks-output-exists :
339
+ type : object
340
+ additionalProperties : false
341
+ propertiies :
342
+ exists :
343
+ type : boolean
344
+ required :
345
+ - exists
346
+
347
+ # A test output check (for a file length)
348
+ test-checks-output-linecount :
349
+ type : object
350
+ additionalProperties : false
351
+ propertiies :
352
+ lineCount :
353
+ type : integer
354
+ minimum : 0
355
+ required :
356
+ - lineCount
0 commit comments