diff options
Diffstat (limited to 'searchcore/src/tests/proton')
6 files changed, 28 insertions, 1 deletions
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp index 6705527dfa9..dae50fcc860 100644 --- a/searchcore/src/tests/proton/docsummary/docsummary.cpp +++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp @@ -31,6 +31,7 @@ #include <vespa/searchlib/transactionlog/translogserver.h> #include <vespa/vespalib/data/slime/slime.h> #include <vespa/vespalib/encoding/base64.h> +#include <vespa/config-bucketspaces.h> #include <vespa/vespalib/testkit/testapp.h> #include <vespa/log/log.h> @@ -51,6 +52,7 @@ using search::index::DummyFileHeaderContext; using search::index::schema::CollectionType; using storage::spi::Timestamp; using vespa::config::search::core::ProtonConfig; +using vespa::config::content::core::BucketspacesConfig; using vespalib::tensor::Tensor; using vespalib::tensor::TensorCells; using vespalib::tensor::TensorDimensions; @@ -205,6 +207,7 @@ public: auto b = std::make_shared<BootstrapConfig>(1, _documenttypesConfig, _repo, std::make_shared<ProtonConfig>(), std::make_shared<FiledistributorrpcConfig>(), + std::make_shared<BucketspacesConfig>(), _tuneFileDocumentDB); _configMgr.forwardConfig(b); _configMgr.nextGeneration(0); diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp index 1b94ba36dad..e655ae0d739 100644 --- a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp +++ b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp @@ -30,6 +30,7 @@ #include <vespa/vespalib/io/fileutil.h> #include <vespa/vespalib/test/insertion_operators.h> #include <vespa/vespalib/testkit/test_kit.h> +#include <vespa/config-bucketspaces.h> #include <iostream> @@ -54,6 +55,7 @@ using searchcorespi::IFlushTarget; using searchcorespi::index::IThreadingService; using storage::spi::Timestamp; using vespa::config::search::core::ProtonConfig; +using vespa::config::content::core::BucketspacesConfig; using vespalib::mkdir; typedef StoreOnlyDocSubDB::Config StoreOnlyConfig; @@ -281,6 +283,7 @@ struct MyConfigSnapshot _builder.getDocumentTypeRepo(), std::make_shared<ProtonConfig>(), std::make_shared<FiledistributorrpcConfig>(), + std::make_shared<BucketspacesConfig>(), tuneFileDocumentDB); config::DirSpec spec(cfgDir); DocumentDBConfigHelper mgr(spec, "searchdocument"); diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp index 58372c59193..f93930d189b 100644 --- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp +++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp @@ -23,6 +23,7 @@ #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/transactionlog/translogserver.h> #include <vespa/vespalib/data/slime/slime.h> +#include <vespa/config-bucketspaces.h> #include <vespa/vespalib/testkit/test_kit.h> using namespace cloud::config::filedistribution; @@ -40,6 +41,7 @@ using search::transactionlog::TransLogServer; using searchcorespi::IFlushTarget; using searchcorespi::index::IndexFlushTarget; using vespa::config::search::core::ProtonConfig; +using vespa::config::content::core::BucketspacesConfig; using vespalib::Slime; namespace { @@ -96,6 +98,7 @@ Fixture::Fixture() b(new BootstrapConfig(1, documenttypesConfig, repo, std::make_shared<ProtonConfig>(), std::make_shared<FiledistributorrpcConfig>(), + std::make_shared<BucketspacesConfig>(), tuneFileDocumentDB)); mgr.forwardConfig(b); mgr.nextGeneration(0); diff --git a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp index 9bb9766024a..a781085769c 100644 --- a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp +++ b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp @@ -13,6 +13,7 @@ #include <vespa/searchcore/proton/test/documentdb_config_builder.h> #include <vespa/searchsummary/config/config-juniperrc.h> #include <vespa/vespalib/io/fileutil.h> +#include <vespa/config-bucketspaces.h> #include <vespa/vespalib/testkit/test_kit.h> using namespace cloud::config::filedistribution; @@ -23,6 +24,7 @@ using namespace search::index; using namespace search; using namespace vespa::config::search::core; using namespace vespa::config::search; +using vespa::config::content::core::BucketspacesConfig; using proton::matching::RankingConstants; typedef DocumentDBConfigHelper DBCM; @@ -44,6 +46,7 @@ makeBaseConfigSnapshot() DocumentTypeRepo::SP(new DocumentTypeRepo(*dtcfg)), std::make_shared<ProtonConfig>(), std::make_shared<FiledistributorrpcConfig>(), + std::make_shared<BucketspacesConfig>(), std::make_shared<TuneFileDocumentDB>())); dbcm.forwardConfig(b); dbcm.nextGeneration(0); diff --git a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp index b9059338f27..37e4dfc486d 100644 --- a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp +++ b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp @@ -18,6 +18,7 @@ #include <vespa/searchcore/config/config-ranking-constants.h> #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/varholder.h> +#include <vespa/config-bucketspaces.h> #include <mutex> using namespace config; @@ -26,6 +27,8 @@ using namespace vespa::config::search::core; using namespace vespa::config::search::summary; using namespace vespa::config::search; using namespace cloud::config::filedistribution; +using vespa::config::content::core::BucketspacesConfig; +using vespa::config::content::core::BucketspacesConfigBuilder; using config::ConfigUri; using document::DocumentTypeRepo; @@ -52,6 +55,7 @@ struct ConfigTestFixture { ProtonConfigBuilder protonBuilder; DocumenttypesConfigBuilder documenttypesBuilder; FiledistributorrpcConfigBuilder filedistBuilder; + BucketspacesConfigBuilder bucketspacesBuilder; map<std::string, DoctypeFixture::UP> dbConfig; ConfigSet set; IConfigContext::SP context; @@ -62,6 +66,7 @@ struct ConfigTestFixture { protonBuilder(), documenttypesBuilder(), filedistBuilder(), + bucketspacesBuilder(), dbConfig(), set(), context(new ConfigContext(set)), @@ -70,6 +75,7 @@ struct ConfigTestFixture { set.addBuilder(configId, &protonBuilder); set.addBuilder(configId, &documenttypesBuilder); set.addBuilder(configId, &filedistBuilder); + set.addBuilder(configId, &bucketspacesBuilder); addDocType("_alwaysthere_"); } @@ -146,6 +152,7 @@ struct ConfigTestFixture { DocumentTypeRepo::SP(new DocumentTypeRepo(documenttypesBuilder)), BootstrapConfig::ProtonConfigSP(new ProtonConfig(protonBuilder)), std::make_shared<FiledistributorrpcConfig>(), + std::make_shared<BucketspacesConfig>(bucketspacesBuilder), std::make_shared<TuneFileDocumentDB>())); } @@ -197,11 +204,13 @@ struct ProtonConfigOwner : public proton::IProtonConfigurer TEST_F("require that bootstrap config manager creats correct key set", BootstrapConfigManager("foo")) { const ConfigKeySet set(f1.createConfigKeySet()); - ASSERT_EQUAL(3u, set.size()); + ASSERT_EQUAL(4u, set.size()); ConfigKey protonKey(ConfigKey::create<ProtonConfig>("foo")); ConfigKey dtKey(ConfigKey::create<DocumenttypesConfig>("foo")); + ConfigKey bsKey(ConfigKey::create<BucketspacesConfig>("foo")); ASSERT_TRUE(set.find(protonKey) != set.end()); ASSERT_TRUE(set.find(dtKey) != set.end()); + ASSERT_TRUE(set.find(bsKey) != set.end()); } TEST_FFF("require that bootstrap config manager updates config", ConfigTestFixture("search"), diff --git a/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp b/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp index a99eaa0daf6..f2e1b9d7805 100644 --- a/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp +++ b/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp @@ -21,6 +21,7 @@ #include <vespa/searchcommon/common/schemaconfigurer.h> #include <vespa/vespalib/util/threadstackexecutor.h> #include <vespa/vespalib/test/insertion_operators.h> +#include <vespa/config-bucketspaces.h> using namespace config; using namespace proton; @@ -28,6 +29,8 @@ using namespace vespa::config::search::core; using namespace vespa::config::search::summary; using namespace vespa::config::search; using namespace cloud::config::filedistribution; +using vespa::config::content::core::BucketspacesConfig; +using vespa::config::content::core::BucketspacesConfigBuilder; using InitializeThreads = std::shared_ptr<vespalib::ThreadStackExecutorBase>; using config::ConfigUri; @@ -98,6 +101,7 @@ struct ConfigFixture { ProtonConfigBuilder _protonBuilder; DocumenttypesConfigBuilder _documenttypesBuilder; FiledistributorrpcConfigBuilder _filedistBuilder; + BucketspacesConfigBuilder _bucketspacesBuilder; map<std::string, DBConfigFixture::UP> _dbConfig; int _idcounter; int64_t _generation; @@ -108,6 +112,7 @@ struct ConfigFixture { _protonBuilder(), _documenttypesBuilder(), _filedistBuilder(), + _bucketspacesBuilder(), _dbConfig(), _idcounter(-1), _generation(1), @@ -166,6 +171,7 @@ struct ConfigFixture { DocumentTypeRepo::SP(new DocumentTypeRepo(_documenttypesBuilder)), BootstrapConfig::ProtonConfigSP(new ProtonConfig(_protonBuilder)), std::make_shared<FiledistributorrpcConfig>(), + std::make_shared<BucketspacesConfig>(_bucketspacesBuilder), std::make_shared<TuneFileDocumentDB>())); } |