Skip to content

Commit 67d5cad

Browse files
committed
Use a more stable path to the diesel executable in tests
The test executable has moved from `target/debug/test_exe` to `target/debug/deps/test_exe`, while the diesel executable is still in the same directory as before. Rather than relying on this unstable relationship, we can at least lower our surface area of change by only relying on the path to the diesel executable. It should be fine to rely on just `debug` here, as you would never cross-compile tests.
1 parent 54fba08 commit 67d5cad

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

diesel_cli/tests/support/command.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ impl CommandResult {
6969
}
7070

7171
fn path_to_diesel_cli() -> PathBuf {
72-
env::current_exe().unwrap()
73-
.parent().unwrap()
72+
Path::new(&env::var_os("CARGO_MANIFEST_DIR").unwrap())
73+
.join("target")
74+
.join("debug")
7475
.join("diesel")
7576
}
7677

0 commit comments

Comments
 (0)