summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoofar <toofar@spalge.com>2023-07-23 18:17:37 +1200
committertoofar <toofar@spalge.com>2023-10-28 08:47:34 +1300
commit2190cfb6aeae3e08e295eea92d600b67bf153db6 (patch)
treeaf48784c336d9462e9fd71bc1c7ad58150cd0e53
parent4947fa9ec672c8b51fedf2cdb0594cd6deaef66f (diff)
downloadqutebrowser-2190cfb6aeae3e08e295eea92d600b67bf153db6.tar.gz
qutebrowser-2190cfb6aeae3e08e295eea92d600b67bf153db6.zip
Don't raise on failed smoke test exit code
Because we don't catch the exception and then the whole script bails out so we don't end up printing the error log from the process. Keep raising on --debug just to maintain the behaviour, eg fail the build if the process fails. I'm not sure we actually want this behaviour though. As it is we won't get the output printed out on failed debug builds. So maybe we shouldn't be skipping the output check? I don't quite get what the intention is here.
-rwxr-xr-xscripts/dev/build_release.py30
1 files changed, 14 insertions, 16 deletions
diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py
index 953a2a1be..50f27720a 100755
--- a/scripts/dev/build_release.py
+++ b/scripts/dev/build_release.py
@@ -110,6 +110,7 @@ def _filter_whitelisted(output: bytes, patterns: Iterable[str]) -> Iterable[str]
def _smoke_test_run(
executable: pathlib.Path,
*args: str,
+ capture_output: bool=True
) -> subprocess.CompletedProcess:
"""Get a subprocess to run a smoke test."""
argv = [
@@ -121,7 +122,7 @@ def _smoke_test_run(
'about:blank',
':cmd-later 500 quit',
]
- return subprocess.run(argv, capture_output=True)
+ return subprocess.run(argv, check=False, capture_output=capture_output)
def smoke_test(executable: pathlib.Path, debug: bool, qt5: bool) -> None:
@@ -181,25 +182,22 @@ def smoke_test(executable: pathlib.Path, debug: bool, qt5: bool) -> None:
r'module could not be found. \(0x7E\)'),
])
- proc = _smoke_test_run(executable)
+ proc = _smoke_test_run(executable, capture_output=not debug)
+ if debug:
+ print("Skipping output check for debug build")
+ proc.check_returncode()
+ return
stdout = '\n'.join(_filter_whitelisted(proc.stdout, stdout_whitelist))
stderr = '\n'.join(_filter_whitelisted(proc.stderr, stderr_whitelist))
- if stdout or stderr or proc.returncode > 0:
- if debug:
- print(
- f"Unexpected output (errno={proc.returncode})"
- )
- debug_stdout = None
- debug_stderr = None
- else:
- print(
- f"Unexpected output, running with --debug (errno={proc.returncode})"
- )
- proc = _smoke_test_run(executable, '--debug')
- debug_stdout = proc.stdout.decode('utf-8')
- debug_stderr = proc.stderr.decode('utf-8')
+ if stdout or stderr or proc.returncode != 0:
+ print(
+ f"Unexpected output, running with --debug (returncode={proc.returncode})"
+ )
+ proc = _smoke_test_run(executable, '--debug')
+ debug_stdout = proc.stdout.decode('utf-8')
+ debug_stderr = proc.stderr.decode('utf-8')
lines = [
"Unexpected output!",