From 03f948f4b10e916052a2234448b6658b80ee9143 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Thu, 1 Aug 2024 10:26:13 +0200 Subject: Execution API: support cwd ... following the remote-execution standard that all output paths (but none of the input paths) are relative to the working directory. Therefore, the executor has to do the path translation. For our implementation of the API interface - the local API now handles cwd correctly, - the remote API forwards cwd correctly, and - the git API continues to report actions as not implemented. --- test/buildtool/execution_api/local/local_execution.test.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test/buildtool/execution_api/local/local_execution.test.cpp') diff --git a/test/buildtool/execution_api/local/local_execution.test.cpp b/test/buildtool/execution_api/local/local_execution.test.cpp index a08f3b87..49141076 100644 --- a/test/buildtool/execution_api/local/local_execution.test.cpp +++ b/test/buildtool/execution_api/local/local_execution.test.cpp @@ -79,7 +79,7 @@ TEST_CASE("LocalExecution: No input, no output", "[execution_api]") { std::string test_content("test"); std::vector const cmdline = {"echo", "-n", test_content}; auto action = - api.CreateAction(*api.UploadTree({}), cmdline, {}, {}, {}, {}); + api.CreateAction(*api.UploadTree({}), cmdline, "", {}, {}, {}, {}); REQUIRE(action); SECTION("Cache execution result in action cache") { @@ -134,6 +134,7 @@ TEST_CASE("LocalExecution: No input, no output, env variables used", "/bin/sh", "-c", "set -e\necho -n ${MYCONTENT}"}; auto action = api.CreateAction(*api.UploadTree({}), cmdline, + "", {}, {}, {{"MYCONTENT", test_content}}, @@ -198,7 +199,7 @@ TEST_CASE("LocalExecution: No input, create output", "[execution_api]") { "set -e\necho -n " + test_content + " > " + output_path}; auto action = api.CreateAction( - *api.UploadTree({}), cmdline, {output_path}, {}, {}, {}); + *api.UploadTree({}), cmdline, "", {output_path}, {}, {}, {}); REQUIRE(action); SECTION("Cache execution result in action cache") { @@ -273,6 +274,7 @@ TEST_CASE("LocalExecution: One input copied to output", "[execution_api]") { auto action = api.CreateAction(*api.UploadTree({{input_path, &local_artifact}}), cmdline, + "", {output_path}, {}, {}, @@ -335,7 +337,7 @@ TEST_CASE("LocalExecution: Cache failed action's result", "[execution_api]") { "sh", "-c", fmt::format("[ -f '{}' ]", flag.string())}; auto action = - api.CreateAction(*api.UploadTree({}), cmdline, {}, {}, {}, {}); + api.CreateAction(*api.UploadTree({}), cmdline, "", {}, {}, {}, {}); REQUIRE(action); action->SetCacheFlag(IExecutionAction::CacheFlag::CacheOutput); -- cgit v1.2.3