Skip to content

Commit

Permalink
feat: Support test-group environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Christie committed Oct 31, 2022
1 parent f9f2775 commit 82a51b8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
15 changes: 15 additions & 0 deletions decoder/job-definition-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,25 @@ definitions:
minimum: 1
required:
- file
environment:
type: array
additionalProperties: false
items:
$ref: '#/definitions/test-group-environment-entry'
required:
- name
additionalProperties: false

test-group-environment-entry:
type: object
patternProperties:
'^[a-zA-Z_]{1,}[a-zA-Z0-9_]{0,}$':
oneOf:
- type: string
- type: number
- type: boolean
additionalProperties: false

# An individual Test.
# Consists of a identity (i.e. 'test-filter-molecules')
# followed by a Test object.
Expand Down
17 changes: 17 additions & 0 deletions tests/test_validate_job_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,23 @@ def test_validate_test_groups():
assert error is None


def test_validate_test_groups_with_environment():
# Arrange
text: Dict[str, Any] = deepcopy(_MINIMAL)
text["test-groups"] = [
{
"name": "demo-1",
"environment": [{"ENV_A": "1"}, {"ENV_B": 2}, {"ENV_C": True}],
}
]

# Act
error = decoder.validate_job_schema(text)

# Assert
assert error is None


def test_validate_test_groups_with_compose():
# Arrange
text: Dict[str, Any] = deepcopy(_MINIMAL)
Expand Down

0 comments on commit 82a51b8

Please sign in to comment.