fix: Keep spdlog loggers valid between tests (#2614)

This commit is contained in:
Ayaz Salikhov
2025-09-15 14:47:35 +01:00
committed by GitHub
parent e996f2b7ab
commit 3f2ada3439
53 changed files with 353 additions and 204 deletions

View File

@@ -50,7 +50,7 @@ constinit auto const kLEDGER_HASH2 = "1B8590C01B0006EDFA9ED60296DD052DC5E90F9965
constinit auto const kSEQ = 30;
} // namespace
struct ExtractionModelNgTests : NoLoggerFixture {};
struct ExtractionModelNgTests : virtual public ::testing::Test {};
TEST_F(ExtractionModelNgTests, LedgerDataCopyableAndEquatable)
{
@@ -178,7 +178,7 @@ TEST_F(ExtractionModelNgTests, BookSuccessorCopyableAndEquatable)
}
}
struct ExtractionNgTests : NoLoggerFixture {};
struct ExtractionNgTests : public virtual ::testing::Test {};
TEST_F(ExtractionNgTests, ModType)
{
@@ -360,7 +360,7 @@ TEST_F(ExtractionNgTests, SuccessorsWithNoNeighborsIncluded)
ASSERT_FALSE(res.has_value());
}
struct ExtractionAssertTest : common::util::WithMockAssert, NoLoggerFixture {};
struct ExtractionAssertTest : common::util::WithMockAssert {};
TEST_F(ExtractionAssertTest, InvalidModTypeAsserts)
{

View File

@@ -67,7 +67,7 @@ struct MockLoadObserver : etlng::InitialLoadObserverInterface {
);
};
struct GrpcSourceNgTests : virtual NoLoggerFixture, tests::util::WithMockXrpLedgerAPIService {
struct GrpcSourceNgTests : virtual public ::testing::Test, tests::util::WithMockXrpLedgerAPIService {
GrpcSourceNgTests()
: WithMockXrpLedgerAPIService("localhost:0"), grpcSource_("localhost", std::to_string(getXRPLMockPort()))
{

View File

@@ -32,7 +32,7 @@
using namespace etlng::impl;
struct NetworkValidatedLedgersTests : NoLoggerFixture {
struct NetworkValidatedLedgersTests : virtual public ::testing::Test {
protected:
util::async::CoroExecutionContext ctx_{2};
std::shared_ptr<etl::NetworkValidatedLedgersInterface> ledgers_ =

View File

@@ -254,7 +254,7 @@ struct MockExtNftBurnReadonly {
}
};
struct RegistryTest : NoLoggerFixture, util::prometheus::WithPrometheus {
struct RegistryTest : util::prometheus::WithPrometheus {
RegistryTest()
{
state_.isWriting = true;

View File

@@ -52,7 +52,7 @@ public:
};
} // namespace
struct ForwardSchedulerTests : NoLoggerFixture {
struct ForwardSchedulerTests : virtual public ::testing::Test {
protected:
MockNetworkValidatedLedgersPtr networkValidatedLedgers_;
};

View File

@@ -86,7 +86,7 @@ struct MockMonitor : etlng::MonitorInterface {
MOCK_METHOD(void, stop, (), (override));
};
struct TaskManagerTests : NoLoggerFixture {
struct TaskManagerTests : virtual public ::testing::Test {
using MockSchedulerType = testing::NiceMock<MockScheduler>;
using MockExtractorType = testing::NiceMock<MockExtractor>;
using MockLoaderType = testing::NiceMock<MockLoader>;

View File

@@ -59,7 +59,7 @@ createTestData()
} // namespace
struct CacheExtTests : NoLoggerFixture, util::prometheus::WithPrometheus {
struct CacheExtTests : util::prometheus::WithPrometheus {
protected:
MockLedgerCache cache_;
std::shared_ptr<etlng::impl::CacheUpdater> updater_ = std::make_shared<etlng::impl::CacheUpdater>(cache_);