aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src
diff options
context:
space:
mode:
Diffstat (limited to 'searchcore/src')
-rw-r--r--searchcore/src/apps/proton/proton.cpp1
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp3
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp3
-rw-r--r--searchcore/src/tests/proton/attribute/document_field_extractor/document_field_extractor_test.cpp1
-rw-r--r--searchcore/src/tests/proton/bucketdb/bucketdb/.gitignore1
-rw-r--r--searchcore/src/tests/proton/bucketdb/bucketdb/CMakeLists.txt8
-rw-r--r--searchcore/src/tests/proton/common/CMakeLists.txt15
-rw-r--r--searchcore/src/tests/proton/common/attribute_updater_test.cpp1
-rw-r--r--searchcore/src/tests/proton/common/bucketdb_test.cpp (renamed from searchcore/src/tests/proton/bucketdb/bucketdb/bucketdb_test.cpp)12
-rw-r--r--searchcore/src/tests/proton/common/feedoperation_test.cpp1
-rw-r--r--searchcore/src/tests/proton/common/hw_info_sampler/hw_info_sampler_test.cpp4
-rw-r--r--searchcore/src/tests/proton/common/index_writer_test.cpp (renamed from searchcore/src/tests/proton/index/index_writer/index_writer_test.cpp)11
-rw-r--r--searchcore/src/tests/proton/common/metrics_engine_test.cpp (renamed from searchcore/src/tests/proton/metrics/metrics_engine/metrics_engine_test.cpp)9
-rw-r--r--searchcore/src/tests/proton/common/pendinglidtracker_test.cpp3
-rw-r--r--searchcore/src/tests/proton/common/proton_config_fetcher_test.cpp (renamed from searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp)8
-rw-r--r--searchcore/src/tests/proton/common/proton_disk_layout_test.cpp (renamed from searchcore/src/tests/proton/proton_disk_layout/proton_disk_layout_test.cpp)16
-rw-r--r--searchcore/src/tests/proton/common/statusreport_test.cpp3
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary_test.cpp5
-rw-r--r--searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp3
-rw-r--r--searchcore/src/tests/proton/documentdb/CMakeLists.txt31
-rw-r--r--searchcore/src/tests/proton/documentdb/bucketmover_common.cpp (renamed from searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.cpp)24
-rw-r--r--searchcore/src/tests/proton/documentdb/bucketmover_common.h (renamed from searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.h)0
-rw-r--r--searchcore/src/tests/proton/documentdb/clusterstatehandler/.gitignore1
-rw-r--r--searchcore/src/tests/proton/documentdb/clusterstatehandler/CMakeLists.txt15
-rw-r--r--searchcore/src/tests/proton/documentdb/clusterstatehandler_test.cpp (renamed from searchcore/src/tests/proton/documentdb/clusterstatehandler/clusterstatehandler_test.cpp)9
-rw-r--r--searchcore/src/tests/proton/documentdb/configurer_test.cpp5
-rw-r--r--searchcore/src/tests/proton/documentdb/document_scan_iterator/.gitignore1
-rw-r--r--searchcore/src/tests/proton/documentdb/document_scan_iterator/CMakeLists.txt12
-rw-r--r--searchcore/src/tests/proton/documentdb/document_scan_iterator_test.cpp (renamed from searchcore/src/tests/proton/documentdb/document_scan_iterator/document_scan_iterator_test.cpp)8
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/.gitignore1
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/CMakeLists.txt23
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs_test.cpp (renamed from searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp)70
-rw-r--r--searchcore/src/tests/proton/documentdb/documentbucketmover/.gitignore1
-rw-r--r--searchcore/src/tests/proton/documentdb/documentbucketmover/CMakeLists.txt30
-rw-r--r--searchcore/src/tests/proton/documentdb/documentbucketmover_test.cpp (renamed from searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp)11
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdb_test.cpp3
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfig/.gitignore1
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfig/CMakeLists.txt9
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfig_test.cpp (renamed from searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp)2
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfigscout/.gitignore1
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfigscout/CMakeLists.txt10
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfigscout_test.cpp (renamed from searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp)8
-rw-r--r--searchcore/src/tests/proton/documentdb/documentmover_test.cpp (renamed from searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp)8
-rw-r--r--searchcore/src/tests/proton/documentdb/executor_threading_service/CMakeLists.txt10
-rw-r--r--searchcore/src/tests/proton/documentdb/executor_threading_service_test.cpp (renamed from searchcore/src/tests/proton/documentdb/executor_threading_service/executor_threading_service_test.cpp)3
-rw-r--r--searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp3
-rw-r--r--searchcore/src/tests/proton/documentdb/gtest_runner.cpp8
-rw-r--r--searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/.gitignore1
-rw-r--r--searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/CMakeLists.txt9
-rw-r--r--searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job_test.cpp (renamed from searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/job_tracked_maintenance_job_test.cpp)5
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_common.cpp (renamed from searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp)0
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_common.h (renamed from searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h)0
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_compaction/.gitignore1
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_compaction/CMakeLists.txt39
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_compaction_test.cpp (renamed from searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_compaction_test.cpp)2
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_handler_test.cpp (renamed from searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp)4
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_jobtest.cpp (renamed from searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp)0
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_jobtest.h (renamed from searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h)0
-rw-r--r--searchcore/src/tests/proton/documentdb/vespatest_runner.cpp (renamed from searchcore/src/tests/proton/documentdb/vespa_testrunner.cpp)0
-rw-r--r--searchcore/src/tests/proton/flushengine/flushengine_test.cpp3
-rw-r--r--searchcore/src/tests/proton/flushengine/prepare_restart_flush_strategy/prepare_restart_flush_strategy_test.cpp2
-rw-r--r--searchcore/src/tests/proton/index/index_writer/.gitignore1
-rw-r--r--searchcore/src/tests/proton/index/index_writer/CMakeLists.txt10
-rw-r--r--searchcore/src/tests/proton/matching/constant_value_repo/constant_value_repo_test.cpp2
-rw-r--r--searchcore/src/tests/proton/matching/index_environment/index_environment_test.cpp4
-rw-r--r--searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp3
-rw-r--r--searchcore/src/tests/proton/matching/query_test.cpp3
-rw-r--r--searchcore/src/tests/proton/matching/sessionmanager_test.cpp4
-rw-r--r--searchcore/src/tests/proton/metrics/metrics_engine/.gitignore1
-rw-r--r--searchcore/src/tests/proton/metrics/metrics_engine/CMakeLists.txt9
-rw-r--r--searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp3
-rw-r--r--searchcore/src/tests/proton/proton_config_fetcher/.cvsignore3
-rw-r--r--searchcore/src/tests/proton/proton_config_fetcher/.gitignore1
-rw-r--r--searchcore/src/tests/proton/proton_config_fetcher/CMakeLists.txt9
-rw-r--r--searchcore/src/tests/proton/proton_disk_layout/CMakeLists.txt9
-rw-r--r--searchcore/src/tests/proton/reference/gid_to_lid_mapper/gid_to_lid_mapper_test.cpp4
-rw-r--r--searchcore/src/tests/proton/server/.gitignore5
-rw-r--r--searchcore/src/tests/proton/server/CMakeLists.txt48
-rw-r--r--searchcore/src/tests/proton/server/documentretriever_test.cpp8
-rw-r--r--searchcore/src/tests/proton/server/feeddebugger_test.cpp12
-rw-r--r--searchcore/src/tests/proton/server/feedstates_test.cpp8
-rw-r--r--searchcore/src/tests/proton/server/health_adapter/.gitignore1
-rw-r--r--searchcore/src/tests/proton/server/health_adapter/CMakeLists.txt9
-rw-r--r--searchcore/src/tests/proton/server/health_adapter_test.cpp (renamed from searchcore/src/tests/proton/server/health_adapter/health_adapter_test.cpp)2
-rw-r--r--searchcore/src/tests/proton/server/memory_flush_config_updater_test.cpp (renamed from searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp)2
-rw-r--r--searchcore/src/tests/proton/server/memoryconfigstore_test.cpp5
-rw-r--r--searchcore/src/tests/proton/summaryengine/summaryengine_test.cpp3
-rw-r--r--searchcore/src/vespa/searchcore/grouping/groupingmanager.h4
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.cpp24
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.h23
90 files changed, 232 insertions, 470 deletions
diff --git a/searchcore/src/apps/proton/proton.cpp b/searchcore/src/apps/proton/proton.cpp
index de256ebf0d9..c5a7cd9e32d 100644
--- a/searchcore/src/apps/proton/proton.cpp
+++ b/searchcore/src/apps/proton/proton.cpp
@@ -327,6 +327,7 @@ App::main(int argc, char **argv)
try {
setupSignals();
setup_fadvise();
+ FastOS_FileInterface::enableFSync();
Transport transport(buildTransportConfig());
startAndRun(transport.transport(), argc, argv);
} catch (const vespalib::InvalidCommandLineArgumentsException &e) {
diff --git a/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp b/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp
index df27c4d7cc2..5e270bdae99 100644
--- a/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp
@@ -32,13 +32,14 @@
#include <vespa/searchcommon/attribute/i_attribute_functor.h>
#include <vespa/searchcommon/attribute/iattributevector.h>
#include <vespa/searchcommon/attribute/config.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/foreground_thread_executor.h>
#include <vespa/vespalib/util/foregroundtaskexecutor.h>
#include <vespa/vespalib/util/hw_info.h>
#include <vespa/vespalib/util/size_literals.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
#include <vespa/config-attributes.h>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
#include <vespa/log/log.h>
LOG_SETUP("attribute_manager_test");
diff --git a/searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp b/searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp
index a20e08d5be2..cdb0bcdb66a 100644
--- a/searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_usage_filter/attribute_usage_filter_test.cpp
@@ -3,8 +3,9 @@
#include <vespa/searchcore/proton/attribute/attribute_usage_filter.h>
#include <vespa/searchcore/proton/attribute/i_attribute_usage_listener.h>
#include <vespa/searchlib/attribute/address_space_components.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/size_literals.h>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
#include <vespa/log/log.h>
LOG_SETUP("attribute_usage_filter_test");
diff --git a/searchcore/src/tests/proton/attribute/document_field_extractor/document_field_extractor_test.cpp b/searchcore/src/tests/proton/attribute/document_field_extractor/document_field_extractor_test.cpp
index 6f84b793608..f93853d2d1d 100644
--- a/searchcore/src/tests/proton/attribute/document_field_extractor/document_field_extractor_test.cpp
+++ b/searchcore/src/tests/proton/attribute/document_field_extractor/document_field_extractor_test.cpp
@@ -15,6 +15,7 @@
#include <vespa/searchcommon/common/undefinedvalues.h>
#include <vespa/searchcore/proton/attribute/document_field_extractor.h>
#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
using document::Field;
using document::DataType;
diff --git a/searchcore/src/tests/proton/bucketdb/bucketdb/.gitignore b/searchcore/src/tests/proton/bucketdb/bucketdb/.gitignore
deleted file mode 100644
index 3512e4268a1..00000000000
--- a/searchcore/src/tests/proton/bucketdb/bucketdb/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-searchcore_bucketdb_test_app
diff --git a/searchcore/src/tests/proton/bucketdb/bucketdb/CMakeLists.txt b/searchcore/src/tests/proton/bucketdb/bucketdb/CMakeLists.txt
deleted file mode 100644
index 70ed1efc7f7..00000000000
--- a/searchcore/src/tests/proton/bucketdb/bucketdb/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(searchcore_bucketdb_test_app TEST
- SOURCES
- bucketdb_test.cpp
- DEPENDS
- searchcore_bucketdb
-)
-vespa_add_test(NAME searchcore_bucketdb_test_app COMMAND searchcore_bucketdb_test_app)
diff --git a/searchcore/src/tests/proton/common/CMakeLists.txt b/searchcore/src/tests/proton/common/CMakeLists.txt
index 7eec733214b..315ad8b5ce6 100644
--- a/searchcore/src/tests/proton/common/CMakeLists.txt
+++ b/searchcore/src/tests/proton/common/CMakeLists.txt
@@ -2,17 +2,22 @@
vespa_add_executable(searchcore_proton_common_vespa_test_app TEST
SOURCES
vespa_testrunner.cpp
- selectpruner_test.cpp
- cachedselect_test.cpp
- pendinglidtracker_test.cpp
attribute_updater_test.cpp
- state_reporter_utils_test.cpp
+ bucketdb_test.cpp
+ cachedselect_test.cpp
document_type_inspector_test.cpp
- feedoperation_test.cpp
documentdb_job_trackers_test.cpp
+ feedoperation_test.cpp
+ index_writer_test.cpp
job_load_sampler_test.cpp
job_tracked_flush_test.cpp
+ metrics_engine_test.cpp
+ pendinglidtracker_test.cpp
+ proton_config_fetcher_test.cpp
+ proton_disk_layout_test.cpp
+ state_reporter_utils_test.cpp
statusreport_test.cpp
+ selectpruner_test.cpp
DEPENDS
searchcore_proton_metrics
searchcore_feedoperation
diff --git a/searchcore/src/tests/proton/common/attribute_updater_test.cpp b/searchcore/src/tests/proton/common/attribute_updater_test.cpp
index 432386af0e6..b082e1f9907 100644
--- a/searchcore/src/tests/proton/common/attribute_updater_test.cpp
+++ b/searchcore/src/tests/proton/common/attribute_updater_test.cpp
@@ -39,6 +39,7 @@
#include <vespa/vespalib/stllike/hash_map.hpp>
#include <vespa/vespalib/test/insertion_operators.h>
#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
using namespace document;
using document::config_builder::Array;
diff --git a/searchcore/src/tests/proton/bucketdb/bucketdb/bucketdb_test.cpp b/searchcore/src/tests/proton/common/bucketdb_test.cpp
index 213d9c38290..6d9c355f5f5 100644
--- a/searchcore/src/tests/proton/bucketdb/bucketdb/bucketdb_test.cpp
+++ b/searchcore/src/tests/proton/common/bucketdb_test.cpp
@@ -7,9 +7,7 @@
#include <vespa/vespalib/stllike/asciistream.h>
#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/vespalib/testkit/test_kit.h>
-
-#include <vespa/log/log.h>
-LOG_SETUP("bucketdb_test");
+#include <vespa/vespalib/testkit/test_master.hpp>
using namespace document;
using namespace proton;
@@ -20,6 +18,8 @@ using storage::spi::BucketInfo;
using storage::spi::Timestamp;
using vespalib::Slime;
+namespace {
+
constexpr uint32_t MIN_NUM_BITS = 8u;
const GlobalId GID_1("111111111111");
const BucketId BUCKET_1(MIN_NUM_BITS, GID_1.convertToBucketId().getRawId());
@@ -32,7 +32,6 @@ constexpr uint32_t DOCSIZE_2(10000u);
using RS = BucketInfo::ReadyState;
using SDT = SubDbType;
-namespace {
constexpr uint32_t bucket_bits = 16;
@@ -48,7 +47,6 @@ GlobalId make_gid(uint32_t n, uint32_t i)
return id.getGlobalId();
}
-}
void
assertDocCount(uint32_t ready,
@@ -140,6 +138,8 @@ struct Fixture
}
};
+}
+
TEST_F("require that bucket db tracks doc counts per sub db type", Fixture)
{
TEST_DO(assertDocCount(0, 0, 0, f.get()));
@@ -404,5 +404,3 @@ TEST_F("test BucketDB active document tracking", Fixture) {
f._db.unloadBucket(make_bucket_id(5), bs);
EXPECT_EQUAL(0u, f._db.getNumActiveDocs());
}
-
-TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/tests/proton/common/feedoperation_test.cpp b/searchcore/src/tests/proton/common/feedoperation_test.cpp
index 48893aa7da3..cae51211dfe 100644
--- a/searchcore/src/tests/proton/common/feedoperation_test.cpp
+++ b/searchcore/src/tests/proton/common/feedoperation_test.cpp
@@ -25,6 +25,7 @@
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/document/datatype/documenttype.h>
#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
using document::BucketId;
using document::DataType;
diff --git a/searchcore/src/tests/proton/common/hw_info_sampler/hw_info_sampler_test.cpp b/searchcore/src/tests/proton/common/hw_info_sampler/hw_info_sampler_test.cpp
index ad74039a5ee..88bc22932d2 100644
--- a/searchcore/src/tests/proton/common/hw_info_sampler/hw_info_sampler_test.cpp
+++ b/searchcore/src/tests/proton/common/hw_info_sampler/hw_info_sampler_test.cpp
@@ -49,7 +49,7 @@ TEST_F("Test that hw_info_sampler uses override info", Fixture)
Config samplerCfg(0, 75.0, 100.0, sampleLen, sharedDisk, 0, 0);
HwInfoSampler sampler(test_dir, samplerCfg);
EXPECT_EQUAL(75.0, sampler.diskWriteSpeed());
- EXPECT_NOT_EQUAL(0, time_point_to_long(sampler.sampleTime()));
+ EXPECT_NOT_EQUAL(0l, time_point_to_long(sampler.sampleTime()));
EXPECT_TRUE(sampler.hwInfo().disk().slow());
}
@@ -71,7 +71,7 @@ TEST_F("Test that hw_info_sampler can sample disk write speed", Fixture)
Config samplerCfg(0, 0.0, 100.0, sampleLen, sharedDisk, 0, 0);
HwInfoSampler sampler(test_dir, samplerCfg);
ASSERT_NOT_EQUAL(0.0, sampler.diskWriteSpeed());
- ASSERT_NOT_EQUAL(0, time_point_to_long(sampler.sampleTime()));
+ ASSERT_NOT_EQUAL(0l, time_point_to_long(sampler.sampleTime()));
HwInfoSampler sampler2(test_dir, samplerCfg);
EXPECT_APPROX(sampler.diskWriteSpeed(), sampler2.diskWriteSpeed(), 0.1);
EXPECT_EQUAL(time_point_to_long(sampler.sampleTime()),
diff --git a/searchcore/src/tests/proton/index/index_writer/index_writer_test.cpp b/searchcore/src/tests/proton/common/index_writer_test.cpp
index c52eb940817..9f39d6ec66d 100644
--- a/searchcore/src/tests/proton/index/index_writer/index_writer_test.cpp
+++ b/searchcore/src/tests/proton/common/index_writer_test.cpp
@@ -7,9 +7,6 @@
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/stringfmt.h>
-#include <vespa/log/log.h>
-LOG_SETUP("index_writer_test");
-
using namespace proton;
using namespace search;
using namespace search::index;
@@ -19,6 +16,7 @@ using vespalib::IDestructorCallback;
using document::Document;
+namespace {
std::string
toString(const std::vector<SerialNum> &vec)
{
@@ -106,6 +104,8 @@ struct Fixture
}
};
+}
+
TEST_F("require that index writer ignores old operations", Fixture)
{
f.mim.flushed = 10;
@@ -135,8 +135,3 @@ TEST_F("require that old compactLidSpace is not forwarded to index manager", Fix
EXPECT_EQUAL(0u, f.mim.wantedLidLimit);
EXPECT_EQUAL(0u, f.mim.compactSerial);
}
-
-TEST_MAIN()
-{
- TEST_RUN_ALL();
-}
diff --git a/searchcore/src/tests/proton/metrics/metrics_engine/metrics_engine_test.cpp b/searchcore/src/tests/proton/common/metrics_engine_test.cpp
index dd622a4cac1..f4fc4c52ab1 100644
--- a/searchcore/src/tests/proton/metrics/metrics_engine/metrics_engine_test.cpp
+++ b/searchcore/src/tests/proton/common/metrics_engine_test.cpp
@@ -5,11 +5,10 @@
#include <vespa/searchcore/proton/metrics/metrics_engine.h>
#include <vespa/vespalib/testkit/test_kit.h>
-#include <vespa/log/log.h>
-LOG_SETUP("metrics_engine_test");
-
using namespace proton;
+namespace {
+
struct DummyMetricSet : public metrics::MetricSet {
DummyMetricSet(const vespalib::string &name) : metrics::MetricSet(name, {}, "", nullptr) {}
};
@@ -43,6 +42,8 @@ struct AttributeMetricsFixture {
}
};
+}
+
TEST_F("require that attribute metrics can be added", AttributeMetricsFixture)
{
TEST_DO(f.assertRegisteredMetrics(0));
@@ -74,5 +75,3 @@ TEST_F("require that all attribute metrics can be cleaned", AttributeMetricsFixt
TEST_DO(f.assertMetricsNotExists("foo"));
TEST_DO(f.assertMetricsNotExists("bar"));
}
-
-TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/tests/proton/common/pendinglidtracker_test.cpp b/searchcore/src/tests/proton/common/pendinglidtracker_test.cpp
index f8d0d218670..45b80d0c32e 100644
--- a/searchcore/src/tests/proton/common/pendinglidtracker_test.cpp
+++ b/searchcore/src/tests/proton/common/pendinglidtracker_test.cpp
@@ -1,7 +1,8 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchcore/proton/common/pendinglidtracker.h>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
using namespace proton;
diff --git a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp b/searchcore/src/tests/proton/common/proton_config_fetcher_test.cpp
index 1dfc6c481b6..50ed24a0add 100644
--- a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
+++ b/searchcore/src/tests/proton/common/proton_config_fetcher_test.cpp
@@ -24,10 +24,11 @@
#include <vespa/fileacquirer/config-filedistributorrpc.h>
#include <vespa/vespalib/util/hw_info.h>
#include <vespa/vespalib/util/varholder.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/config.h>
#include <map>
#include <thread>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
using namespace config;
using namespace proton;
@@ -48,6 +49,7 @@ using search::GrowStrategy;
using vespalib::datastore::CompactionStrategy;
using vespalib::HwInfo;
+namespace {
constexpr int proton_rpc_port = 9010; // Not used for listening in this test
struct DoctypeFixture {
@@ -228,6 +230,8 @@ struct ProtonConfigOwner : public proton::IProtonConfigurer
ProtonConfigOwner::~ProtonConfigOwner() = default;
+}
+
TEST_F("require that bootstrap config manager creats correct key set", BootstrapConfigManager("foo")) {
const ConfigKeySet set(f1.createConfigKeySet());
ASSERT_EQUAL(4u, set.size());
@@ -498,5 +502,3 @@ TEST("test HwInfo equality") {
EXPECT_FALSE(HwInfo(HwInfo::Disk(1, false, false), 1ul, 1ul) == HwInfo(HwInfo::Disk(1, false,false), 2ul, 1ul));
EXPECT_FALSE(HwInfo(HwInfo::Disk(1, false, false), 1ul, 1ul) == HwInfo(HwInfo::Disk(2, false,false), 1ul, 1ul));
}
-
-TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/tests/proton/proton_disk_layout/proton_disk_layout_test.cpp b/searchcore/src/tests/proton/common/proton_disk_layout_test.cpp
index 881c547df1e..5f3a08246c4 100644
--- a/searchcore/src/tests/proton/proton_disk_layout/proton_disk_layout_test.cpp
+++ b/searchcore/src/tests/proton/common/proton_disk_layout_test.cpp
@@ -8,10 +8,11 @@
#include <vespa/searchlib/transactionlog/translogserver.h>
#include <vespa/searchlib/transactionlog/translogclient.h>
#include <vespa/vespalib/io/fileutil.h>
-#include <vespa/vespalib/testkit/test_kit.h>
-#include <vespa/vespalib/test/insertion_operators.h>
#include <vespa/vespalib/util/stringfmt.h>
#include <filesystem>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
+#include <vespa/vespalib/test/insertion_operators.h>
using search::index::DummyFileHeaderContext;
using search::transactionlog::client::TransLogClient;
@@ -20,10 +21,11 @@ using proton::DocTypeName;
using proton::ProtonDiskLayout;
using proton::Transport;
-static constexpr unsigned int tlsPort = proton::test::port_numbers::proton_disk_layout_tls_port;
+namespace {
+constexpr unsigned int tlsPort = proton::test::port_numbers::proton_disk_layout_tls_port;
-static const vespalib::string baseDir("testdb");
-static const vespalib::string documentsDir(baseDir + "/documents");
+const vespalib::string baseDir("testdb");
+const vespalib::string documentsDir(baseDir + "/documents");
struct FixtureBase
{
@@ -114,6 +116,8 @@ struct Fixture : public FixtureBase, public DiskLayoutFixture
}
};
+}
+
TEST_F("require that empty config is ok", Fixture) {
TEST_DO(f.assertDirs({}));
TEST_DO(f.assertDomains({}));
@@ -180,5 +184,3 @@ TEST_F("require that live document db dir remove works", Fixture)
TEST_DO(f.assertDirs({}));
TEST_DO(f.assertDomains({}));
}
-
-TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/tests/proton/common/statusreport_test.cpp b/searchcore/src/tests/proton/common/statusreport_test.cpp
index 052eb795529..8465f0ec56d 100644
--- a/searchcore/src/tests/proton/common/statusreport_test.cpp
+++ b/searchcore/src/tests/proton/common/statusreport_test.cpp
@@ -1,6 +1,7 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchcore/proton/common/statusreport.h>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
namespace proton {
diff --git a/searchcore/src/tests/proton/docsummary/docsummary_test.cpp b/searchcore/src/tests/proton/docsummary/docsummary_test.cpp
index 361e37278da..28b26428a5e 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary_test.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary_test.cpp
@@ -65,13 +65,14 @@
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/encoding/base64.h>
#include <vespa/vespalib/net/socket_spec.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/geo/zcurve.h>
#include <vespa/vespalib/util/destructor_callbacks.h>
#include <vespa/vespalib/util/size_literals.h>
#include <vespa/config-summary.h>
#include <filesystem>
#include <regex>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
#include <vespa/log/log.h>
LOG_SETUP("docsummary_test");
@@ -590,7 +591,7 @@ TEST("requireThatSummariesTimeout")
const auto & root = rep->root();
const auto & field = root["errors"];
EXPECT_TRUE(field.valid());
- EXPECT_EQUAL(field[0]["type"].asString(), "timeout");
+ EXPECT_EQUAL(field[0]["type"].asString(), vespalib::Memory("timeout"));
auto bufstring = field[0]["message"].asString();
EXPECT_TRUE(std::regex_search(bufstring.data, bufstring.data + bufstring.size, std::regex("Timed out 1 summaries with -[0-9]+us left.")));
}
diff --git a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp b/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp
index 85883324080..b2920ae5202 100644
--- a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp
+++ b/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp
@@ -18,8 +18,9 @@
#include <vespa/persistence/spi/result.h>
#include <vespa/persistence/spi/test.h>
#include <vespa/vespalib/objects/nbostream.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <unordered_set>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
#include <vespa/log/log.h>
LOG_SETUP("document_iterator_test");
diff --git a/searchcore/src/tests/proton/documentdb/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/CMakeLists.txt
index 374cdb6ab52..4bf42c1701b 100644
--- a/searchcore/src/tests/proton/documentdb/CMakeLists.txt
+++ b/searchcore/src/tests/proton/documentdb/CMakeLists.txt
@@ -22,13 +22,18 @@ vespa_add_executable(searchcore_documentdb_test_app TEST
)
vespa_add_test(NAME searchcore_documentdb_test_app COMMAND searchcore_documentdb_test_app)
-vespa_add_executable(searchcore_proton_documentdb_vespa_test_app TEST
+vespa_add_executable(searchcore_proton_documentdb_vespatest_test_app TEST
SOURCES
- vespa_testrunner.cpp
+ vespatest_runner.cpp
buckethandler_test.cpp
combiningfeedview_test.cpp
configurer_test.cpp
+ document_scan_iterator_test.cpp
+ document_subdbs_test.cpp
+ documentdbconfig_test.cpp
+ documentdbconfigscout_test.cpp
feedview_test.cpp
+ job_tracked_maintenance_job_test.cpp
maintenancecontroller_test.cpp
storeonlyfeedview_test.cpp
DEPENDS
@@ -36,4 +41,24 @@ vespa_add_executable(searchcore_proton_documentdb_vespa_test_app TEST
searchcore_feedoperation
searchcore_test
)
-vespa_add_test(NAME searchcore_proton_documentdb_vespa_test_app COMMAND searchcore_proton_documentdb_vespa_test_app)
+vespa_add_test(NAME searchcore_proton_documentdb_vespatest_test_app COMMAND searchcore_proton_documentdb_vespatest_test_app)
+
+vespa_add_executable(searchcore_proton_documentdb_gtest_test_app TEST
+ SOURCES
+ gtest_runner.cpp
+ clusterstatehandler_test.cpp
+ bucketmover_common.cpp
+ documentbucketmover_test.cpp
+ documentmover_test.cpp
+ executor_threading_service_test.cpp
+ lid_space_common.cpp
+ lid_space_compaction_test.cpp
+ lid_space_handler_test.cpp
+ lid_space_jobtest.cpp
+ DEPENDS
+ searchcore_server
+ searchcore_feedoperation
+ searchcore_test
+ GTest::GTest
+)
+vespa_add_test(NAME searchcore_proton_documentdb_gtest_test_app COMMAND searchcore_proton_documentdb_gtest_test_app)
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.cpp b/searchcore/src/tests/proton/documentdb/bucketmover_common.cpp
index 5c4cfb393a4..fa366d3cc3e 100644
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.cpp
+++ b/searchcore/src/tests/proton/documentdb/bucketmover_common.cpp
@@ -3,7 +3,7 @@
#include "bucketmover_common.h"
#include <vespa/searchcore/proton/documentmetastore/documentmetastore.h>
#include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h>
-#include <vespa/vespalib/testkit/test_macros.h>
+#include <vespa/vespalib/gtest/gtest.h>
using vespalib::IDestructorCallback;
@@ -70,7 +70,7 @@ MySubDb::insertDocs(const UserDocuments &docs_) {
_metaStore.put(testDoc.getGid(), testDoc.getBucket(),
testDoc.getTimestamp(), testDoc.getDocSize(), testDoc.getLid(), 0u);
_realRetriever->_docs.push_back(testDoc.getDoc());
- ASSERT_EQUAL(testDoc.getLid() + 1, _realRetriever->_docs.size());
+ ASSERT_EQ(testDoc.getLid() + 1, _realRetriever->_docs.size());
}
}
_docs.merge(docs_);
@@ -83,16 +83,22 @@ MySubDb::remove(uint32_t subDbId, uint32_t lid) {
return _metaStore.remove(lid, 0u);
}
+template<typename A, typename B>
+bool expect_eq(const A & a, const B & b) {
+ EXPECT_EQ(a, b);
+ return (a == b);
+}
+
bool
assertEqual(const document::BucketId &bucket, const proton::test::Document &doc,
uint32_t sourceSubDbId, uint32_t targetSubDbId, const MoveOperation &op) {
- if (!EXPECT_EQUAL(bucket, op.getBucketId())) return false;
- if (!EXPECT_EQUAL(doc.getTimestamp(), op.getTimestamp())) return false;
- if (!EXPECT_EQUAL(doc.getDocId(), op.getDocument()->getId())) return false;
- if (!EXPECT_EQUAL(doc.getLid(), op.getSourceDbdId().getLid())) return false;
- if (!EXPECT_EQUAL(sourceSubDbId, op.getSourceDbdId().getSubDbId())) return false;
- if (!EXPECT_EQUAL(0u, op.getTargetDbdId().getLid())) return false;
- if (!EXPECT_EQUAL(targetSubDbId, op.getTargetDbdId().getSubDbId())) return false;
+ if (!expect_eq(bucket, op.getBucketId())) return false;
+ if (!expect_eq(doc.getTimestamp(), op.getTimestamp())) return false;
+ if (!expect_eq(doc.getDocId(), op.getDocument()->getId())) return false;
+ if (!expect_eq(doc.getLid(), op.getSourceDbdId().getLid())) return false;
+ if (!expect_eq(sourceSubDbId, op.getSourceDbdId().getSubDbId())) return false;
+ if (!expect_eq(0u, op.getTargetDbdId().getLid())) return false;
+ if (!expect_eq(targetSubDbId, op.getTargetDbdId().getSubDbId())) return false;
return true;
}
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.h b/searchcore/src/tests/proton/documentdb/bucketmover_common.h
index e21f084ff6e..e21f084ff6e 100644
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.h
+++ b/searchcore/src/tests/proton/documentdb/bucketmover_common.h
diff --git a/searchcore/src/tests/proton/documentdb/clusterstatehandler/.gitignore b/searchcore/src/tests/proton/documentdb/clusterstatehandler/.gitignore
deleted file mode 100644
index bc38893db32..00000000000
--- a/searchcore/src/tests/proton/documentdb/clusterstatehandler/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-searchcore_clusterstatehandler_test_app
diff --git a/searchcore/src/tests/proton/documentdb/clusterstatehandler/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/clusterstatehandler/CMakeLists.txt
deleted file mode 100644
index b89d4d9301f..00000000000
--- a/searchcore/src/tests/proton/documentdb/clusterstatehandler/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(searchcore_clusterstatehandler_test_app TEST
- SOURCES
- clusterstatehandler_test.cpp
- DEPENDS
- searchcore_test
- searchcore_server
- searchcore_feedoperation
- searchcore_matching
- searchcore_attribute
- searchcore_pcommon
- searchcore_grouping
- GTest::GTest
-)
-vespa_add_test(NAME searchcore_clusterstatehandler_test_app COMMAND searchcore_clusterstatehandler_test_app)
diff --git a/searchcore/src/tests/proton/documentdb/clusterstatehandler/clusterstatehandler_test.cpp b/searchcore/src/tests/proton/documentdb/clusterstatehandler_test.cpp
index 539ee9ce3aa..d9d7bd279fc 100644
--- a/searchcore/src/tests/proton/documentdb/clusterstatehandler/clusterstatehandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/clusterstatehandler_test.cpp
@@ -8,9 +8,6 @@
#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
-#include <vespa/log/log.h>
-LOG_SETUP("cluster_state_handler_test");
-
using namespace proton;
using document::BucketId;
using storage::lib::Distribution;
@@ -18,6 +15,7 @@ using storage::spi::BucketIdListResult;
using storage::spi::ClusterState;
using storage::spi::Result;
+namespace {
struct MyClusterStateChangedHandler : public IClusterStateChangedHandler {
std::shared_ptr<IBucketStateCalculator> _calc;
void
@@ -65,6 +63,8 @@ struct ClusterStateHandlerTest : testing::Test {
}
};
+}
+
TEST_F(ClusterStateHandlerTest, cluster_state_change_is_notified)
{
const auto& calc = set_cluster_state(basic_state);
@@ -114,6 +114,3 @@ TEST_F(ClusterStateHandlerTest, modified_buckets_are_returned)
EXPECT_EQ(1u, _bucketListHandler.getList().size());
EXPECT_EQ(bucket3, _bucketListHandler.getList()[0]);
}
-
-GTEST_MAIN_RUN_ALL_TESTS()
-
diff --git a/searchcore/src/tests/proton/documentdb/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer_test.cpp
index 9362d26a3b9..3f44d7df7b4 100644
--- a/searchcore/src/tests/proton/documentdb/configurer_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/configurer_test.cpp
@@ -1,7 +1,5 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/test_kit.h>
-
#include <vespa/config-summary.h>
#include <vespa/document/datatype/documenttype.h>
#include <vespa/document/repo/documenttyperepo.h>
@@ -42,6 +40,8 @@
#include <vespa/vespalib/util/testclock.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
#include <filesystem>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
using namespace config;
using namespace document;
@@ -359,6 +359,7 @@ FastAccessFixture::FastAccessFixture()
}
FastAccessFixture::~FastAccessFixture() {
_service.shutdown();
+ std::filesystem::remove_all(std::filesystem::path(BASE_DIR));
}
diff --git a/searchcore/src/tests/proton/documentdb/document_scan_iterator/.gitignore b/searchcore/src/tests/proton/documentdb/document_scan_iterator/.gitignore
deleted file mode 100644
index 6c961d2f232..00000000000
--- a/searchcore/src/tests/proton/documentdb/document_scan_iterator/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-searchcore_document_scan_iterator_test_app
diff --git a/searchcore/src/tests/proton/documentdb/document_scan_iterator/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/document_scan_iterator/CMakeLists.txt
deleted file mode 100644
index 3f891843c1c..00000000000
--- a/searchcore/src/tests/proton/documentdb/document_scan_iterator/CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(searchcore_document_scan_iterator_test_app TEST
- SOURCES
- document_scan_iterator_test.cpp
- DEPENDS
- searchcore_server
- searchcore_feedoperation
- searchcore_documentmetastore
- searchcore_bucketdb
- searchcore_pcommon
-)
-vespa_add_test(NAME searchcore_document_scan_iterator_test_app COMMAND searchcore_document_scan_iterator_test_app)
diff --git a/searchcore/src/tests/proton/documentdb/document_scan_iterator/document_scan_iterator_test.cpp b/searchcore/src/tests/proton/documentdb/document_scan_iterator_test.cpp
index e3ab2737fe5..23ae1c3cb74 100644
--- a/searchcore/src/tests/proton/documentdb/document_scan_iterator/document_scan_iterator_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/document_scan_iterator_test.cpp
@@ -3,9 +3,10 @@
#include <vespa/searchcore/proton/server/document_scan_iterator.h>
#include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h>
#include <vespa/vespalib/test/insertion_operators.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/document/base/documentid.h>
#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
using namespace document;
using namespace proton;
@@ -81,8 +82,3 @@ TEST_F("require that only lids > lid limit are returned", Fixture)
f.add({1,2,3,4,5,6,7,8});
assertLidSet({5,6,7,8}, f.scan(4, 4));
}
-
-TEST_MAIN()
-{
- TEST_RUN_ALL();
-}
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/.gitignore b/searchcore/src/tests/proton/documentdb/document_subdbs/.gitignore
deleted file mode 100644
index e47d2bafa0e..00000000000
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-searchcore_document_subdbs_test_app
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/document_subdbs/CMakeLists.txt
deleted file mode 100644
index a021a8a40b6..00000000000
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/CMakeLists.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(searchcore_document_subdbs_test_app TEST
- SOURCES
- document_subdbs_test.cpp
- DEPENDS
- searchcore_test
- searchcore_server
- searchcore_initializer
- searchcore_reprocessing
- searchcore_index
- searchcore_docsummary
- searchcore_persistenceengine
- searchcore_feedoperation
- searchcore_matching
- searchcore_attribute
- searchcore_flushengine
- searchcore_documentmetastore
- searchcore_bucketdb
- searchcore_pcommon
- searchcore_grouping
- searchcore_proton_metrics
-)
-vespa_add_test(NAME searchcore_document_subdbs_test_app COMMAND searchcore_document_subdbs_test_app)
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp b/searchcore/src/tests/proton/documentdb/document_subdbs_test.cpp
index e824dc647ac..f3f5c2063a0 100644
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/document_subdbs_test.cpp
@@ -38,8 +38,6 @@
#include <vespa/config-bucketspaces.h>
#include <vespa/config/subscription/sourcespec.h>
#include <vespa/document/test/make_bucket_space.h>
-#include <vespa/vespalib/test/insertion_operators.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/destructor_callbacks.h>
#include <vespa/vespalib/util/idestructorcallback.h>
#include <vespa/vespalib/util/hw_info.h>
@@ -47,6 +45,9 @@
#include <vespa/vespalib/util/size_literals.h>
#include <vespa/vespalib/util/testclock.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
+#include <vespa/vespalib/test/insertion_operators.h>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
using namespace cloud::config::filedistribution;
using namespace document;
@@ -84,15 +85,16 @@ using FastAccessContext = FastAccessDocSubDB::Context;
using SearchableContext = SearchableDocSubDB::Context;
using AttributeGuardList = std::vector<AttributeGuard>;
+namespace {
const std::string DOCTYPE_NAME = "searchdocument";
const std::string SUB_NAME = "subdb";
const std::string BASE_DIR = "basedir";
const SerialNum CFG_SERIAL = 5;
-struct ConfigDir1 { static vespalib::string dir() { return TEST_PATH("cfg1"); } };
-struct ConfigDir2 { static vespalib::string dir() { return TEST_PATH("cfg2"); } };
-struct ConfigDir3 { static vespalib::string dir() { return TEST_PATH("cfg3"); } };
-struct ConfigDir4 { static vespalib::string dir() { return TEST_PATH("cfg4"); } };
+struct ConfigDir1 { static vespalib::string dir() { return TEST_PATH("document_subdbs/cfg1"); } };
+struct ConfigDir2 { static vespalib::string dir() { return TEST_PATH("document_subdbs/cfg2"); } };
+struct ConfigDir3 { static vespalib::string dir() { return TEST_PATH("document_subdbs/cfg3"); } };
+struct ConfigDir4 { static vespalib::string dir() { return TEST_PATH("document_subdbs/cfg4"); } };
struct MySubDBOwner : public IDocumentSubDBOwner
{
@@ -289,29 +291,36 @@ struct MyConfigSnapshot
DocBuilder _builder;
DocumentDBConfig::SP _cfg;
BootstrapConfig::SP _bootstrap;
- MyConfigSnapshot(FNET_Transport & transport, Schema schema, const vespalib::string &cfgDir)
- : _schema(std::move(schema)),
- _builder(get_add_fields(_schema.getNumAttributeFields() > 1)),
- _cfg(),
- _bootstrap()
- {
- auto documenttypesConfig = std::make_shared<DocumenttypesConfig>(_builder.get_documenttypes_config());
- auto tuneFileDocumentDB = std::make_shared<TuneFileDocumentDB>();
- _bootstrap = std::make_shared<BootstrapConfig>(1,
- documenttypesConfig,
- _builder.get_repo_sp(),
- std::make_shared<ProtonConfig>(),
- std::make_shared<FiledistributorrpcConfig>(),
- std::make_shared<BucketspacesConfig>(),
- tuneFileDocumentDB, HwInfo(HwInfo::Disk(128_Gi,false,false), HwInfo::Memory(16_Gi), HwInfo::Cpu(8)));
- ::config::DirSpec spec(cfgDir);
- DocumentDBConfigHelper mgr(spec, "searchdocument");
- mgr.forwardConfig(_bootstrap);
- mgr.nextGeneration(transport, 1ms);
- _cfg = mgr.getConfig();
- }
+ MyConfigSnapshot(FNET_Transport & transport, Schema schema, const vespalib::string &cfgDir);
+ MyConfigSnapshot(const MyConfigSnapshot &) = delete;
+ MyConfigSnapshot & operator = (const MyConfigSnapshot &) = delete;
+ ~MyConfigSnapshot();
};
+MyConfigSnapshot::~MyConfigSnapshot() = default;
+
+MyConfigSnapshot::MyConfigSnapshot(FNET_Transport & transport, Schema schema, const vespalib::string &cfgDir)
+ : _schema(std::move(schema)),
+ _builder(get_add_fields(_schema.getNumAttributeFields() > 1)),
+ _cfg(),
+ _bootstrap()
+{
+ auto documenttypesConfig = std::make_shared<DocumenttypesConfig>(_builder.get_documenttypes_config());
+ auto tuneFileDocumentDB = std::make_shared<TuneFileDocumentDB>();
+ _bootstrap = std::make_shared<BootstrapConfig>(1,
+ documenttypesConfig,
+ _builder.get_repo_sp(),
+ std::make_shared<ProtonConfig>(),
+ std::make_shared<FiledistributorrpcConfig>(),
+ std::make_shared<BucketspacesConfig>(),
+ tuneFileDocumentDB, HwInfo(HwInfo::Disk(128_Gi,false,false), HwInfo::Memory(16_Gi), HwInfo::Cpu(8)));
+ ::config::DirSpec spec(cfgDir);
+ DocumentDBConfigHelper mgr(spec, "searchdocument");
+ mgr.forwardConfig(_bootstrap);
+ mgr.nextGeneration(transport, 1ms);
+ _cfg = mgr.getConfig();
+}
+
template <typename Traits>
struct FixtureBase
{
@@ -524,6 +533,8 @@ assertStoreOnly(StoreOnlyDocSubDB & db) {
EXPECT_TRUE(dynamic_cast<MinimalDocumentRetriever *>(db.getDocumentRetriever().get()) != nullptr);
}
+}
+
TEST_F("require that managers and components are instantiated", StoreOnlyFixture)
{
assertStoreOnly(f._subDb);
@@ -1084,8 +1095,3 @@ TEST_F("require that underlying components are explorable", SearchableExplorerFi
EXPECT_TRUE(f._explorer.get_child("attributewriter").get() != nullptr);
EXPECT_TRUE(f._explorer.get_child("index").get() != nullptr);
}
-
-TEST_MAIN()
-{
- TEST_RUN_ALL();
-}
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/.gitignore b/searchcore/src/tests/proton/documentdb/documentbucketmover/.gitignore
deleted file mode 100644
index 4c7bc43b278..00000000000
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-searchcore_documentbucketmover_test_app
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/documentbucketmover/CMakeLists.txt
deleted file mode 100644
index 591dd5fb368..00000000000
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/CMakeLists.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-vespa_add_library(searchcore_bucketmover_test STATIC
- SOURCES
- bucketmover_common.cpp
-)
-
-vespa_add_executable(searchcore_documentbucketmover_test_app TEST
- SOURCES
- documentbucketmover_test.cpp
- DEPENDS
- searchcore_bucketmover_test
- searchcore_test
- searchcore_server
- searchcore_feedoperation
- GTest::GTest
-)
-vespa_add_test(NAME searchcore_documentbucketmover_test_app COMMAND searchcore_documentbucketmover_test_app)
-
-vespa_add_executable(searchcore_documentmover_test_app TEST
- SOURCES
- documentmover_test.cpp
- DEPENDS
- searchcore_bucketmover_test
- searchcore_server
- searchcore_test
- searchcore_feedoperation
- GTest::GTest
-)
-vespa_add_test(NAME searchcore_documentmover_test_app COMMAND searchcore_documentmover_test_app)
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp b/searchcore/src/tests/proton/documentdb/documentbucketmover_test.cpp
index e9407d5445e..c1dd06602ae 100644
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentbucketmover_test.cpp
@@ -8,12 +8,8 @@
#include <vespa/persistence/dummyimpl/dummy_bucket_executor.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
#include <vespa/vespalib/util/lambdatask.h>
-#include <vespa/vespalib/gtest/gtest.h>
-
-#include <vespa/log/log.h>
#include <vespa/searchcore/proton/metrics/documentdb_tagged_metrics.h>
-
-LOG_SETUP("document_bucket_mover_test");
+#include <vespa/vespalib/gtest/gtest.h>
using namespace proton;
using namespace proton::move::test;
@@ -28,6 +24,7 @@ using vespalib::MonitoredRefCount;
using vespalib::RetainGuard;
using vespalib::ThreadStackExecutor;
+namespace {
struct ControllerFixtureBase : public ::testing::Test
{
test::UserDocumentsBuilder _builder;
@@ -170,6 +167,8 @@ struct OnlyReadyControllerFixture : public ControllerFixtureBase
}
};
+}
+
TEST_F(ControllerFixture, require_that_nothing_is_moved_if_bucket_state_says_so)
{
EXPECT_TRUE(_bmj->done());
@@ -760,5 +759,3 @@ TEST_F(MaxOutstandingMoveOpsFixture_2, require_that_bucket_move_job_is_blocked_i
sync();
assertDocsMoved(3, 1);
}
-
-GTEST_MAIN_RUN_ALL_TESTS()
diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
index 97c0331ce0b..82f01c01b7e 100644
--- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
@@ -36,10 +36,11 @@
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/net/socket_spec.h>
#include <vespa/vespalib/stllike/asciistream.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/size_literals.h>
#include <filesystem>
#include <iostream>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
using namespace cloud::config::filedistribution;
using namespace proton;
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfig/.gitignore b/searchcore/src/tests/proton/documentdb/documentdbconfig/.gitignore
deleted file mode 100644
index 18a34a296b9..00000000000
--- a/searchcore/src/tests/proton/documentdb/documentdbconfig/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-searchcore_documentdbconfig_test_app
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfig/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/documentdbconfig/CMakeLists.txt
deleted file mode 100644
index 4f24a2ff1a9..00000000000
--- a/searchcore/src/tests/proton/documentdb/documentdbconfig/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(searchcore_documentdbconfig_test_app TEST
- SOURCES
- documentdbconfig_test.cpp
- DEPENDS
- searchcore_test
- searchcore_server
-)
-vespa_add_test(NAME searchcore_documentdbconfig_test_app COMMAND searchcore_documentdbconfig_test_app)
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfig_test.cpp
index 73d27672380..a8870f66005 100644
--- a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdbconfig_test.cpp
@@ -220,5 +220,3 @@ TEST_F("require that makeDelayedAttributeAspectConfig works, field removed with
auto removed = DocumentDBConfig::makeDelayedAttributeAspectConfig(f.noAttrCfg, *f.attrCfg);
TEST_DO(f.assertNotDelayedConfig(*removed));
}
-
-TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/.gitignore b/searchcore/src/tests/proton/documentdb/documentdbconfigscout/.gitignore
deleted file mode 100644
index 482e85e5db0..00000000000
--- a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-searchcore_documentdbconfigscout_test_app
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/documentdbconfigscout/CMakeLists.txt
deleted file mode 100644
index b8170ba6c11..00000000000
--- a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/CMakeLists.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(searchcore_documentdbconfigscout_test_app TEST
- SOURCES
- documentdbconfigscout_test.cpp
- DEPENDS
- searchcore_test
- searchcore_server
- searchcore_attribute
-)
-vespa_add_test(NAME searchcore_documentdbconfigscout_test_app COMMAND searchcore_documentdbconfigscout_test_app)
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfigscout_test.cpp
index 862792bf274..a945550f108 100644
--- a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdbconfigscout_test.cpp
@@ -4,9 +4,10 @@
#include <vespa/searchcore/proton/server/documentdbconfig.h>
#include <vespa/searchcore/proton/server/documentdbconfigscout.h>
#include <vespa/searchcore/proton/test/documentdb_config_builder.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/config-attributes.h>
#include <ostream>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
using namespace document;
using namespace proton;
@@ -37,8 +38,7 @@ std::ostream& operator<<(std::ostream& os, const AttributesConfig::Attribute::Di
}
-namespace
-{
+namespace {
DDBCSP
getConfig(int64_t generation, const Schema::SP &schema,
@@ -395,5 +395,3 @@ TEST("Test that DocumentDBConfigScout::scout looks ahead")
EXPECT_TRUE(assertScoutedAttributes(scoutedCfg->getAttributesConfig().
attribute));
}
-
-TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp b/searchcore/src/tests/proton/documentdb/documentmover_test.cpp
index bde32da7fb0..666ac0c3ec5 100644
--- a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentmover_test.cpp
@@ -6,13 +6,11 @@
#include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h>
#include <vespa/vespalib/gtest/gtest.h>
-#include <vespa/log/log.h>
-LOG_SETUP("document_bucket_mover_test");
-
using namespace proton;
using namespace proton::move::test;
using document::BucketId;
+namespace {
struct MySubDbTwoBuckets : public MySubDb
{
MySubDbTwoBuckets(test::UserDocumentsBuilder &builder,
@@ -68,6 +66,8 @@ struct DocumentMoverTest : ::testing::Test
}
};
+}
+
TEST_F(DocumentMoverTest, require_that_initial_bucket_mover_is_done)
{
MyMoveOperationLimiter limiter;
@@ -151,5 +151,3 @@ TEST_F(DocumentMoverTest, require_that_cancel_signal_rescheduling_need) {
EXPECT_TRUE(_mover.bucketDone());
EXPECT_TRUE(_mover.needReschedule());
}
-
-GTEST_MAIN_RUN_ALL_TESTS()
diff --git a/searchcore/src/tests/proton/documentdb/executor_threading_service/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/executor_threading_service/CMakeLists.txt
deleted file mode 100644
index 5c5cc270a5f..00000000000
--- a/searchcore/src/tests/proton/documentdb/executor_threading_service/CMakeLists.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(searchcore_executor_threading_service_test_app TEST
- SOURCES
- executor_threading_service_test.cpp
- DEPENDS
- searchcore_test
- searchcore_server
- GTest::GTest
-)
-vespa_add_test(NAME searchcore_executor_threading_service_test_app COMMAND searchcore_executor_threading_service_test_app)
diff --git a/searchcore/src/tests/proton/documentdb/executor_threading_service/executor_threading_service_test.cpp b/searchcore/src/tests/proton/documentdb/executor_threading_service_test.cpp
index 8a354ded706..c3310eb8838 100644
--- a/searchcore/src/tests/proton/documentdb/executor_threading_service/executor_threading_service_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/executor_threading_service_test.cpp
@@ -59,6 +59,3 @@ TEST_F(ExecutorThreadingServiceTest, tasks_limits_can_be_updated)
EXPECT_EQ(11, service->summary().getTaskLimit());
EXPECT_EQ(7, field_writer()->first_executor()->getTaskLimit());
}
-
-GTEST_MAIN_RUN_ALL_TESTS()
-
diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
index cdd275e898d..383f891d5d2 100644
--- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
@@ -38,11 +38,12 @@
#include <vespa/searchlib/test/doc_builder.h>
#include <vespa/searchlib/transactionlog/translogserver.h>
#include <vespa/vespalib/net/socket_spec.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/util/size_literals.h>
#include <filesystem>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
#include <vespa/log/log.h>
LOG_SETUP("feedhandler_test");
diff --git a/searchcore/src/tests/proton/documentdb/gtest_runner.cpp b/searchcore/src/tests/proton/documentdb/gtest_runner.cpp
new file mode 100644
index 00000000000..882e3a202b1
--- /dev/null
+++ b/searchcore/src/tests/proton/documentdb/gtest_runner.cpp
@@ -0,0 +1,8 @@
+// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include <vespa/vespalib/gtest/gtest.h>
+
+#include <vespa/log/log.h>
+LOG_SETUP("searchcore_proton_documentdb_gtest_runner");
+
+GTEST_MAIN_RUN_ALL_TESTS()
diff --git a/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/.gitignore b/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/.gitignore
deleted file mode 100644
index 1e657f33c1a..00000000000
--- a/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-searchcore_job_tracked_maintenance_job_test_app
diff --git a/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/CMakeLists.txt
deleted file mode 100644
index 17903d4dd2f..00000000000
--- a/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(searchcore_job_tracked_maintenance_job_test_app TEST
- SOURCES
- job_tracked_maintenance_job_test.cpp
- DEPENDS
- searchcore_server
- searchcore_proton_metrics
-)
-vespa_add_test(NAME searchcore_job_tracked_maintenance_job_test_app COMMAND searchcore_job_tracked_maintenance_job_test_app)
diff --git a/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/job_tracked_maintenance_job_test.cpp b/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job_test.cpp
index e1ec3d2bb29..f81a3b724dd 100644
--- a/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/job_tracked_maintenance_job_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job_test.cpp
@@ -9,9 +9,6 @@
#include <vespa/vespalib/util/gate.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
-#include <vespa/log/log.h>
-LOG_SETUP("job_tracked_maintenance_test");
-
using namespace proton;
using namespace vespalib;
using test::SimpleJobTracker;
@@ -146,5 +143,3 @@ TEST_F("require that stop calls are sent to underlying jobs", Fixture)
f._trackedJob->stop();
EXPECT_TRUE(f._myJob->stopped());
}
-
-TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp b/searchcore/src/tests/proton/documentdb/lid_space_common.cpp
index 44e663a559b..44e663a559b 100644
--- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp
+++ b/searchcore/src/tests/proton/documentdb/lid_space_common.cpp
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h b/searchcore/src/tests/proton/documentdb/lid_space_common.h
index 9e7635d3c3a..9e7635d3c3a 100644
--- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h
+++ b/searchcore/src/tests/proton/documentdb/lid_space_common.h
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/.gitignore b/searchcore/src/tests/proton/documentdb/lid_space_compaction/.gitignore
deleted file mode 100644
index c031fe6605d..00000000000
--- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-searchcore_lid_space_compaction_test_app
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/CMakeLists.txt b/searchcore/src/tests/proton/documentdb/lid_space_compaction/CMakeLists.txt
deleted file mode 100644
index 3725a762c60..00000000000
--- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/CMakeLists.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-vespa_add_library(searchcore_lidspace_test STATIC
- SOURCES
- lid_space_common.cpp
-)
-
-vespa_add_executable(searchcore_lid_space_compaction_test_app TEST
- SOURCES
- lid_space_jobtest.cpp
- lid_space_compaction_test.cpp
- DEPENDS
- searchcore_lidspace_test
- searchcore_test
- searchcore_server
- searchcore_initializer
- searchcore_feedoperation
- searchcore_documentmetastore
- searchcore_bucketdb
- searchcore_pcommon
- GTest::GTest
-)
-vespa_add_test(NAME searchcore_lid_space_compaction_test_app COMMAND searchcore_lid_space_compaction_test_app)
-
-vespa_add_executable(searchcore_lid_space_handler_test_app TEST
- SOURCES
- lid_space_handler_test.cpp
- DEPENDS
- searchcore_lidspace_test
- searchcore_test
- searchcore_server
- searchcore_initializer
- searchcore_feedoperation
- searchcore_documentmetastore
- searchcore_bucketdb
- searchcore_pcommon
- GTest::GTest
-)
-vespa_add_test(NAME searchcore_lid_space_handler_test_app COMMAND searchcore_lid_space_handler_test_app)
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_compaction_test.cpp b/searchcore/src/tests/proton/documentdb/lid_space_compaction_test.cpp
index 984af9870a6..681caad38a4 100644
--- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_compaction_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction_test.cpp
@@ -271,5 +271,3 @@ TEST_F(MaxOutstandingJobTest, job_is_blocked_if_it_has_too_many_outstanding_move
assertJobContext(4, 7, 3, 7, 1);
sync();
}
-
-GTEST_MAIN_RUN_ALL_TESTS()
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp b/searchcore/src/tests/proton/documentdb/lid_space_handler_test.cpp
index c5a1bc370c1..ca88510dc4d 100644
--- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/lid_space_handler_test.cpp
@@ -4,6 +4,7 @@
#include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h>
#include <vespa/vespalib/gtest/gtest.h>
+namespace {
struct HandlerTest : public ::testing::Test {
DocBuilder _docBuilder;
std::shared_ptr<bucketdb::BucketDBOwner> _bucketDB;
@@ -26,6 +27,8 @@ HandlerTest::HandlerTest()
HandlerTest::~HandlerTest() = default;
+}
+
TEST_F(HandlerTest, handler_uses_doctype_and_subdb_name)
{
EXPECT_EQ("test.dummysubdb", _handler.getName());
@@ -58,4 +61,3 @@ TEST_F(HandlerTest, createMoveOperation_works_as_expected)
EXPECT_EQ(timestamp, op->getTimestamp());
}
-GTEST_MAIN_RUN_ALL_TESTS()
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp b/searchcore/src/tests/proton/documentdb/lid_space_jobtest.cpp
index eea523870c3..eea523870c3 100644
--- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp
+++ b/searchcore/src/tests/proton/documentdb/lid_space_jobtest.cpp
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h b/searchcore/src/tests/proton/documentdb/lid_space_jobtest.h
index 100458bb867..100458bb867 100644
--- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h
+++ b/searchcore/src/tests/proton/documentdb/lid_space_jobtest.h
diff --git a/searchcore/src/tests/proton/documentdb/vespa_testrunner.cpp b/searchcore/src/tests/proton/documentdb/vespatest_runner.cpp
index 1e4e79047c3..1e4e79047c3 100644
--- a/searchcore/src/tests/proton/documentdb/vespa_testrunner.cpp
+++ b/searchcore/src/tests/proton/documentdb/vespatest_runner.cpp
diff --git a/searchcore/src/tests/proton/flushengine/flushengine_test.cpp b/searchcore/src/tests/proton/flushengine/flushengine_test.cpp
index dc9dcd3e0b0..d43d1184e2c 100644
--- a/searchcore/src/tests/proton/flushengine/flushengine_test.cpp
+++ b/searchcore/src/tests/proton/flushengine/flushengine_test.cpp
@@ -13,9 +13,10 @@
#include <vespa/searchlib/common/flush_token.h>
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/test/insertion_operators.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <mutex>
#include <thread>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
#include <vespa/log/log.h>
LOG_SETUP("flushengine_test");
diff --git a/searchcore/src/tests/proton/flushengine/prepare_restart_flush_strategy/prepare_restart_flush_strategy_test.cpp b/searchcore/src/tests/proton/flushengine/prepare_restart_flush_strategy/prepare_restart_flush_strategy_test.cpp
index 7abac088011..fd80a05860b 100644
--- a/searchcore/src/tests/proton/flushengine/prepare_restart_flush_strategy/prepare_restart_flush_strategy_test.cpp
+++ b/searchcore/src/tests/proton/flushengine/prepare_restart_flush_strategy/prepare_restart_flush_strategy_test.cpp
@@ -189,7 +189,7 @@ TEST_F("require that tls replay cost is correct for zero operations to replay",
TEST_F("require that flush cost is correct for zero flush targets", CandidatesFixture)
{
- EXPECT_EQUAL(0, f.builder.build().getFlushTargetsWriteCost());
+ EXPECT_EQUAL(0.0, f.builder.build().getFlushTargetsWriteCost());
}
TEST_F("require that flush cost is sum of flush targets", CandidatesFixture)
diff --git a/searchcore/src/tests/proton/index/index_writer/.gitignore b/searchcore/src/tests/proton/index/index_writer/.gitignore
deleted file mode 100644
index bbada541cf0..00000000000
--- a/searchcore/src/tests/proton/index/index_writer/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-searchcore_index_writer_test_app
diff --git a/searchcore/src/tests/proton/index/index_writer/CMakeLists.txt b/searchcore/src/tests/proton/index/index_writer/CMakeLists.txt
deleted file mode 100644
index d9fb7ab6018..00000000000
--- a/searchcore/src/tests/proton/index/index_writer/CMakeLists.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(searchcore_index_writer_test_app TEST
- SOURCES
- index_writer_test.cpp
- DEPENDS
- searchcore_test
- searchcore_index
- searchcore_pcommon
-)
-vespa_add_test(NAME searchcore_index_writer_test_app COMMAND searchcore_index_writer_test_app)
diff --git a/searchcore/src/tests/proton/matching/constant_value_repo/constant_value_repo_test.cpp b/searchcore/src/tests/proton/matching/constant_value_repo/constant_value_repo_test.cpp
index 312c5b6eaa1..1db8a2d93b3 100644
--- a/searchcore/src/tests/proton/matching/constant_value_repo/constant_value_repo_test.cpp
+++ b/searchcore/src/tests/proton/matching/constant_value_repo/constant_value_repo_test.cpp
@@ -63,7 +63,7 @@ struct Fixture {
TEST_F("require that constant value can be retrieved from repo", Fixture)
{
- EXPECT_EQUAL(3, f.repo.getConstant("foo")->value().as_double());
+ EXPECT_EQUAL(3.0, f.repo.getConstant("foo")->value().as_double());
}
TEST_F("require that non-existing constant value in repo returns nullptr", Fixture)
diff --git a/searchcore/src/tests/proton/matching/index_environment/index_environment_test.cpp b/searchcore/src/tests/proton/matching/index_environment/index_environment_test.cpp
index b17453c4b6d..1c7e7083ee7 100644
--- a/searchcore/src/tests/proton/matching/index_environment/index_environment_test.cpp
+++ b/searchcore/src/tests/proton/matching/index_environment/index_environment_test.cpp
@@ -1,10 +1,10 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/test_kit.h>
-
#include <vespa/eval/eval/value_cache/constant_value.h>
#include <vespa/searchcore/proton/matching/indexenvironment.h>
#include <vespa/searchlib/fef/onnx_models.h>
#include <vespa/searchlib/fef/ranking_expressions.h>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
using namespace proton::matching;
using search::fef::FieldInfo;
diff --git a/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp b/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp
index 6f398469fd3..9ad495a7955 100644
--- a/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp
+++ b/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp
@@ -1,5 +1,4 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchcore/proton/matching/match_phase_limiter.h>
#include <vespa/searchcore/proton/matching/rangequerylocator.h>
#include <vespa/searchlib/queryeval/termasstring.h>
@@ -17,6 +16,8 @@
#include <vespa/searchlib/engine/trace.h>
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
using namespace proton::matching;
using namespace search::engine;
diff --git a/searchcore/src/tests/proton/matching/query_test.cpp b/searchcore/src/tests/proton/matching/query_test.cpp
index 763f5dafb55..5f3db842d72 100644
--- a/searchcore/src/tests/proton/matching/query_test.cpp
+++ b/searchcore/src/tests/proton/matching/query_test.cpp
@@ -30,8 +30,9 @@
#include <vespa/document/datatype/positiondatatype.h>
#include <vespa/vespalib/stllike/asciistream.h>
#include <vespa/vespalib/util/thread_bundle.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/query/tree/querytreecreator.h>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
#include <vespa/log/log.h>
LOG_SETUP("query_test");
diff --git a/searchcore/src/tests/proton/matching/sessionmanager_test.cpp b/searchcore/src/tests/proton/matching/sessionmanager_test.cpp
index 3153bcccb42..483034a112d 100644
--- a/searchcore/src/tests/proton/matching/sessionmanager_test.cpp
+++ b/searchcore/src/tests/proton/matching/sessionmanager_test.cpp
@@ -8,8 +8,10 @@
#include <vespa/searchcore/proton/matching/match_tools.h>
#include <vespa/vespalib/stllike/string.h>
#include <vespa/vespalib/test/insertion_operators.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/data/slime/slime.h>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
+
#include <vespa/log/log.h>
LOG_SETUP("sessionmanager_test");
diff --git a/searchcore/src/tests/proton/metrics/metrics_engine/.gitignore b/searchcore/src/tests/proton/metrics/metrics_engine/.gitignore
deleted file mode 100644
index 98ae77cb458..00000000000
--- a/searchcore/src/tests/proton/metrics/metrics_engine/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-searchcore_metrics_engine_test_app
diff --git a/searchcore/src/tests/proton/metrics/metrics_engine/CMakeLists.txt b/searchcore/src/tests/proton/metrics/metrics_engine/CMakeLists.txt
deleted file mode 100644
index 6cc8e133ece..00000000000
--- a/searchcore/src/tests/proton/metrics/metrics_engine/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(searchcore_metrics_engine_test_app TEST
- SOURCES
- metrics_engine_test.cpp
- DEPENDS
- searchcore_flushengine
- searchcore_proton_metrics
-)
-vespa_add_test(NAME searchcore_metrics_engine_test_app COMMAND searchcore_metrics_engine_test_app)
diff --git a/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp b/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp
index 0f1e2e9487a..ea8fbcb57dc 100644
--- a/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp
+++ b/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp
@@ -17,8 +17,9 @@
#include <vespa/searchcore/proton/test/disk_mem_usage_notifier.h>
#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/vdslib/state/clusterstate.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <set>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
using document::BucketId;
using document::BucketSpace;
diff --git a/searchcore/src/tests/proton/proton_config_fetcher/.cvsignore b/searchcore/src/tests/proton/proton_config_fetcher/.cvsignore
deleted file mode 100644
index 13fb04d2a35..00000000000
--- a/searchcore/src/tests/proton/proton_config_fetcher/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.depend
-Makefile
-config_test
diff --git a/searchcore/src/tests/proton/proton_config_fetcher/.gitignore b/searchcore/src/tests/proton/proton_config_fetcher/.gitignore
deleted file mode 100644
index 72c49479fc1..00000000000
--- a/searchcore/src/tests/proton/proton_config_fetcher/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-searchcore_config_test_app
diff --git a/searchcore/src/tests/proton/proton_config_fetcher/CMakeLists.txt b/searchcore/src/tests/proton/proton_config_fetcher/CMakeLists.txt
deleted file mode 100644
index a91c7914bce..00000000000
--- a/searchcore/src/tests/proton/proton_config_fetcher/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(searchcore_proton_config_fetcher_test_app TEST
- SOURCES
- proton_config_fetcher_test.cpp
- DEPENDS
- searchcore_test
- searchcore_server
-)
-vespa_add_test(NAME searchcore_proton_config_fetcher_test_app COMMAND searchcore_proton_config_fetcher_test_app)
diff --git a/searchcore/src/tests/proton/proton_disk_layout/CMakeLists.txt b/searchcore/src/tests/proton/proton_disk_layout/CMakeLists.txt
deleted file mode 100644
index 5f1314f0e18..00000000000
--- a/searchcore/src/tests/proton/proton_disk_layout/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(searchcore_proton_disk_layout_test_app TEST
- SOURCES
- proton_disk_layout_test.cpp
- DEPENDS
- searchcore_test
- searchcore_server
-)
-vespa_add_test(NAME searchcore_proton_disk_layout_test_app COMMAND searchcore_proton_disk_layout_test_app)
diff --git a/searchcore/src/tests/proton/reference/gid_to_lid_mapper/gid_to_lid_mapper_test.cpp b/searchcore/src/tests/proton/reference/gid_to_lid_mapper/gid_to_lid_mapper_test.cpp
index 70211909296..bbe4b10851e 100644
--- a/searchcore/src/tests/proton/reference/gid_to_lid_mapper/gid_to_lid_mapper_test.cpp
+++ b/searchcore/src/tests/proton/reference/gid_to_lid_mapper/gid_to_lid_mapper_test.cpp
@@ -1,5 +1,4 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h>
#include <vespa/searchcore/proton/documentmetastore/documentmetastore.h>
#include <vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h>
@@ -9,6 +8,9 @@
#include <vespa/document/bucket/bucketid.h>
#include <vespa/searchcore/proton/reference/gid_to_lid_mapper.h>
#include <vespa/searchcore/proton/reference/gid_to_lid_mapper_factory.h>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
+
#include <vespa/log/log.h>
LOG_SETUP("gid_to_lid_mapper_test");
diff --git a/searchcore/src/tests/proton/server/.gitignore b/searchcore/src/tests/proton/server/.gitignore
index dc96b15f5fe..c96dc3b275f 100644
--- a/searchcore/src/tests/proton/server/.gitignore
+++ b/searchcore/src/tests/proton/server/.gitignore
@@ -2,8 +2,3 @@
.depend
Makefile
test_data
-searchcore_attribute_metrics_test_app
-searchcore_documentretriever_test_app
-searchcore_feeddebugger_test_app
-searchcore_feedstates_test_app
-searchcore_memoryconfigstore_test_app
diff --git a/searchcore/src/tests/proton/server/CMakeLists.txt b/searchcore/src/tests/proton/server/CMakeLists.txt
index abad9718818..b9fb096bf3a 100644
--- a/searchcore/src/tests/proton/server/CMakeLists.txt
+++ b/searchcore/src/tests/proton/server/CMakeLists.txt
@@ -1,54 +1,18 @@
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(searchcore_documentretriever_test_app TEST
+vespa_add_executable(searchcore_proton_server_vespa_test_app TEST
SOURCES
+ vespa_testrunner.cpp
documentretriever_test.cpp
- DEPENDS
- searchcore_server
- searchcore_attribute
- searchcore_feedoperation
- searchcore_documentmetastore
- searchcore_bucketdb
- searchcore_pcommon
- searchcore_persistenceengine
-)
-vespa_add_test(NAME searchcore_documentretriever_test_app COMMAND searchcore_documentretriever_test_app)
-vespa_add_executable(searchcore_feeddebugger_test_app TEST
- SOURCES
feeddebugger_test.cpp
- DEPENDS
- searchcore_server
- searchcore_pcommon
-)
-vespa_add_test(NAME searchcore_feeddebugger_test_app COMMAND searchcore_feeddebugger_test_app)
-vespa_add_executable(searchcore_feedstates_test_app TEST
- SOURCES
feedstates_test.cpp
- DEPENDS
- searchcore_test
- searchcore_server
- searchcore_bucketdb
- searchcore_persistenceengine
- searchcore_feedoperation
- searchcore_pcommon
- searchcore_proton_metrics
-)
-vespa_add_test(NAME searchcore_feedstates_test_app COMMAND searchcore_feedstates_test_app)
-vespa_add_executable(searchcore_memoryconfigstore_test_app TEST
- SOURCES
+ health_adapter_test.cpp
+ memory_flush_config_updater_test.cpp
memoryconfigstore_test.cpp
- DEPENDS
- searchcore_test
- searchcore_server
- searchcore_pcommon
-)
-vespa_add_test(NAME searchcore_memoryconfigstore_test_app COMMAND searchcore_memoryconfigstore_test_app)
-
-vespa_add_executable(searchcore_proton_server_vespa_test_app TEST
- SOURCES
- vespa_testrunner.cpp
move_operation_limiter_test.cpp
threading_service_config_test.cpp
DEPENDS
searchcore_server
+ searchcore_feedoperation
+ searchcore_test
)
vespa_add_test(NAME searchcore_proton_server_vespa_test_app COMMAND searchcore_proton_server_vespa_test_app)
diff --git a/searchcore/src/tests/proton/server/documentretriever_test.cpp b/searchcore/src/tests/proton/server/documentretriever_test.cpp
index b05964fe7e0..426c709cf52 100644
--- a/searchcore/src/tests/proton/server/documentretriever_test.cpp
+++ b/searchcore/src/tests/proton/server/documentretriever_test.cpp
@@ -40,7 +40,6 @@
#include <vespa/document/test/fieldvalue_helpers.h>
#include <vespa/vespalib/geo/zcurve.h>
#include <vespa/vespalib/test/insertion_operators.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/eval/eval/simple_value.h>
#include <vespa/eval/eval/tensor_spec.h>
@@ -48,11 +47,10 @@
#include <vespa/eval/eval/test/value_compare.h>
#include <vespa/persistence/spi/bucket.h>
#include <vespa/persistence/spi/test.h>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
-#include <vespa/log/log.h>
-LOG_SETUP("document_retriever_test");
-
using document::ArrayFieldValue;
using document::FieldValue;
using document::BucketId;
@@ -669,5 +667,3 @@ TEST("require that fieldset can figure out their attributeness and rember it") {
}
} // namespace
-
-TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/tests/proton/server/feeddebugger_test.cpp b/searchcore/src/tests/proton/server/feeddebugger_test.cpp
index 4d1bbdb2f03..1058979305e 100644
--- a/searchcore/src/tests/proton/server/feeddebugger_test.cpp
+++ b/searchcore/src/tests/proton/server/feeddebugger_test.cpp
@@ -1,12 +1,10 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Unit tests for feeddebugger.
-#include <vespa/log/log.h>
-LOG_SETUP("feeddebugger_test");
-
#include <vespa/document/base/documentid.h>
#include <vespa/searchcore/proton/common/feeddebugger.h>
#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
using document::DocumentId;
using std::string;
@@ -46,8 +44,7 @@ TEST("require that when environment variable is not set, debugging is off") {
EXPECT_FALSE(debugger.isDebugging());
}
-TEST("require that setting an environment variable turns on lid-specific"
- " debugging.") {
+TEST("require that setting an environment variable turns on lid-specific debugging.") {
EnvSaver save_lid_env(lid_env_name);
EnvSaver save_docid_env(docid_env_name);
setenv(lid_env_name, "1,3,5", true);
@@ -61,8 +58,7 @@ TEST("require that setting an environment variable turns on lid-specific"
EXPECT_EQUAL(ns_log::Logger::info, debugger.getDebugLevel(5, 0));
}
-TEST("require that setting an environment variable turns on docid-specific"
- " debugging.") {
+TEST("require that setting an environment variable turns on docid-specific debugging.") {
EnvSaver save_lid_env(lid_env_name);
EnvSaver save_docid_env(docid_env_name);
setenv(docid_env_name, "id:ns:type::test:foo,id:ns:type::test:bar,id:ns:type::test:baz", true);
@@ -80,5 +76,3 @@ TEST("require that setting an environment variable turns on docid-specific"
}
} // namespace
-
-TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/tests/proton/server/feedstates_test.cpp b/searchcore/src/tests/proton/server/feedstates_test.cpp
index c46510c5181..bd88a5b8038 100644
--- a/searchcore/src/tests/proton/server/feedstates_test.cpp
+++ b/searchcore/src/tests/proton/server/feedstates_test.cpp
@@ -16,11 +16,9 @@
#include <vespa/searchlib/common/serialnum.h>
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/vespalib/util/foreground_thread_executor.h>
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/util/buffer.h>
-
-#include <vespa/log/log.h>
-LOG_SETUP("feedstates_test");
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
using document::BucketId;
using document::DocumentId;
@@ -154,5 +152,3 @@ TEST_F("require that replay progress is tracked", Fixture)
}
} // namespace
-
-TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/tests/proton/server/health_adapter/.gitignore b/searchcore/src/tests/proton/server/health_adapter/.gitignore
deleted file mode 100644
index c82499f49b7..00000000000
--- a/searchcore/src/tests/proton/server/health_adapter/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-searchcore_health_adapter_test_app
diff --git a/searchcore/src/tests/proton/server/health_adapter/CMakeLists.txt b/searchcore/src/tests/proton/server/health_adapter/CMakeLists.txt
deleted file mode 100644
index c65481e3751..00000000000
--- a/searchcore/src/tests/proton/server/health_adapter/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(searchcore_health_adapter_test_app TEST
- SOURCES
- health_adapter_test.cpp
- DEPENDS
- searchcore_server
- searchcore_pcommon
-)
-vespa_add_test(NAME searchcore_health_adapter_test_app COMMAND searchcore_health_adapter_test_app)
diff --git a/searchcore/src/tests/proton/server/health_adapter/health_adapter_test.cpp b/searchcore/src/tests/proton/server/health_adapter_test.cpp
index aa247140dc5..2e153516986 100644
--- a/searchcore/src/tests/proton/server/health_adapter/health_adapter_test.cpp
+++ b/searchcore/src/tests/proton/server/health_adapter_test.cpp
@@ -57,5 +57,3 @@ TEST_FF("require that multiple failure messages are concatenated", MyStatusProdu
EXPECT_FALSE(f2.getHealth().ok);
EXPECT_EQUAL(std::string("c1: xxx, c3: zzz"), f2.getHealth().msg);
}
-
-TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp b/searchcore/src/tests/proton/server/memory_flush_config_updater_test.cpp
index 0dc8390d7d9..4aac075caa6 100644
--- a/searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp
+++ b/searchcore/src/tests/proton/server/memory_flush_config_updater_test.cpp
@@ -236,5 +236,3 @@ TEST_F("require that more disk bloat is allowed while node state is retired or m
f.notifyDiskMemUsage(belowLimit(), belowLimit());
TEST_DO(f.assertStrategyDiskConfig(DEFAULT_DISK_BLOAT, DEFAULT_DISK_BLOAT));
}
-
-TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp b/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp
index c0245cc1a9d..ccb893b65a2 100644
--- a/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp
+++ b/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp
@@ -1,9 +1,6 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Unit tests for memoryconfigstore.
-#include <vespa/log/log.h>
-LOG_SETUP("memoryconfigstore_test");
-
#include <vespa/searchcommon/common/schema.h>
#include <vespa/searchcore/proton/server/memoryconfigstore.h>
#include <vespa/searchcore/proton/test/documentdb_config_builder.h>
@@ -106,5 +103,3 @@ TEST("require that MemoryConfigStores preserves state of "
}
} // namespace
-
-TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/tests/proton/summaryengine/summaryengine_test.cpp b/searchcore/src/tests/proton/summaryengine/summaryengine_test.cpp
index 2ab81058e43..6d1d80b495d 100644
--- a/searchcore/src/tests/proton/summaryengine/summaryengine_test.cpp
+++ b/searchcore/src/tests/proton/summaryengine/summaryengine_test.cpp
@@ -1,5 +1,4 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/searchcore/proton/summaryengine/summaryengine.h>
#include <vespa/searchlib/engine/searchreply.h>
@@ -7,6 +6,8 @@
#include <vespa/vespalib/data/simple_buffer.h>
#include <vespa/vespalib/util/compressor.h>
#include <vespa/fnet/frt/rpcrequest.h>
+#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/testkit/test_master.hpp>
#include <vespa/log/log.h>
diff --git a/searchcore/src/vespa/searchcore/grouping/groupingmanager.h b/searchcore/src/vespa/searchcore/grouping/groupingmanager.h
index 05f0e1886aa..99281549a8f 100644
--- a/searchcore/src/vespa/searchcore/grouping/groupingmanager.h
+++ b/searchcore/src/vespa/searchcore/grouping/groupingmanager.h
@@ -22,7 +22,6 @@ class GroupingManager
{
private:
GroupingContext &_groupingContext;
- const document::DocumentType *_documentType;
public:
GroupingManager(const GroupingManager &) = delete;
GroupingManager &operator=(const GroupingManager &) = delete;
@@ -32,8 +31,7 @@ public:
* @param groupingContext Context to use for grouping
**/
GroupingManager(GroupingContext & groupingContext) noexcept
- : _groupingContext(groupingContext),
- _documentType(nullptr)
+ : _groupingContext(groupingContext)
{}
/**
diff --git a/searchcore/src/vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.cpp b/searchcore/src/vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.cpp
index a4f5fea1750..b9ed2cc10f2 100644
--- a/searchcore/src/vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.cpp
+++ b/searchcore/src/vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.cpp
@@ -1,6 +1,7 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "mock_gid_to_lid_change_handler.h"
+#include <vespa/vespalib/testkit/test_master.hpp>
namespace proton::test {
@@ -14,4 +15,27 @@ MockGidToLidChangeHandler::MockGidToLidChangeHandler() noexcept
MockGidToLidChangeHandler::~MockGidToLidChangeHandler() = default;
+void
+MockGidToLidChangeHandler::addListener(std::unique_ptr<IGidToLidChangeListener> listener) {
+ _adds.emplace_back(listener->getDocTypeName(), listener->getName());
+ _listeners.push_back(std::move(listener));
+}
+
+void
+MockGidToLidChangeHandler::removeListeners(const vespalib::string &docTypeName, const std::set<vespalib::string> &keepNames) {
+ _removes.emplace_back(docTypeName, keepNames);
+}
+
+void
+MockGidToLidChangeHandler::assertAdds(const std::vector<AddEntry> &expAdds) const
+{
+ EXPECT_EQUAL(expAdds, _adds);
+}
+
+void
+MockGidToLidChangeHandler::assertRemoves(const std::vector<RemoveEntry> &expRemoves) const
+{
+ EXPECT_EQUAL(expRemoves, _removes);
+}
+
}
diff --git a/searchcore/src/vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.h b/searchcore/src/vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.h
index 288f6ebfebd..1fd27e07f49 100644
--- a/searchcore/src/vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.h
+++ b/searchcore/src/vespa/searchcore/proton/test/mock_gid_to_lid_change_handler.h
@@ -4,9 +4,9 @@
#include <vespa/searchcore/proton/reference/i_gid_to_lid_change_handler.h>
#include <vespa/searchcore/proton/reference/i_gid_to_lid_change_listener.h>
#include <vespa/searchcore/proton/reference/i_pending_gid_to_lid_changes.h>
+#include <vespa/document/base/globalid.h>
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/test/insertion_operators.h>
-#include <vespa/document/base/globalid.h>
namespace proton::test {
@@ -28,28 +28,15 @@ public:
MockGidToLidChangeHandler() noexcept;
~MockGidToLidChangeHandler() override;
- void addListener(std::unique_ptr<IGidToLidChangeListener> listener) override {
- _adds.emplace_back(listener->getDocTypeName(), listener->getName());
- _listeners.push_back(std::move(listener));
- }
-
- void removeListeners(const vespalib::string &docTypeName, const std::set<vespalib::string> &keepNames) override {
- _removes.emplace_back(docTypeName, keepNames);
- }
+ void addListener(std::unique_ptr<IGidToLidChangeListener> listener) override;
+ void removeListeners(const vespalib::string &docTypeName, const std::set<vespalib::string> &keepNames) override;
void notifyPut(IDestructorCallbackSP, document::GlobalId, uint32_t, SerialNum) override { }
void notifyRemoves(IDestructorCallbackSP, const std::vector<document::GlobalId> &, SerialNum) override { }
std::unique_ptr<IPendingGidToLidChanges> grab_pending_changes() override { return {}; }
- void assertAdds(const std::vector<AddEntry> &expAdds)
- {
- EXPECT_EQUAL(expAdds, _adds);
- }
-
- void assertRemoves(const std::vector<RemoveEntry> &expRemoves)
- {
- EXPECT_EQUAL(expRemoves, _removes);
- }
+ void assertAdds(const std::vector<AddEntry> &expAdds) const;
+ void assertRemoves(const std::vector<RemoveEntry> &expRemoves) const;
const std::vector<std::unique_ptr<IGidToLidChangeListener>> &getListeners() const { return _listeners; }
};