summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_api/local/local_execution.test.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-11-24 11:31:42 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-11-27 15:03:20 +0100
commitcf04253130030bc28866d10aa1f8fe1353643d42 (patch)
treeef7049624771866455105a8dab7b001840139701 /test/buildtool/execution_api/local/local_execution.test.cpp
parentbc09302c2772c979c45ecc716c36e4a70bb484ac (diff)
downloadjustbuild-cf04253130030bc28866d10aa1f8fe1353643d42.tar.gz
Refactoring RepositoryConfig
With the introduction of 'just serve', export targets can now be built also independently from one another based on their corresponding minimal repository configuration, as stored in the target cache key. In this context, this commit changes the RepositoryConfig usage from one global (static) instance to pointers passed as necessary throughout the code.
Diffstat (limited to 'test/buildtool/execution_api/local/local_execution.test.cpp')
-rwxr-xr-xtest/buildtool/execution_api/local/local_execution.test.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/test/buildtool/execution_api/local/local_execution.test.cpp b/test/buildtool/execution_api/local/local_execution.test.cpp
index 9dbed876..36615d89 100755
--- a/test/buildtool/execution_api/local/local_execution.test.cpp
+++ b/test/buildtool/execution_api/local/local_execution.test.cpp
@@ -18,6 +18,7 @@
#include "catch2/catch_test_macros.hpp"
#include "src/buildtool/common/artifact_factory.hpp"
+#include "src/buildtool/common/repository_config.hpp"
#include "src/buildtool/execution_api/local/local_api.hpp"
#include "test/utils/hermeticity/local.hpp"
@@ -37,7 +38,8 @@ namespace {
TEST_CASE_METHOD(HermeticLocalTestFixture,
"LocalExecution: No input, no output",
"[execution_api]") {
- auto api = LocalApi{};
+ RepositoryConfig repo_config{};
+ auto api = LocalApi(&repo_config);
std::string test_content("test");
std::vector<std::string> const cmdline = {"echo", "-n", test_content};
@@ -80,7 +82,8 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
TEST_CASE_METHOD(HermeticLocalTestFixture,
"LocalExecution: No input, no output, env variables used",
"[execution_api]") {
- auto api = LocalApi{};
+ RepositoryConfig repo_config{};
+ auto api = LocalApi(&repo_config);
std::string test_content("test from env var");
std::vector<std::string> const cmdline = {
@@ -129,7 +132,8 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
TEST_CASE_METHOD(HermeticLocalTestFixture,
"LocalExecution: No input, create output",
"[execution_api]") {
- auto api = LocalApi{};
+ RepositoryConfig repo_config{};
+ auto api = LocalApi(&repo_config);
std::string test_content("test");
auto test_digest = ArtifactDigest::Create<ObjectType::File>(test_content);
@@ -184,7 +188,8 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
TEST_CASE_METHOD(HermeticLocalTestFixture,
"LocalExecution: One input copied to output",
"[execution_api]") {
- auto api = LocalApi{};
+ RepositoryConfig repo_config{};
+ auto api = LocalApi(&repo_config);
std::string test_content("test");
auto test_digest = ArtifactDigest::Create<ObjectType::File>(test_content);
@@ -253,7 +258,8 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
TEST_CASE_METHOD(HermeticLocalTestFixture,
"LocalExecution: Cache failed action's result",
"[execution_api]") {
- auto api = LocalApi{};
+ RepositoryConfig repo_config{};
+ auto api = LocalApi(&repo_config);
auto flag = GetTestDir() / "flag";
std::vector<std::string> const cmdline = {