diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-01-29 16:27:40 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-01-31 17:15:44 +0100 |
commit | 3dc81b4b5a89f4e37af45ec9954723c79c3017cf (patch) | |
tree | b3f18bca1a29e3ff88013f282e6fb0efdd09aea9 /test/buildtool/file_system | |
parent | c1827db24dbc8f0d6eca47c92f34d85bf6b2b128 (diff) | |
download | justbuild-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.cpp | 13 |
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); |