From 15eab57c6fc807420ed6a9cfc5b672de4b3d3e20 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 3 Oct 2021 19:38:40 +0100 Subject: Only run testRefreshGitRepository if non-shallow portage repo is available --- gentoobrowse-api/unittests/testMaintenance.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gentoobrowse-api/unittests/testMaintenance.cpp b/gentoobrowse-api/unittests/testMaintenance.cpp index 19ed59a..c287b1e 100644 --- a/gentoobrowse-api/unittests/testMaintenance.cpp +++ b/gentoobrowse-api/unittests/testMaintenance.cpp @@ -275,7 +275,14 @@ BOOST_AUTO_TEST_CASE(testUpdateGitRepository) BOOST_REQUIRE(std::filesystem::is_regular_file(testRepo / "net-misc" / "gentoobrowse-api" / "Manifest")); } -BOOST_AUTO_TEST_CASE(testRefreshGitRepository) +struct localPortageRepoIsComplete { + boost::test_tools::assertion_result operator()(boost::unit_test::test_unit_id) const + { + return !std::filesystem::exists("/usr/portage/.git/shallow"); + } +}; + +BOOST_AUTO_TEST_CASE(testRefreshGitRepository, *boost::unit_test::precondition(localPortageRepoIsComplete {})) { auto db = DB::ConnectionPtr(DB::MockDatabase::openConnectionTo("GentooBrowseAPI")); auto insRepo = db->modify( -- cgit v1.2.3