Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions unittests/test_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@


import io
import jsonschema
import requests
import yaml

import reframe.frontend.ci as ci
import reframe.frontend.dependencies as dependencies
Expand All @@ -24,9 +26,11 @@ def test_ci_gitlab_pipeline():
)
with io.StringIO() as fp:
ci.emit_pipeline(fp, cases)
yaml = fp.getvalue()
pipeline = fp.getvalue()

response = requests.post('https://gitlab.com/api/v4/ci/lint',
data={'content': {yaml}})
# Fetch the latest Gitlab CI JSON schema
response = requests.get('https://json.schemastore.org/gitlab-ci')
assert response.ok
assert response.json()['status'] == 'valid'

schema = response.json()
jsonschema.validate(yaml.safe_load(pipeline), schema)