Skip to content

Commit adb8d22

Browse files
committed
Don’t print log test log output when running tests in parallel
`swift test --parallel --verbose` prints the entire log output. We were assuming that it did not and re-run `sourcekit-lsp` tests in serial with log output if the parallel test run failed. Suppress `--verbose` on `swift test`. This will cause it to not log any stderr logging output when running in parallel and log all stderr logging output when running in serial.
1 parent b3d2df7 commit adb8d22

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Utilities/build-script-helper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def get_build_target(swift_exec: str, args: argparse.Namespace, cross_compile: b
9090
# Build SourceKit-LSP
9191

9292

93-
def get_swiftpm_options(swift_exec: str, args: argparse.Namespace) -> List[str]:
93+
def get_swiftpm_options(swift_exec: str, args: argparse.Namespace, suppress_verbose: bool = False) -> List[str]:
9494
swiftpm_args = [
9595
'--package-path', args.package_path,
9696
'--scratch-path', args.build_path,
@@ -100,7 +100,7 @@ def get_swiftpm_options(swift_exec: str, args: argparse.Namespace) -> List[str]:
100100
if args.multiroot_data_file:
101101
swiftpm_args += ['--multiroot-data-file', args.multiroot_data_file]
102102

103-
if args.verbose:
103+
if args.verbose and not suppress_verbose:
104104
swiftpm_args += ['--verbose']
105105

106106
if args.sanitize:
@@ -197,7 +197,7 @@ def run_tests(swift_exec: str, args: argparse.Namespace) -> None:
197197
"""
198198
Run all tests in the package
199199
"""
200-
swiftpm_args = get_swiftpm_options(swift_exec, args)
200+
swiftpm_args = get_swiftpm_options(swift_exec, args, suppress_verbose=True)
201201
additional_env = get_swiftpm_environment_variables(swift_exec, args)
202202
# 'swift test' doesn't print os_log output to the command line. Use the
203203
# `NonDarwinLogger` that prints to stderr so we can view the log output in CI test

0 commit comments

Comments
 (0)