summaryrefslogtreecommitdiff
path: root/test/buildtool/graph_traverser
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-12 16:09:28 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-16 17:51:12 +0200
commit62d204ff4cc94c12c1635f189255710901682825 (patch)
tree0c5cdc5faf98d28ddf74721280756804a6decf83 /test/buildtool/graph_traverser
parentde3ef374983d987d8ffd8e8516a4877fe68b3e4e (diff)
downloadjustbuild-62d204ff4cc94c12c1635f189255710901682825.tar.gz
Remove the RemoteExecutionConfig singleton
...and replace it with passed instances created early via a builder pattern. Tests are also updated accordingly.
Diffstat (limited to 'test/buildtool/graph_traverser')
-rw-r--r--test/buildtool/graph_traverser/TARGETS2
-rw-r--r--test/buildtool/graph_traverser/graph_traverser.test.hpp164
-rw-r--r--test/buildtool/graph_traverser/graph_traverser_local.test.cpp52
-rw-r--r--test/buildtool/graph_traverser/graph_traverser_remote.test.cpp124
4 files changed, 213 insertions, 129 deletions
diff --git a/test/buildtool/graph_traverser/TARGETS b/test/buildtool/graph_traverser/TARGETS
index 6ed1cc1e..23a2814f 100644
--- a/test/buildtool/graph_traverser/TARGETS
+++ b/test/buildtool/graph_traverser/TARGETS
@@ -32,6 +32,7 @@
, ["", "catch-main"]
, ["utils", "test_auth_config"]
, ["utils", "test_storage_config"]
+ , ["@", "src", "src/buildtool/execution_api/remote", "config"]
, ["@", "src", "src/buildtool/storage", "config"]
, ["@", "src", "src/buildtool/storage", "storage"]
]
@@ -47,6 +48,7 @@
, ["@", "catch2", "", "catch2"]
, ["utils", "catch-main-remote-execution"]
, ["utils", "test_auth_config"]
+ , ["utils", "test_remote_config"]
, ["@", "src", "src/buildtool/storage", "storage"]
, ["@", "src", "src/buildtool/storage", "config"]
]
diff --git a/test/buildtool/graph_traverser/graph_traverser.test.hpp b/test/buildtool/graph_traverser/graph_traverser.test.hpp
index b4695c34..b0187392 100644
--- a/test/buildtool/graph_traverser/graph_traverser.test.hpp
+++ b/test/buildtool/graph_traverser/graph_traverser.test.hpp
@@ -161,6 +161,7 @@ class TestProject {
StorageConfig const& storage_config,
Storage const& storage,
gsl::not_null<Auth const*> const& auth,
+ gsl::not_null<RemoteExecutionConfig const*> const& remote_config,
bool is_hermetic = true) {
TestProject p("hello_world_copy_message");
@@ -173,11 +174,11 @@ class TestProject {
&local_exec_config,
p.GetRepoConfig(),
auth,
- &RemoteExecutionConfig::Instance()};
+ remote_config};
GraphTraverser const gt{clargs.gtargs,
p.GetRepoConfig(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList(),
+ remote_config->platform_properties,
+ remote_config->dispatch,
&stats,
&progress,
&apis,
@@ -205,16 +206,15 @@ class TestProject {
&local_exec_config,
p.GetRepoConfig(),
auth,
- &RemoteExecutionConfig::Instance()};
- GraphTraverser const gt_get_exec{
- clargs_exec.gtargs,
- p.GetRepoConfig(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList(),
- &stats,
- &progress,
- &apis,
- [](auto done, auto cv) {}};
+ remote_config};
+ GraphTraverser const gt_get_exec{clargs_exec.gtargs,
+ p.GetRepoConfig(),
+ remote_config->platform_properties,
+ remote_config->dispatch,
+ &stats,
+ &progress,
+ &apis,
+ [](auto done, auto cv) {}};
auto const exec_result = gt_get_exec.BuildAndStage(
clargs_exec.graph_description, clargs_exec.artifacts);
@@ -237,6 +237,7 @@ class TestProject {
StorageConfig const& storage_config,
Storage const& storage,
gsl::not_null<Auth const*> const& auth,
+ gsl::not_null<RemoteExecutionConfig const*> const& remote_config,
bool is_hermetic = true) {
TestProject p("copy_local_file");
@@ -249,11 +250,11 @@ class TestProject {
&local_exec_config,
p.GetRepoConfig(),
auth,
- &RemoteExecutionConfig::Instance()};
+ remote_config};
GraphTraverser const gt{clargs.gtargs,
p.GetRepoConfig(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList(),
+ remote_config->platform_properties,
+ remote_config->dispatch,
&stats,
&progress,
&apis,
@@ -275,6 +276,7 @@ class TestProject {
StorageConfig const& storage_config,
Storage const& storage,
gsl::not_null<Auth const*> const& auth,
+ gsl::not_null<RemoteExecutionConfig const*> const& remote_config,
bool is_hermetic = true) {
TestProject p("sequence_printer_build_library_only");
@@ -287,11 +289,11 @@ class TestProject {
&local_exec_config,
p.GetRepoConfig(),
auth,
- &RemoteExecutionConfig::Instance()};
+ remote_config};
GraphTraverser const gt{clargs.gtargs,
p.GetRepoConfig(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList(),
+ remote_config->platform_properties,
+ remote_config->dispatch,
&stats,
&progress,
&apis,
@@ -304,15 +306,14 @@ class TestProject {
CHECK(FileSystemManager::IsFile(result->output_paths.at(0)));
auto const clargs_full_build = p.CmdLineArgs("_entry_points_full_build");
- GraphTraverser const gt_full_build{
- clargs_full_build.gtargs,
- p.GetRepoConfig(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList(),
- &stats,
- &progress,
- &apis,
- [](auto done, auto cv) {}};
+ GraphTraverser const gt_full_build{clargs_full_build.gtargs,
+ p.GetRepoConfig(),
+ remote_config->platform_properties,
+ remote_config->dispatch,
+ &stats,
+ &progress,
+ &apis,
+ [](auto done, auto cv) {}};
auto const full_build_result = gt_full_build.BuildAndStage(
clargs_full_build.graph_description, clargs_full_build.artifacts);
@@ -333,6 +334,7 @@ class TestProject {
StorageConfig const& storage_config,
Storage const& storage,
gsl::not_null<Auth const*> const& auth,
+ gsl::not_null<RemoteExecutionConfig const*> const& remote_config,
bool is_hermetic = true) {
TestProject full_hello_world("hello_world_copy_message");
@@ -346,11 +348,11 @@ class TestProject {
&local_exec_config,
full_hello_world.GetRepoConfig(),
auth,
- &RemoteExecutionConfig::Instance()};
+ remote_config};
GraphTraverser const gt_upload{clargs_update_cpp.gtargs,
full_hello_world.GetRepoConfig(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList(),
+ remote_config->platform_properties,
+ remote_config->dispatch,
&stats,
&progress,
&apis,
@@ -372,8 +374,8 @@ class TestProject {
auto const clargs = hello_world_known_cpp.CmdLineArgs();
GraphTraverser const gt{clargs.gtargs,
full_hello_world.GetRepoConfig(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList(),
+ remote_config->platform_properties,
+ remote_config->dispatch,
&stats,
&progress,
&apis,
@@ -394,10 +396,12 @@ class TestProject {
}
}
-static void TestBlobsUploadedAndUsed(StorageConfig const& storage_config,
- Storage const& storage,
- gsl::not_null<Auth const*> const& auth,
- bool is_hermetic = true) {
+static void TestBlobsUploadedAndUsed(
+ StorageConfig const& storage_config,
+ Storage const& storage,
+ gsl::not_null<Auth const*> const& auth,
+ gsl::not_null<RemoteExecutionConfig const*> const& remote_config,
+ bool is_hermetic = true) {
TestProject p("use_uploaded_blobs");
auto const clargs = p.CmdLineArgs();
@@ -409,11 +413,11 @@ static void TestBlobsUploadedAndUsed(StorageConfig const& storage_config,
&local_exec_config,
p.GetRepoConfig(),
auth,
- &RemoteExecutionConfig::Instance()};
+ remote_config};
GraphTraverser gt{clargs.gtargs,
p.GetRepoConfig(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList(),
+ remote_config->platform_properties,
+ remote_config->dispatch,
&stats,
&progress,
&apis,
@@ -443,6 +447,7 @@ static void TestEnvironmentVariablesSetAndUsed(
StorageConfig const& storage_config,
Storage const& storage,
gsl::not_null<Auth const*> const& auth,
+ gsl::not_null<RemoteExecutionConfig const*> const& remote_config,
bool is_hermetic = true) {
TestProject p("use_env_variables");
auto const clargs = p.CmdLineArgs();
@@ -455,11 +460,11 @@ static void TestEnvironmentVariablesSetAndUsed(
&local_exec_config,
p.GetRepoConfig(),
auth,
- &RemoteExecutionConfig::Instance()};
+ remote_config};
GraphTraverser gt{clargs.gtargs,
p.GetRepoConfig(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList(),
+ remote_config->platform_properties,
+ remote_config->dispatch,
&stats,
&progress,
&apis,
@@ -485,10 +490,12 @@ static void TestEnvironmentVariablesSetAndUsed(
}
}
-static void TestTreesUsed(StorageConfig const& storage_config,
- Storage const& storage,
- gsl::not_null<Auth const*> const& auth,
- bool is_hermetic = true) {
+static void TestTreesUsed(
+ StorageConfig const& storage_config,
+ Storage const& storage,
+ gsl::not_null<Auth const*> const& auth,
+ gsl::not_null<RemoteExecutionConfig const*> const& remote_config,
+ bool is_hermetic = true) {
TestProject p("use_trees");
auto const clargs = p.CmdLineArgs();
@@ -500,11 +507,11 @@ static void TestTreesUsed(StorageConfig const& storage_config,
&local_exec_config,
p.GetRepoConfig(),
auth,
- &RemoteExecutionConfig::Instance()};
+ remote_config};
GraphTraverser gt{clargs.gtargs,
p.GetRepoConfig(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList(),
+ remote_config->platform_properties,
+ remote_config->dispatch,
&stats,
&progress,
&apis,
@@ -530,10 +537,12 @@ static void TestTreesUsed(StorageConfig const& storage_config,
}
}
-static void TestNestedTreesUsed(StorageConfig const& storage_config,
- Storage const& storage,
- gsl::not_null<Auth const*> const& auth,
- bool is_hermetic = true) {
+static void TestNestedTreesUsed(
+ StorageConfig const& storage_config,
+ Storage const& storage,
+ gsl::not_null<Auth const*> const& auth,
+ gsl::not_null<RemoteExecutionConfig const*> const& remote_config,
+ bool is_hermetic = true) {
TestProject p("use_nested_trees");
auto const clargs = p.CmdLineArgs();
@@ -545,11 +554,11 @@ static void TestNestedTreesUsed(StorageConfig const& storage_config,
&local_exec_config,
p.GetRepoConfig(),
auth,
- &RemoteExecutionConfig::Instance()};
+ remote_config};
GraphTraverser gt{clargs.gtargs,
p.GetRepoConfig(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList(),
+ remote_config->platform_properties,
+ remote_config->dispatch,
&stats,
&progress,
&apis,
@@ -575,10 +584,12 @@ static void TestNestedTreesUsed(StorageConfig const& storage_config,
}
}
-static void TestFlakyHelloWorldDetected(StorageConfig const& storage_config,
- Storage const& storage,
- gsl::not_null<Auth const*> const& auth,
- bool /*is_hermetic*/ = true) {
+static void TestFlakyHelloWorldDetected(
+ StorageConfig const& storage_config,
+ Storage const& storage,
+ gsl::not_null<Auth const*> const& auth,
+ gsl::not_null<RemoteExecutionConfig const*> const& remote_config,
+ bool /*is_hermetic*/ = true) {
TestProject p("flaky_hello_world");
auto const local_exec_config = CreateLocalExecConfig();
@@ -589,14 +600,14 @@ static void TestFlakyHelloWorldDetected(StorageConfig const& storage_config,
&local_exec_config,
p.GetRepoConfig(),
auth,
- &RemoteExecutionConfig::Instance()};
+ remote_config};
{
auto clargs = p.CmdLineArgs("_entry_points_ctimes");
GraphTraverser const gt{clargs.gtargs,
p.GetRepoConfig(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList(),
+ remote_config->platform_properties,
+ remote_config->dispatch,
&stats,
&progress,
&apis,
@@ -616,8 +627,8 @@ static void TestFlakyHelloWorldDetected(StorageConfig const& storage_config,
clargs_output.gtargs.rebuild = RebuildArguments{};
GraphTraverser const gt_output{clargs_output.gtargs,
p.GetRepoConfig(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList(),
+ remote_config->platform_properties,
+ remote_config->dispatch,
&stats,
&progress,
&apis,
@@ -632,15 +643,14 @@ static void TestFlakyHelloWorldDetected(StorageConfig const& storage_config,
// make_exe[flaky]->make_output[miss]->strip_time [miss]
auto clargs_stripped = p.CmdLineArgs("_entry_points_stripped");
clargs_stripped.gtargs.rebuild = RebuildArguments{};
- GraphTraverser const gt_stripped{
- clargs_stripped.gtargs,
- p.GetRepoConfig(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList(),
- &stats,
- &progress,
- &apis,
- [](auto done, auto cv) {}};
+ GraphTraverser const gt_stripped{clargs_stripped.gtargs,
+ p.GetRepoConfig(),
+ remote_config->platform_properties,
+ remote_config->dispatch,
+ &stats,
+ &progress,
+ &apis,
+ [](auto done, auto cv) {}};
REQUIRE(gt_stripped.BuildAndStage(clargs_stripped.graph_description,
clargs_stripped.artifacts));
CHECK(stats.ActionsFlakyCounter() == 1);
@@ -653,8 +663,8 @@ static void TestFlakyHelloWorldDetected(StorageConfig const& storage_config,
clargs_ctimes.gtargs.rebuild = RebuildArguments{};
GraphTraverser const gt_ctimes{clargs_ctimes.gtargs,
p.GetRepoConfig(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList(),
+ remote_config->platform_properties,
+ remote_config->dispatch,
&stats,
&progress,
&apis,
diff --git a/test/buildtool/graph_traverser/graph_traverser_local.test.cpp b/test/buildtool/graph_traverser/graph_traverser_local.test.cpp
index 007d1386..2c28323b 100644
--- a/test/buildtool/graph_traverser/graph_traverser_local.test.cpp
+++ b/test/buildtool/graph_traverser/graph_traverser_local.test.cpp
@@ -14,6 +14,7 @@
#include "catch2/catch_test_macros.hpp"
#include "src/buildtool/auth/authentication.hpp"
+#include "src/buildtool/execution_api/remote/config.hpp"
#include "src/buildtool/storage/config.hpp"
#include "src/buildtool/storage/storage.hpp"
#include "test/buildtool/graph_traverser/graph_traverser.test.hpp"
@@ -24,73 +25,88 @@ TEST_CASE("Local: Output created when entry point is local artifact",
"[graph_traverser]") {
auto const storage_config = TestStorageConfig::Create();
auto const storage = Storage::Create(&storage_config.Get());
- Auth auth{}; /*no TLS needed*/
+ Auth auth{}; /*no TLS needed*/
+ RemoteExecutionConfig remote_config{}; /*no remote*/
- TestCopyLocalFile(storage_config.Get(), storage, &auth);
+ TestCopyLocalFile(storage_config.Get(), storage, &auth, &remote_config);
}
TEST_CASE("Local: Output created and contents are correct",
"[graph_traverser]") {
auto const storage_config = TestStorageConfig::Create();
auto const storage = Storage::Create(&storage_config.Get());
- Auth auth{}; /*no TLS needed*/
+ Auth auth{}; /*no TLS needed*/
+ RemoteExecutionConfig remote_config{}; /*no remote*/
- TestHelloWorldCopyMessage(storage_config.Get(), storage, &auth);
+ TestHelloWorldCopyMessage(
+ storage_config.Get(), storage, &auth, &remote_config);
}
TEST_CASE("Local: Actions are not re-run", "[graph_traverser]") {
auto const storage_config = TestStorageConfig::Create();
auto const storage = Storage::Create(&storage_config.Get());
- Auth auth{}; /*no TLS needed*/
+ Auth auth{}; /*no TLS needed*/
+ RemoteExecutionConfig remote_config{}; /*no remote*/
- TestSequencePrinterBuildLibraryOnly(storage_config.Get(), storage, &auth);
+ TestSequencePrinterBuildLibraryOnly(
+ storage_config.Get(), storage, &auth, &remote_config);
}
TEST_CASE("Local: KNOWN artifact", "[graph_traverser]") {
auto const storage_config = TestStorageConfig::Create();
auto const storage = Storage::Create(&storage_config.Get());
- Auth auth{}; /*no TLS needed*/
+ Auth auth{}; /*no TLS needed*/
+ RemoteExecutionConfig remote_config{}; /*no remote*/
- TestHelloWorldWithKnownSource(storage_config.Get(), storage, &auth);
+ TestHelloWorldWithKnownSource(
+ storage_config.Get(), storage, &auth, &remote_config);
}
TEST_CASE("Local: Blobs uploaded and correctly used", "[graph_traverser]") {
auto const storage_config = TestStorageConfig::Create();
auto const storage = Storage::Create(&storage_config.Get());
- Auth auth{}; /*no TLS needed*/
+ Auth auth{}; /*no TLS needed*/
+ RemoteExecutionConfig remote_config{}; /*no remote*/
- TestBlobsUploadedAndUsed(storage_config.Get(), storage, &auth);
+ TestBlobsUploadedAndUsed(
+ storage_config.Get(), storage, &auth, &remote_config);
}
TEST_CASE("Local: Environment variables are set and used",
"[graph_traverser]") {
auto const storage_config = TestStorageConfig::Create();
auto const storage = Storage::Create(&storage_config.Get());
- Auth auth{}; /*no TLS needed*/
+ Auth auth{}; /*no TLS needed*/
+ RemoteExecutionConfig remote_config{}; /*no remote*/
- TestEnvironmentVariablesSetAndUsed(storage_config.Get(), storage, &auth);
+ TestEnvironmentVariablesSetAndUsed(
+ storage_config.Get(), storage, &auth, &remote_config);
}
TEST_CASE("Local: Trees correctly used", "[graph_traverser]") {
auto const storage_config = TestStorageConfig::Create();
auto const storage = Storage::Create(&storage_config.Get());
- Auth auth{}; /*no TLS needed*/
+ Auth auth{}; /*no TLS needed*/
+ RemoteExecutionConfig remote_config{}; /*no remote*/
- TestTreesUsed(storage_config.Get(), storage, &auth);
+ TestTreesUsed(storage_config.Get(), storage, &auth, &remote_config);
}
TEST_CASE("Local: Nested trees correctly used", "[graph_traverser]") {
auto const storage_config = TestStorageConfig::Create();
auto const storage = Storage::Create(&storage_config.Get());
- Auth auth{}; /*no TLS needed*/
+ Auth auth{}; /*no TLS needed*/
+ RemoteExecutionConfig remote_config{}; /*no remote*/
- TestNestedTreesUsed(storage_config.Get(), storage, &auth);
+ TestNestedTreesUsed(storage_config.Get(), storage, &auth, &remote_config);
}
TEST_CASE("Local: Detect flaky actions", "[graph_traverser]") {
auto const storage_config = TestStorageConfig::Create();
auto const storage = Storage::Create(&storage_config.Get());
- Auth auth{}; /*no TLS needed*/
+ Auth auth{}; /*no TLS needed*/
+ RemoteExecutionConfig remote_config{}; /*no remote*/
- TestFlakyHelloWorldDetected(storage_config.Get(), storage, &auth);
+ TestFlakyHelloWorldDetected(
+ storage_config.Get(), storage, &auth, &remote_config);
}
diff --git a/test/buildtool/graph_traverser/graph_traverser_remote.test.cpp b/test/buildtool/graph_traverser/graph_traverser_remote.test.cpp
index 5fa3bc95..504b96a1 100644
--- a/test/buildtool/graph_traverser/graph_traverser_remote.test.cpp
+++ b/test/buildtool/graph_traverser/graph_traverser_remote.test.cpp
@@ -18,8 +18,10 @@
#include "src/buildtool/storage/storage.hpp"
#include "test/buildtool/graph_traverser/graph_traverser.test.hpp"
#include "test/utils/remote_execution/test_auth_config.hpp"
+#include "test/utils/remote_execution/test_remote_config.hpp"
-[[nodiscard]] static auto CreateConfig() -> StorageConfig {
+[[nodiscard]] static auto CreateStorageConfig(
+ RemoteExecutionConfig const& remote_config) -> StorageConfig {
auto cache_dir = FileSystemManager::GetCurrentDirectory() / "cache";
if (not FileSystemManager::RemoveDirectory(cache_dir, true) or
not FileSystemManager::CreateDirectoryExclusive(cache_dir)) {
@@ -30,12 +32,11 @@
}
StorageConfig::Builder builder;
- auto config =
- builder.SetBuildRoot(cache_dir)
- .SetRemoteExecutionArgs(RemoteExecutionConfig::RemoteAddress(),
- RemoteExecutionConfig::PlatformProperties(),
- RemoteExecutionConfig::DispatchList())
- .Build();
+ auto config = builder.SetBuildRoot(cache_dir)
+ .SetRemoteExecutionArgs(remote_config.remote_address,
+ remote_config.platform_properties,
+ remote_config.dispatch)
+ .Build();
if (not config) {
Logger::Log(LogLevel::Error, config.error());
std::exit(EXIT_FAILURE);
@@ -45,93 +46,148 @@
TEST_CASE("Remote: Output created and contents are correct",
"[graph_traverser]") {
- StorageConfig const storage_config = CreateConfig();
+ auto remote_config = TestRemoteConfig::ReadFromEnvironment();
+ REQUIRE(remote_config);
+
+ StorageConfig const storage_config = CreateStorageConfig(*remote_config);
auto const storage = Storage::Create(&storage_config);
+
auto auth_config = TestAuthConfig::ReadFromEnvironment();
REQUIRE(auth_config);
- TestHelloWorldCopyMessage(
- storage_config, storage, &*auth_config, false /* not hermetic */);
+ TestHelloWorldCopyMessage(storage_config,
+ storage,
+ &*auth_config,
+ &*remote_config,
+ false /* not hermetic */);
}
TEST_CASE("Remote: Output created when entry point is local artifact",
"[graph_traverser]") {
- StorageConfig const storage_config = CreateConfig();
+ auto remote_config = TestRemoteConfig::ReadFromEnvironment();
+ REQUIRE(remote_config);
+
+ StorageConfig const storage_config = CreateStorageConfig(*remote_config);
auto const storage = Storage::Create(&storage_config);
auto auth_config = TestAuthConfig::ReadFromEnvironment();
REQUIRE(auth_config);
- TestCopyLocalFile(
- storage_config, storage, &*auth_config, false /* not hermetic */);
+ TestCopyLocalFile(storage_config,
+ storage,
+ &*auth_config,
+ &*remote_config,
+ false /* not hermetic */);
}
TEST_CASE("Remote: Actions are not re-run", "[graph_traverser]") {
- StorageConfig const storage_config = CreateConfig();
+ auto remote_config = TestRemoteConfig::ReadFromEnvironment();
+ REQUIRE(remote_config);
+
+ StorageConfig const storage_config = CreateStorageConfig(*remote_config);
auto const storage = Storage::Create(&storage_config);
auto auth_config = TestAuthConfig::ReadFromEnvironment();
REQUIRE(auth_config);
- TestSequencePrinterBuildLibraryOnly(
- storage_config, storage, &*auth_config, false /* not hermetic */);
+ TestSequencePrinterBuildLibraryOnly(storage_config,
+ storage,
+ &*auth_config,
+ &*remote_config,
+ false /* not hermetic */);
}
TEST_CASE("Remote: KNOWN artifact", "[graph_traverser]") {
- StorageConfig const storage_config = CreateConfig();
+ auto remote_config = TestRemoteConfig::ReadFromEnvironment();
+ REQUIRE(remote_config);
+
+ StorageConfig const storage_config = CreateStorageConfig(*remote_config);
auto const storage = Storage::Create(&storage_config);
auto auth_config = TestAuthConfig::ReadFromEnvironment();
REQUIRE(auth_config);
- TestHelloWorldWithKnownSource(
- storage_config, storage, &*auth_config, false /* not hermetic */);
+ TestHelloWorldWithKnownSource(storage_config,
+ storage,
+ &*auth_config,
+ &*remote_config,
+ false /* not hermetic */);
}
TEST_CASE("Remote: Blobs uploaded and correctly used", "[graph_traverser]") {
- StorageConfig const storage_config = CreateConfig();
+ auto remote_config = TestRemoteConfig::ReadFromEnvironment();
+ REQUIRE(remote_config);
+
+ StorageConfig const storage_config = CreateStorageConfig(*remote_config);
auto const storage = Storage::Create(&storage_config);
auto auth_config = TestAuthConfig::ReadFromEnvironment();
REQUIRE(auth_config);
- TestBlobsUploadedAndUsed(
- storage_config, storage, &*auth_config, false /* not hermetic */);
+ TestBlobsUploadedAndUsed(storage_config,
+ storage,
+ &*auth_config,
+ &*remote_config,
+ false /* not hermetic */);
}
TEST_CASE("Remote: Environment variables are set and used",
"[graph_traverser]") {
- StorageConfig const storage_config = CreateConfig();
+ auto remote_config = TestRemoteConfig::ReadFromEnvironment();
+ REQUIRE(remote_config);
+
+ StorageConfig const storage_config = CreateStorageConfig(*remote_config);
auto const storage = Storage::Create(&storage_config);
auto auth_config = TestAuthConfig::ReadFromEnvironment();
REQUIRE(auth_config);
- TestEnvironmentVariablesSetAndUsed(
- storage_config, storage, &*auth_config, false /* not hermetic */);
+ TestEnvironmentVariablesSetAndUsed(storage_config,
+ storage,
+ &*auth_config,
+ &*remote_config,
+ false /* not hermetic */);
}
TEST_CASE("Remote: Trees correctly used", "[graph_traverser]") {
- StorageConfig const storage_config = CreateConfig();
+ auto remote_config = TestRemoteConfig::ReadFromEnvironment();
+ REQUIRE(remote_config);
+
+ StorageConfig const storage_config = CreateStorageConfig(*remote_config);
auto const storage = Storage::Create(&storage_config);
auto auth_config = TestAuthConfig::ReadFromEnvironment();
REQUIRE(auth_config);
- TestTreesUsed(
- storage_config, storage, &*auth_config, false /* not hermetic */);
+ TestTreesUsed(storage_config,
+ storage,
+ &*auth_config,
+ &*remote_config,
+ false /* not hermetic */);
}
TEST_CASE("Remote: Nested trees correctly used", "[graph_traverser]") {
- StorageConfig const storage_config = CreateConfig();
+ auto remote_config = TestRemoteConfig::ReadFromEnvironment();
+ REQUIRE(remote_config);
+
+ StorageConfig const storage_config = CreateStorageConfig(*remote_config);
auto const storage = Storage::Create(&storage_config);
auto auth_config = TestAuthConfig::ReadFromEnvironment();
REQUIRE(auth_config);
- TestNestedTreesUsed(
- storage_config, storage, &*auth_config, false /* not hermetic */);
+ TestNestedTreesUsed(storage_config,
+ storage,
+ &*auth_config,
+ &*remote_config,
+ false /* not hermetic */);
}
TEST_CASE("Remote: Detect flaky actions", "[graph_traverser]") {
- StorageConfig const storage_config = CreateConfig();
+ auto remote_config = TestRemoteConfig::ReadFromEnvironment();
+ REQUIRE(remote_config);
+
+ StorageConfig const storage_config = CreateStorageConfig(*remote_config);
auto const storage = Storage::Create(&storage_config);
auto auth_config = TestAuthConfig::ReadFromEnvironment();
REQUIRE(auth_config);
- TestFlakyHelloWorldDetected(
- storage_config, storage, &*auth_config, false /* not hermetic */);
+ TestFlakyHelloWorldDetected(storage_config,
+ storage,
+ &*auth_config,
+ &*remote_config,
+ false /* not hermetic */);
}