From d202e8f6051df5eb89d0f2eb1b9ac7109d204f56 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 2 Jul 2024 13:21:14 +0200 Subject: Remove HermeticLocalTestFixture ...and create StorageConfig and Storage in place if needed. --- test/buildtool/execution_engine/executor/TARGETS | 2 +- .../executor/executor_api_local.test.cpp | 52 +++++++++++----------- 2 files changed, 27 insertions(+), 27 deletions(-) (limited to 'test/buildtool/execution_engine/executor') diff --git a/test/buildtool/execution_engine/executor/TARGETS b/test/buildtool/execution_engine/executor/TARGETS index c1b50f35..2d82e097 100644 --- a/test/buildtool/execution_engine/executor/TARGETS +++ b/test/buildtool/execution_engine/executor/TARGETS @@ -51,7 +51,7 @@ , ["@", "src", "src/buildtool/execution_engine/executor", "executor"] , ["@", "src", "src/buildtool/progress_reporting", "progress"] , ["utils", "catch-main-remote-execution"] - , ["utils", "local_hermeticity"] + , ["utils", "test_storage_config"] , ["utils", "test_auth_config"] , ["@", "catch2", "", "catch2"] , ["@", "src", "src/buildtool/storage", "storage"] diff --git a/test/buildtool/execution_engine/executor/executor_api_local.test.cpp b/test/buildtool/execution_engine/executor/executor_api_local.test.cpp index ae6c3d4e..7d645e0e 100644 --- a/test/buildtool/execution_engine/executor/executor_api_local.test.cpp +++ b/test/buildtool/execution_engine/executor/executor_api_local.test.cpp @@ -24,24 +24,24 @@ #include "src/buildtool/storage/config.hpp" #include "src/buildtool/storage/storage.hpp" #include "test/buildtool/execution_engine/executor/executor_api.test.hpp" -#include "test/utils/hermeticity/local.hpp" +#include "test/utils/hermeticity/test_storage_config.hpp" #include "test/utils/remote_execution/test_auth_config.hpp" -TEST_CASE_METHOD(HermeticLocalTestFixture, - "Executor: Upload blob", - "[executor]") { - auto const storage = Storage::Create(&StorageConfig::Instance()); +TEST_CASE("Executor: Upload blob", "[executor]") { + auto const storage_config = TestStorageConfig::Create(); + auto const storage = Storage::Create(&storage_config.Get()); + RepositoryConfig repo_config{}; TestBlobUpload(&repo_config, [&] { return std::make_unique( - &StorageConfig::Instance(), &storage, &repo_config); + &storage_config.Get(), &storage, &repo_config); }); } -TEST_CASE_METHOD(HermeticLocalTestFixture, - "Executor: Compile hello world", - "[executor]") { - auto const storage = Storage::Create(&StorageConfig::Instance()); +TEST_CASE("Executor: Compile hello world", "[executor]") { + auto const storage_config = TestStorageConfig::Create(); + auto const storage = Storage::Create(&storage_config.Get()); + RepositoryConfig repo_config{}; Statistics stats{}; Progress progress{}; @@ -53,15 +53,15 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, &progress, [&] { return std::make_unique( - &StorageConfig::Instance(), &storage, &repo_config); + &storage_config.Get(), &storage, &repo_config); }, &*auth_config); } -TEST_CASE_METHOD(HermeticLocalTestFixture, - "Executor: Compile greeter", - "[executor]") { - auto const storage = Storage::Create(&StorageConfig::Instance()); +TEST_CASE("Executor: Compile greeter", "[executor]") { + auto const storage_config = TestStorageConfig::Create(); + auto const storage = Storage::Create(&storage_config.Get()); + RepositoryConfig repo_config{}; Statistics stats{}; Progress progress{}; @@ -73,15 +73,15 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, &progress, [&] { return std::make_unique( - &StorageConfig::Instance(), &storage, &repo_config); + &storage_config.Get(), &storage, &repo_config); }, &*auth_config); } -TEST_CASE_METHOD(HermeticLocalTestFixture, - "Executor: Upload and download trees", - "[executor]") { - auto const storage = Storage::Create(&StorageConfig::Instance()); +TEST_CASE("Executor: Upload and download trees", "[executor]") { + auto const storage_config = TestStorageConfig::Create(); + auto const storage = Storage::Create(&storage_config.Get()); + RepositoryConfig repo_config{}; Statistics stats{}; Progress progress{}; @@ -93,15 +93,15 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, &progress, [&] { return std::make_unique( - &StorageConfig::Instance(), &storage, &repo_config); + &storage_config.Get(), &storage, &repo_config); }, &*auth_config); } -TEST_CASE_METHOD(HermeticLocalTestFixture, - "Executor: Retrieve output directories", - "[executor]") { - auto const storage = Storage::Create(&StorageConfig::Instance()); +TEST_CASE("Executor: Retrieve output directories", "[executor]") { + auto const storage_config = TestStorageConfig::Create(); + auto const storage = Storage::Create(&storage_config.Get()); + RepositoryConfig repo_config{}; Statistics stats{}; Progress progress{}; @@ -113,7 +113,7 @@ TEST_CASE_METHOD(HermeticLocalTestFixture, &progress, [&] { return std::make_unique( - &StorageConfig::Instance(), &storage, &repo_config); + &storage_config.Get(), &storage, &repo_config); }, &*auth_config); } -- cgit v1.2.3