Skip to content

Commit ca46354

Browse files
author
Alan Christie
committed
fix: Test options can now be arrays
1 parent b949459 commit ca46354

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

decoder/job-definition-schema.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ definitions:
388388
type: string
389389

390390
# A test option
391+
# Arrays are assumed to be arrays of strings.
391392
test-option:
392393
type: object
393394
additionalProperties: false
@@ -397,6 +398,7 @@ definitions:
397398
- type: string
398399
- type: number
399400
- type: boolean
401+
- type: array
400402

401403
# Test output checks
402404
test-checks-output:

tests/test_validate_job_schema.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,20 @@ def test_validate_two_basic_tests():
206206

207207
# Assert
208208
assert error is None
209+
210+
211+
def test_validate_test_option_array():
212+
# Arrange
213+
text: Dict[str, Any] = deepcopy(_MINIMAL)
214+
demo_job: Dict[str, Any] = text["jobs"]["demo"]
215+
demo_job["tests"] = {
216+
"option-array": {
217+
"options": {"param-array": ["a", "b"]},
218+
},
219+
}
220+
221+
# Act
222+
error = decoder.validate_job_schema(text)
223+
224+
# Assert
225+
assert error is None

0 commit comments

Comments
 (0)