summaryrefslogtreecommitdiff
path: root/test/buildtool/file_system
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-01-29 16:27:40 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-01-31 17:15:44 +0100
commit3dc81b4b5a89f4e37af45ec9954723c79c3017cf (patch)
treeb3f18bca1a29e3ff88013f282e6fb0efdd09aea9 /test/buildtool/file_system
parentc1827db24dbc8f0d6eca47c92f34d85bf6b2b128 (diff)
downloadjustbuild-3dc81b4b5a89f4e37af45ec9954723c79c3017cf.tar.gz
serve source tree: Increase server-side granularity in response statuses
For archives and Git repositories we should ensure that not finding the witnessing entity (archive content blob or Git commit, respectively) results in a distinct status in the response to a request that sets up roots on the serve endpoint. This will allow just-mr to better handle its interaction with the serve endpoint.
Diffstat (limited to 'test/buildtool/file_system')
-rw-r--r--test/buildtool/file_system/git_repo.test.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/buildtool/file_system/git_repo.test.cpp b/test/buildtool/file_system/git_repo.test.cpp
index ac346ffb..e9992a97 100644
--- a/test/buildtool/file_system/git_repo.test.cpp
+++ b/test/buildtool/file_system/git_repo.test.cpp
@@ -251,15 +251,15 @@ TEST_CASE("Single-threaded fake repository operations", "[git_repo]") {
SECTION("Get base tree id") {
auto entry_root_c =
repo->GetSubtreeFromCommit(kRootCommit, ".", logger);
- REQUIRE(entry_root_c);
- CHECK(*entry_root_c == kRootId);
+ REQUIRE(std::holds_alternative<std::string>(entry_root_c));
+ CHECK(std::get<std::string>(entry_root_c) == kRootId);
}
SECTION("Get inner tree id") {
auto entry_baz_c =
repo->GetSubtreeFromCommit(kRootCommit, "baz", logger);
- REQUIRE(entry_baz_c);
- CHECK(*entry_baz_c == kBazId);
+ REQUIRE(std::holds_alternative<std::string>(entry_baz_c));
+ CHECK(std::get<std::string>(entry_baz_c) == kBazId);
}
}
@@ -482,8 +482,9 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo]") {
auto entry_baz_c =
remote_repo->GetSubtreeFromCommit(
kRootCommit, "baz", logger);
- REQUIRE(entry_baz_c);
- CHECK(*entry_baz_c == kBazId);
+ REQUIRE(std::holds_alternative<std::string>(
+ entry_baz_c));
+ CHECK(std::get<std::string>(entry_baz_c) == kBazId);
} break;
case 1: {
auto remote_repo = GitRepo::Open(remote_cas);