From cf04253130030bc28866d10aa1f8fe1353643d42 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Fri, 24 Nov 2023 11:31:42 +0100 Subject: 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. --- .../execution_api/local/local_execution.test.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 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 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 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 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(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(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 const cmdline = { -- cgit v1.2.3