1
0
Fork 0
mirror of synced 2024-11-17 06:45:33 -05:00

Validate yaml files with yamllint

This commit is contained in:
Tim Byrne 2019-03-21 07:38:38 -05:00
parent ca2f93146d
commit 826f9bc09e
No known key found for this signature in database
GPG key ID: 14DB4FC2465A4B12
3 changed files with 20 additions and 2 deletions

View file

@ -27,9 +27,10 @@ RUN \
;
RUN pip3 install \
envtpl \
pytest==3.6.4 \
pylint==1.9.2 \
flake8==3.5.0 \
pylint==1.9.2 \
pytest==3.6.4 \
yamllint==1.15.0 \
;
# Force GNUPG version 1 at path /usr/bin/gpg

View file

@ -28,6 +28,12 @@ def flake8_version():
return '3.5.0'
@pytest.fixture(scope='session')
def yamllint_version():
"""Version of yamllint supported"""
return '1.15.0'
@pytest.fixture(scope='session')
def tst_user():
"""Test session's user id"""

View file

@ -39,3 +39,14 @@ def test_flake8(runner, flake8_version):
pytest.skip('Unsupported flake8 version')
run = runner(command=['flake8', 'test'])
assert run.success
def test_yamllint(runner, yamllint_version):
"""Passes yamllint"""
run = runner(command=['yamllint', '--version'], report=False)
if not run.out.strip().endswith(yamllint_version):
pytest.skip('Unsupported yamllint version')
run = runner(
command=['yamllint', '-s', '$(find . -name \\*.yml)'],
shell=True)
assert run.success