summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/buildtool/file_system/TARGETS1
-rw-r--r--test/buildtool/file_system/git_repo.test.cpp10
-rw-r--r--test/other_tools/git_operations/TARGETS1
-rw-r--r--test/other_tools/git_operations/git_repo_remote.test.cpp61
4 files changed, 50 insertions, 23 deletions
diff --git a/test/buildtool/file_system/TARGETS b/test/buildtool/file_system/TARGETS
index 880cc368..c202fa32 100644
--- a/test/buildtool/file_system/TARGETS
+++ b/test/buildtool/file_system/TARGETS
@@ -125,6 +125,7 @@
, ["@", "src", "src/buildtool/logging", "logging"]
, ["@", "src", "src/utils/cpp", "atomic"]
, ["@", "src", "src/utils/cpp", "hex_string"]
+ , ["@", "src", "src/buildtool/storage", "config"]
, ["utils", "shell_quoting"]
]
, "stage": ["test", "buildtool", "file_system"]
diff --git a/test/buildtool/file_system/git_repo.test.cpp b/test/buildtool/file_system/git_repo.test.cpp
index c5265aaf..94801dfe 100644
--- a/test/buildtool/file_system/git_repo.test.cpp
+++ b/test/buildtool/file_system/git_repo.test.cpp
@@ -29,6 +29,7 @@
#include "src/buildtool/file_system/git_repo.hpp"
#include "src/buildtool/logging/log_level.hpp"
#include "src/buildtool/logging/logger.hpp"
+#include "src/buildtool/storage/config.hpp"
#include "src/utils/cpp/atomic.hpp"
#include "src/utils/cpp/hex_string.hpp"
#include "test/utils/shell_quoting.hpp"
@@ -418,7 +419,7 @@ TEST_CASE("Single-threaded fake repository operations -- batch 1",
// fetch all with base refspecs
REQUIRE(repo_fetch_all->LocalFetchViaTmpRepo(
- *repo_path, std::nullopt, logger));
+ StorageConfig::Instance(), *repo_path, std::nullopt, logger));
// check commit is there after fetch
CHECK(*repo_fetch_all->CheckCommitExists(kRootCommit, logger));
@@ -437,7 +438,7 @@ TEST_CASE("Single-threaded fake repository operations -- batch 1",
// fetch branch
REQUIRE(repo_fetch_branch->LocalFetchViaTmpRepo(
- *repo_path, "master", logger));
+ StorageConfig::Instance(), *repo_path, "master", logger));
// check commit is there after fetch
CHECK(*repo_fetch_branch->CheckCommitExists(kRootCommit, logger));
@@ -728,7 +729,10 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo]") {
REQUIRE(remote_repo->IsRepoFake());
// fetch all
REQUIRE(remote_repo->LocalFetchViaTmpRepo(
- *remote_repo_path, std::nullopt, logger));
+ StorageConfig::Instance(),
+ *remote_repo_path,
+ std::nullopt,
+ logger));
} break;
}
},
diff --git a/test/other_tools/git_operations/TARGETS b/test/other_tools/git_operations/TARGETS
index 9fa94906..57603ecc 100644
--- a/test/other_tools/git_operations/TARGETS
+++ b/test/other_tools/git_operations/TARGETS
@@ -36,6 +36,7 @@
, ["@", "src", "src/buildtool/logging", "log_level"]
, ["@", "src", "src/buildtool/logging", "logging"]
, ["@", "src", "src/other_tools/git_operations", "git_repo_remote"]
+ , ["@", "src", "src/buildtool/storage", "config"]
, ["@", "src", "src/utils/cpp", "atomic"]
, ["utils", "shell_quoting"]
]
diff --git a/test/other_tools/git_operations/git_repo_remote.test.cpp b/test/other_tools/git_operations/git_repo_remote.test.cpp
index 0a970db8..89bfad23 100644
--- a/test/other_tools/git_operations/git_repo_remote.test.cpp
+++ b/test/other_tools/git_operations/git_repo_remote.test.cpp
@@ -26,6 +26,7 @@
#include "src/buildtool/file_system/file_system_manager.hpp"
#include "src/buildtool/logging/log_level.hpp"
#include "src/buildtool/logging/logger.hpp"
+#include "src/buildtool/storage/config.hpp"
#include "src/other_tools/git_operations/git_repo_remote.hpp"
#include "src/utils/cpp/atomic.hpp"
#include "test/utils/shell_quoting.hpp"
@@ -250,8 +251,13 @@ TEST_CASE("Single-threaded fake repository operations", "[git_repo_remote]") {
*repo_fetch_all->CheckCommitExists(kRootCommit, logger));
// fetch all with base refspecs
- REQUIRE(repo_fetch_all->FetchViaTmpRepo(
- *repo_path, std::nullopt, {}, "git", {}, logger));
+ REQUIRE(repo_fetch_all->FetchViaTmpRepo(StorageConfig::Instance(),
+ *repo_path,
+ std::nullopt,
+ {},
+ "git",
+ {},
+ logger));
// check commit is there after fetch
CHECK(*repo_fetch_all->CheckCommitExists(kRootCommit, logger));
@@ -269,8 +275,14 @@ TEST_CASE("Single-threaded fake repository operations", "[git_repo_remote]") {
*repo_fetch_wRefspec->CheckCommitExists(kRootCommit, logger));
// fetch all
- REQUIRE(repo_fetch_wRefspec->FetchViaTmpRepo(
- *repo_path, "master", {}, "git", {}, logger));
+ REQUIRE(
+ repo_fetch_wRefspec->FetchViaTmpRepo(StorageConfig::Instance(),
+ *repo_path,
+ "master",
+ {},
+ "git",
+ {},
+ logger));
// check commit is there after fetch
CHECK(*repo_fetch_wRefspec->CheckCommitExists(kRootCommit, logger));
@@ -284,8 +296,14 @@ TEST_CASE("Single-threaded fake repository operations", "[git_repo_remote]") {
REQUIRE(repo_commit_upd);
// do remote ls
- auto fetched_commit = repo_commit_upd->UpdateCommitViaTmpRepo(
- *repo_path, "master", {}, "git", {}, logger);
+ auto fetched_commit =
+ repo_commit_upd->UpdateCommitViaTmpRepo(StorageConfig::Instance(),
+ *repo_path,
+ "master",
+ {},
+ "git",
+ {},
+ logger);
REQUIRE(fetched_commit);
CHECK(*fetched_commit == kRootCommit);
@@ -345,28 +363,31 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo_remote]") {
} break;
case 1: {
// fetch with base refspecs
- CHECK(
- target_repo->FetchViaTmpRepo(*remote_repo_path,
- std::nullopt,
- {},
- "git",
- {},
- logger));
+ CHECK(target_repo->FetchViaTmpRepo(
+ StorageConfig::Instance(),
+ *remote_repo_path,
+ std::nullopt,
+ {},
+ "git",
+ {},
+ logger));
} break;
case 2: {
// fetch specific branch
- CHECK(
- target_repo->FetchViaTmpRepo(*remote_repo_path,
- "master",
- {},
- "git",
- {},
- logger));
+ CHECK(target_repo->FetchViaTmpRepo(
+ StorageConfig::Instance(),
+ *remote_repo_path,
+ "master",
+ {},
+ "git",
+ {},
+ logger));
} break;
case 3: {
// do remote ls
auto fetched_commit =
target_repo->UpdateCommitViaTmpRepo(
+ StorageConfig::Instance(),
*remote_repo_path,
"master",
{},