summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_api/local/local_execution.test.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-08-01 10:26:13 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-08-01 19:00:47 +0200
commit03f948f4b10e916052a2234448b6658b80ee9143 (patch)
tree8eb0e2c26a31fd83fa0691b0d8fde55a15942a9d /test/buildtool/execution_api/local/local_execution.test.cpp
parented71beee3e3a2bbfcba24281ad9e28a0f6df4054 (diff)
downloadjustbuild-03f948f4b10e916052a2234448b6658b80ee9143.tar.gz
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.
Diffstat (limited to 'test/buildtool/execution_api/local/local_execution.test.cpp')
-rw-r--r--test/buildtool/execution_api/local/local_execution.test.cpp8
1 files changed, 5 insertions, 3 deletions
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<std::string> 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);