From daf1d07e69499008bb5c60d426ebc61cf6e049ff Mon Sep 17 00:00:00 2001 From: AngelOnFira <14791619+AngelOnFira@users.noreply.github.com> Date: Thu, 2 May 2024 07:36:34 +0000 Subject: [PATCH] fix: change test relative path (#754) Not 100% sure this works when not in a devcontainer --- lib/bolt/core/src/tasks/test.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/bolt/core/src/tasks/test.rs b/lib/bolt/core/src/tasks/test.rs index e870fbce29..08993a69dd 100644 --- a/lib/bolt/core/src/tasks/test.rs +++ b/lib/bolt/core/src/tasks/test.rs @@ -389,12 +389,14 @@ async fn exec_test( // Convert path relative to project let relative_path = test_binary .path - .strip_prefix(ctx.path()) - .context("path not in project")?; + .strip_prefix(ctx.cargo_target_dir()) + .context(format!("path not in project: {:?}", test_binary.path))?; + + let container_path = Path::new("/target").join(relative_path); let command = format!( "RIVET_TEST_ID={test_id} {} --exact {}", - &relative_path.display(), + &container_path.display(), &test_binary.test_name );