From cff5e092afec17c73a0f94d75276500fd9da8403 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Fri, 6 Sep 2024 16:28:00 +0100 Subject: [PATCH] tests: Suppress cargo-component output Suppress the output from cargo-component when we first run it to check if it's available, otherwise you may see the following $ pytest test/test_wasm-wasi-component.py which: no go in (/home/andrew/.local/bin:/home/andrew/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin) error: no such command: `component` View all installed commands with `cargo --list` Find a package to install `component` with `cargo search cargo-component Note: This didn't stop the tests from working, just an aesthetic issue. Closes: https://github.com/nginx/unit/issues/1410 Signed-off-by: Andrew Clayton --- test/unit/applications/lang/wasm_component.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/unit/applications/lang/wasm_component.py b/test/unit/applications/lang/wasm_component.py index 1d58afd6a..a6c8dd140 100644 --- a/test/unit/applications/lang/wasm_component.py +++ b/test/unit/applications/lang/wasm_component.py @@ -11,7 +11,10 @@ class ApplicationWasmComponent(ApplicationProto): @staticmethod def prepare_env(script): try: - subprocess.check_output(['cargo', 'component', '--help']) + subprocess.check_output( + ['cargo', 'component', '--help'], + stderr=subprocess.STDOUT, + ) except (subprocess.CalledProcessError, FileNotFoundError): return None