diff options
-rw-r--r-- | test/buildtool/execution_api/common/api_test.hpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/test/buildtool/execution_api/common/api_test.hpp b/test/buildtool/execution_api/common/api_test.hpp index ce0e3dd2..2ac6ee10 100644 --- a/test/buildtool/execution_api/common/api_test.hpp +++ b/test/buildtool/execution_api/common/api_test.hpp @@ -360,11 +360,17 @@ using ExecProps = std::map<std::string, std::string>; bar_path.string()); }; + auto* path = std::getenv("PATH"); + std::map<std::string, std::string> env{}; + if (path != nullptr) { + env.emplace("PATH", path); + } + auto action = api->CreateAction(*api->UploadTree({}), {"/bin/sh", "-c", make_cmd("root")}, {}, {"root"}, - {}, + env, props); action->SetCacheFlag(IExecutionAction::CacheFlag::CacheOutput); @@ -426,11 +432,17 @@ TestRetrieveFileAndSymlinkWithSameContentToPath(ApiFactory const& api_factory, bar_path.string()); }; + auto* path = std::getenv("PATH"); + std::map<std::string, std::string> env{}; + if (path != nullptr) { + env.emplace("PATH", path); + } + auto action = api->CreateAction(*api->UploadTree({}), {"/bin/sh", "-c", make_cmd("root")}, {}, {"root"}, - {}, + env, props); action->SetCacheFlag(IExecutionAction::CacheFlag::CacheOutput); @@ -488,11 +500,17 @@ TestRetrieveFileAndSymlinkWithSameContentToPath(ApiFactory const& api_factory, foo_path.string(), link_path.string()); + auto* path = std::getenv("PATH"); + std::map<std::string, std::string> env{}; + if (path != nullptr) { + env.emplace("PATH", path); + } + auto action = api->CreateAction(*api->UploadTree({}), {"/bin/sh", "-c", cmd}, {foo_path.string(), link_path.string()}, {bar_path.parent_path().string()}, - {}, + env, props); action->SetCacheFlag(IExecutionAction::CacheFlag::CacheOutput); |