diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-08-01 10:26:13 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-08-01 19:00:47 +0200 |
commit | 03f948f4b10e916052a2234448b6658b80ee9143 (patch) | |
tree | 8eb0e2c26a31fd83fa0691b0d8fde55a15942a9d /test/buildtool/execution_api/common/api_test.hpp | |
parent | ed71beee3e3a2bbfcba24281ad9e28a0f6df4054 (diff) | |
download | justbuild-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/common/api_test.hpp')
-rw-r--r-- | test/buildtool/execution_api/common/api_test.hpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/buildtool/execution_api/common/api_test.hpp b/test/buildtool/execution_api/common/api_test.hpp index 6d8e7928..54394b62 100644 --- a/test/buildtool/execution_api/common/api_test.hpp +++ b/test/buildtool/execution_api/common/api_test.hpp @@ -70,8 +70,13 @@ using ExecProps = std::map<std::string, std::string>; auto api = api_factory(); - auto action = api->CreateAction( - *api->UploadTree({}), {"echo", "-n", test_content}, {}, {}, {}, props); + auto action = api->CreateAction(*api->UploadTree({}), + {"echo", "-n", test_content}, + "", + {}, + {}, + {}, + props); SECTION("Cache execution result in action cache") { action->SetCacheFlag(IExecutionAction::CacheFlag::CacheOutput); @@ -147,6 +152,7 @@ using ExecProps = std::map<std::string, std::string>; {"/bin/sh", "-c", "set -e\necho -n " + test_content + " > " + output_path}, + "", {output_path}, {}, {}, @@ -238,6 +244,7 @@ using ExecProps = std::map<std::string, std::string>; auto action = api->CreateAction(*api->UploadTree({{input_path, &input_artifact}}), {"cp", input_path, output_path}, + "", {output_path}, {}, {}, @@ -320,6 +327,7 @@ using ExecProps = std::map<std::string, std::string>; "-c", "set -e\necho -n " + test_content + " > " + output_path + "\nexit 1\n"}, + "", {output_path}, {}, {}, @@ -412,6 +420,7 @@ using ExecProps = std::map<std::string, std::string>; auto action = api->CreateAction(*api->UploadTree({}), {"/bin/sh", "-c", make_cmd("root")}, + "", {}, {"root"}, env, @@ -484,6 +493,7 @@ TestRetrieveFileAndSymlinkWithSameContentToPath(ApiFactory const& api_factory, auto action = api->CreateAction(*api->UploadTree({}), {"/bin/sh", "-c", make_cmd("root")}, + "", {}, {"root"}, env, @@ -552,6 +562,7 @@ TestRetrieveFileAndSymlinkWithSameContentToPath(ApiFactory const& api_factory, auto action = api->CreateAction(*api->UploadTree({}), {"/bin/sh", "-c", cmd}, + "", {foo_path.string(), link_path.string()}, {bar_path.parent_path().string()}, env, @@ -619,6 +630,7 @@ TestRetrieveFileAndSymlinkWithSameContentToPath(ApiFactory const& api_factory, {"/bin/sh", "-c", fmt::format("set -e\n [ -d {} ]", output_path.string())}, + "", {}, {output_path}, {}, |