用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/zilliztech/knowhere --skill testing命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | testing |
| description | Use when running unit tests, debugging test failures, or adding new test cases using Catch2 framework |
# Run all tests
./Release/tests/ut/knowhere_tests
./Debug/tests/ut/knowhere_tests
# Run specific test by name pattern
./Release/tests/ut/knowhere_tests "[float metrics]"
./Release/tests/ut/knowhere_tests "Test Mem Index*"
# List all test names
./Release/tests/ut/knowhere_tests --list-tests
| Command | Description |
|---|---|
[tag] | Run tests with specific tag |
"Test Name*" | Run tests matching pattern |
--list-tests | List all available tests |
--list-tags | List all available tags |
-s | Show successful test output |
-d yes | Show test durations |
Tests are located in tests/ut/. Key test files:
| File | Tests |
|---|---|
test_index.cc | Index build/search operations |
test_float_metrics.cc | Float vector metrics (L2, IP, COSINE) |
test_binary_metrics.cc | Binary vector metrics (Hamming, Jaccard) |
test_sparse.cc | Sparse vector index |
#include "catch2/catch_test_macros.hpp"
#include "knowhere/index/index_factory.h"
TEST_CASE("Test Description", "[tag1][tag2]") {
// Setup
auto index = knowhere::IndexFactory::Instance().Create(...);
// Test
REQUIRE(index.has_value());
// Sections for sub-tests
SECTION("sub-test 1") {
// ...
}
}
If adding tests for new features, consider updating documentation. See
documentingskill.