scripts: Make smoke test fail output less confusing
This commit is contained in:
parent
edd5114492
commit
f2547f8a09
|
|
@ -208,8 +208,12 @@ def smoke_test(executable: pathlib.Path, debug_build: bool) -> None:
|
||||||
proc = _smoke_test_run(executable)
|
proc = _smoke_test_run(executable)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
print(f"Smoke test failed: {e}, running with --debug")
|
print(f"Smoke test failed: {e}, running with --debug")
|
||||||
smoke_test_debug(executable, original_stdout=e.stdout.decode('utf-8'),
|
smoke_test_debug(
|
||||||
original_stderr=e.stderr.decode('utf-8'))
|
executable,
|
||||||
|
original_stdout=e.stdout.decode("utf-8"),
|
||||||
|
original_stderr=e.stderr.decode("utf-8"),
|
||||||
|
issue_description=str(e),
|
||||||
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
if debug_build:
|
if debug_build:
|
||||||
|
|
@ -221,11 +225,20 @@ def smoke_test(executable: pathlib.Path, debug_build: bool) -> None:
|
||||||
|
|
||||||
if stdout or stderr:
|
if stdout or stderr:
|
||||||
print("Unexpected output, running with --debug")
|
print("Unexpected output, running with --debug")
|
||||||
smoke_test_debug(executable, original_stdout=stdout, original_stderr=stderr)
|
smoke_test_debug(
|
||||||
|
executable,
|
||||||
|
original_stdout=stdout,
|
||||||
|
original_stderr=stderr,
|
||||||
|
issue_description="Unexpected output",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def smoke_test_debug(
|
def smoke_test_debug(
|
||||||
executable: pathlib.Path, *, original_stdout: str, original_stderr: str
|
executable: pathlib.Path,
|
||||||
|
*,
|
||||||
|
original_stdout: str,
|
||||||
|
original_stderr: str,
|
||||||
|
issue_description: str,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Run smoke test in debug mode to get more output."""
|
"""Run smoke test in debug mode to get more output."""
|
||||||
proc = _smoke_test_run(executable, '--debug')
|
proc = _smoke_test_run(executable, '--debug')
|
||||||
|
|
@ -233,7 +246,7 @@ def smoke_test_debug(
|
||||||
debug_stderr = proc.stderr.decode('utf-8')
|
debug_stderr = proc.stderr.decode('utf-8')
|
||||||
|
|
||||||
lines = [
|
lines = [
|
||||||
"Unexpected output!",
|
issue_description,
|
||||||
"",
|
"",
|
||||||
]
|
]
|
||||||
if original_stdout:
|
if original_stdout:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue