From 3dc81b4b5a89f4e37af45ec9954723c79c3017cf Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 29 Jan 2024 16:27:40 +0100 Subject: 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. --- test/buildtool/file_system/git_repo.test.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'test/buildtool/file_system/git_repo.test.cpp') 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(entry_root_c)); + CHECK(std::get(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(entry_baz_c)); + CHECK(std::get(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( + entry_baz_c)); + CHECK(std::get(entry_baz_c) == kBazId); } break; case 1: { auto remote_repo = GitRepo::Open(remote_cas); -- cgit v1.2.3