Support comments in ansible-test flat files.

This commit is contained in:
Matt Clay 2018-09-19 23:20:27 -07:00
parent cb4bf04be6
commit 5a3000af19
13 changed files with 135 additions and 96 deletions

View file

@ -17,6 +17,7 @@ from lib.util import (
run_command,
display,
find_python,
read_lines_without_comments,
)
from lib.config import (
@ -37,12 +38,10 @@ class CompileTest(SanityMultipleVersion):
:type python_version: str
:rtype: TestResult
"""
# optional list of regex patterns to exclude from tests
skip_file = 'test/sanity/compile/python%s-skip.txt' % python_version
if os.path.exists(skip_file):
with open(skip_file, 'r') as skip_fd:
skip_paths = skip_fd.read().splitlines()
skip_paths = read_lines_without_comments(skip_file)
else:
skip_paths = []
@ -87,6 +86,9 @@ class CompileTest(SanityMultipleVersion):
for path in skip_paths:
line += 1
if not path:
continue
if not os.path.exists(path):
# Keep files out of the list which no longer exist in the repo.
results.append(SanityMessage(