From 8ea0bfe9a3dc77ab2981632a53795c8a0555a7b7 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 24 Jan 2018 10:22:04 -0800 Subject: [PATCH] Miscellaneous test fixes. (#35301) * Add missing pylint test for invalid path. * Fix syntax in integration test. * Use Write-Output in win_script test script. * Fix pylint in explain mode. --- test/integration/targets/uri/files/testserver.ps1 | 2 +- .../targets/win_script/files/space path/test_script.ps1 | 2 +- test/runner/lib/sanity/pylint.py | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/test/integration/targets/uri/files/testserver.ps1 b/test/integration/targets/uri/files/testserver.ps1 index 5a0655516c..6df4bd05f9 100644 --- a/test/integration/targets/uri/files/testserver.ps1 +++ b/test/integration/targets/uri/files/testserver.ps1 @@ -1,5 +1,5 @@ param ( - [int]$port = 8000, + [int]$port = 8000 ) $listener = New-Object Net.HttpListener diff --git a/test/integration/targets/win_script/files/space path/test_script.ps1 b/test/integration/targets/win_script/files/space path/test_script.ps1 index 24e0ab2ed5..10dd9c8c4d 100644 --- a/test/integration/targets/win_script/files/space path/test_script.ps1 +++ b/test/integration/targets/win_script/files/space path/test_script.ps1 @@ -1 +1 @@ -Write-Host "Ansible supports spaces in the path to the script." +Write-Output "Ansible supports spaces in the path to the script." diff --git a/test/runner/lib/sanity/pylint.py b/test/runner/lib/sanity/pylint.py index e07d51f9f9..9715fb69dc 100644 --- a/test/runner/lib/sanity/pylint.py +++ b/test/runner/lib/sanity/pylint.py @@ -91,6 +91,10 @@ class PylintTest(SanitySingleVersion): path, code = ignore_entry.split(' ', 1) + if not os.path.exists(path): + invalid_ignores.append((line, 'Remove "%s" since it does not exist' % path)) + continue + if ' ' in code: code, version = code.split(' ', 1) @@ -161,6 +165,9 @@ class PylintTest(SanitySingleVersion): code=m['symbol'], ) for m in messages] + if args.explain: + return SanitySuccess(self.name) + line = 0 filtered = []