| 518 | } |
| 519 | |
| 520 | static void |
| 521 | TestHGraphBuildAndContinueAdd(const fixtures::HGraphTestIndexPtr& test_index, |
| 522 | const fixtures::HGraphResourcePtr& resource) { |
| 523 | using namespace fixtures; |
| 524 | auto origin_size = vsag::Options::Instance().block_size_limit(); |
| 525 | auto size = GENERATE(1024 * 1024 * 2); |
| 526 | auto search_param = fmt::format(fixtures::search_param_tmp, 200, false); |
| 527 | for (auto metric_type : resource->metric_types) { |
| 528 | for (auto dim : resource->dims) { |
| 529 | for (auto& [base_quantization_str, recall] : resource->test_cases) { |
| 530 | INFO(fmt::format("metric_type: {}, dim: {}, base_quantization_str: {}, recall: {}", |
| 531 | metric_type, |
| 532 | dim, |
| 533 | base_quantization_str, |
| 534 | recall)); |
| 535 | if (HGraphTestIndex::IsRaBitQ(base_quantization_str) && |
| 536 | dim < fixtures::RABITQ_MIN_RACALL_DIM) { |
| 537 | dim = fixtures::RABITQ_MIN_RACALL_DIM; |
| 538 | } |
| 539 | vsag::Options::Instance().set_block_size_limit(size); |
| 540 | HGraphTestIndex::HGraphBuildParam build_param( |
| 541 | metric_type, dim, base_quantization_str); |
| 542 | auto param = HGraphTestIndex::GenerateHGraphBuildParametersString(build_param); |
| 543 | auto index = TestIndex::TestFactory(test_index->name, param, true); |
| 544 | auto dataset = HGraphTestIndex::pool.GetDatasetAndCreate( |
| 545 | dim, resource->base_count, metric_type); |
| 546 | TestIndex::TestContinueAdd(index, dataset, true); |
| 547 | HGraphTestIndex::TestGeneral(index, dataset, search_param, recall); |
| 548 | TestIndex::TestIndexDetailData(index); |
| 549 | vsag::Options::Instance().set_block_size_limit(origin_size); |
| 550 | } |
| 551 | } |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | TEST_CASE("(PR) HGraph Build & ContinueAdd Test", "[ft][hgraph][pr]") { |
| 556 | auto test_index = std::make_shared<fixtures::HGraphTestIndex>(); |
no test coverage detected