From ce04e61dd4fca95143d85a70c02be1052b03021e Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Thu, 5 Sep 2024 08:24:01 -0700 Subject: [PATCH] tests: set `$COLUMNS` when running CLI tests As reported in #4394, at least `test_show_command::test_show_basic` can fail when run with a narrow terminal. This patch sets `COLUMNS=100` in the environment when running tests so the CLI uses that value instead of using the width of the user's terminal. --- cli/tests/common/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/tests/common/mod.rs b/cli/tests/common/mod.rs index ea7097163..c70beca6e 100644 --- a/cli/tests/common/mod.rs +++ b/cli/tests/common/mod.rs @@ -89,6 +89,7 @@ impl TestEnvironment { cmd.current_dir(current_dir); cmd.args(args); cmd.env_clear(); + cmd.env("COLUMNS", "100"); for (key, value) in &self.env_vars { cmd.env(key, value); }