Skip to content

Commit 717bb4e

Browse files
committed
fix(test): set command CWD in empty_input CLI tests
The `test_cli_markdown_file_no_actions` and `test_cli_empty_markdown_file` integration tests were failing on the Ubuntu CI runner. The error indicated that the default output directory (`./project-generated`) could not be created due to "No such file or directory". This occurred because the tests did not explicitly set the Current Working Directory (CWD) for the spawned `strux` command. The command inherited the CWD from the test runner environment, which was problematic on the Ubuntu runner, preventing relative directory creation. This commit fixes the issue by adding `cmd.current_dir(temp_dir.path())` to both tests in `tests/cli/empty_input.rs`. This ensures the `strux` command executes with its CWD set to the temporary directory created by `assert_fs`, providing a reliable and writable location for filesystem operations and resolving the CI failures.
1 parent 08e8915 commit 717bb4e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/cli/empty_input.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ fn test_cli_empty_markdown_file() {
1515

1616
let mut cmd = get_cmd();
1717
cmd.arg(md_path.path());
18+
cmd.current_dir(temp_dir.path()); // <-- ADDED: Set CWD for the command
1819

1920
cmd.assert()
2021
.success()
@@ -46,6 +47,7 @@ fn test_cli_markdown_file_no_actions() {
4647

4748
let mut cmd = get_cmd();
4849
cmd.arg(md_path.path());
50+
cmd.current_dir(temp_dir.path()); // <-- ADDED: Set CWD for the command
4951

5052
cmd.assert()
5153
.success()

0 commit comments

Comments
 (0)