MCPcopy Create free account
hub / github.com/antgroup/vsag / TestHGraphBuild

Function TestHGraphBuild

tests/test_hgraph.cpp:709–748  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

707 vsag::Options::Instance().set_block_size_limit(origin_size);
708}
709static void
710TestHGraphBuild(const fixtures::HGraphTestIndexPtr& test_index,
711 const fixtures::HGraphResourcePtr& resource) {
712 using namespace fixtures;
713 auto origin_size = vsag::Options::Instance().block_size_limit();
714 auto size = GENERATE(1024 * 1024 * 2);
715 auto search_param = fmt::format(fixtures::search_param_tmp, 200, false);
716
717 for (auto metric_type : resource->metric_types) {
718 for (auto dim : resource->dims) {
719 for (auto& [base_quantization_str, recall] : resource->test_cases) {
720 INFO(fmt::format("metric_type: {}, dim: {}, base_quantization_str: {}, recall: {}",
721 metric_type,
722 dim,
723 base_quantization_str,
724 recall));
725 if (HGraphTestIndex::IsRaBitQ(base_quantization_str) &&
726 dim < fixtures::RABITQ_MIN_RACALL_DIM) {
727 dim = fixtures::RABITQ_MIN_RACALL_DIM;
728 }
729
730 vsag::Options::Instance().set_block_size_limit(size);
731
732 HGraphTestIndex::HGraphBuildParam build_param(
733 metric_type, dim, base_quantization_str);
734 auto param = HGraphTestIndex::GenerateHGraphBuildParametersString(build_param);
735 auto index = TestIndex::TestFactory(test_index->name, param, true);
736
737 auto dataset = HGraphTestIndex::pool.GetDatasetAndCreate(
738 dim, resource->base_count, metric_type);
739
740 TestIndex::TestBuildIndex(index, dataset, true);
741 TestIndex::TestExportIDs(index, dataset);
742 HGraphTestIndex::TestGeneral(index, dataset, search_param, recall);
743
744 vsag::Options::Instance().set_block_size_limit(origin_size);
745 }
746 }
747 }
748}
749
750TEST_CASE("(PR) HGraph Build Test", "[ft][hgraph][pr]") {
751 auto test_index = std::make_shared<fixtures::HGraphTestIndex>();

Callers 1

test_hgraph.cppFile · 0.85

Calls 3

block_size_limitMethod · 0.80
set_block_size_limitMethod · 0.80
GetDatasetAndCreateMethod · 0.80

Tested by

no test coverage detected