Add PSCustomUseLiteralPath and update PSSA for pslint (#54080)

This commit is contained in:
Jordan Borean
2019-03-20 16:26:12 +10:00
committed by GitHub
parent ac6ff8fe05
commit 0bf14d61d0
5 changed files with 140 additions and 16 deletions

View File

@@ -76,18 +76,23 @@ class PslintTest(SanitySingleVersion):
if not find_executable('pwsh', required='warning'):
return SanitySkipped(self.name)
cmd = ['test/sanity/pslint/pslint.ps1'] + paths
# Make sure requirements are installed before running sanity checks
cmds = [
['test/runner/requirements/sanity.ps1'],
['test/sanity/pslint/pslint.ps1'] + paths
]
try:
stdout, stderr = run_command(args, cmd, capture=True)
status = 0
except SubprocessError as ex:
stdout = ex.stdout
stderr = ex.stderr
status = ex.status
for cmd in cmds:
try:
stdout, stderr = run_command(args, cmd, capture=True)
status = 0
except SubprocessError as ex:
stdout = ex.stdout
stderr = ex.stderr
status = ex.status
if stderr:
raise SubprocessError(cmd=cmd, status=status, stderr=stderr, stdout=stdout)
if stderr:
raise SubprocessError(cmd=cmd, status=status, stderr=stderr, stdout=stdout)
if args.explain:
return SanitySuccess(self.name)