Skip to content

Commit

Permalink
tests: Suppress cargo-component output
Browse files Browse the repository at this point in the history
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: #1410
Signed-off-by: Andrew Clayton <[email protected]>
  • Loading branch information
ac000 committed Sep 10, 2024
1 parent 6976a61 commit cff5e09
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/unit/applications/lang/wasm_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit cff5e09

Please sign in to comment.