Overhaul additional sanity tests. (#36803)

* Remove unnecessary sys.exit calls.
* Add files filtering for code-smell tests.
* Enhance test-constraints code-smell test.
* Simplify compile sanity test.
* Pass paths to importer on stdin.
* Pass paths to yamllinter on stdin.
* Add work-around for unicode path filtering.
* Enhance configure-remoting-ps1 code-smell test.
* Enhance integration-aliases code-smell test.
* Enhance azure-requirements code-smell test.
* Enhance no-illegal-filenames code-smell test.
This commit is contained in:
Matt Clay 2018-02-27 15:05:39 -08:00 committed by GitHub
parent 5b5a79917d
commit ac1698099d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 153 additions and 208 deletions

View file

@ -17,6 +17,7 @@ from lib.util import (
run_command,
intercept_command,
remove_tree,
display,
)
from lib.ansible_util import (
@ -88,12 +89,17 @@ class ImportTest(SanityMultipleVersion):
run_command(args, ['pip', 'uninstall', '--disable-pip-version-check', '-y', 'setuptools'], env=env)
run_command(args, ['pip', 'uninstall', '--disable-pip-version-check', '-y', 'pip'], env=env)
cmd = ['importer.py'] + paths
cmd = ['importer.py']
data = '\n'.join(paths)
display.info(data, verbosity=4)
results = []
try:
stdout, stderr = intercept_command(args, cmd, target_name=self.name, env=env, capture=True, python_version=python_version, path=env['PATH'])
stdout, stderr = intercept_command(args, cmd, data=data, target_name=self.name, env=env, capture=True, python_version=python_version,
path=env['PATH'])
if stdout or stderr:
raise SubprocessError(cmd, stdout=stdout, stderr=stderr)