MCPcopy Index your code
hub / github.com/53AI/53AIHub / RunTest

Function RunTest

api/service/vectorstore/test_basic.go:157–181  ·  view source on GitHub ↗

RunTest 运行测试

()

Source from the content-addressed store, hash-verified

155
156// RunTest 运行测试
157func RunTest() {
158 // 加载环境变量
159 if _, err := os.Stat(".envkm"); err == nil {
160 // 如果存在.envkm文件,则加载它
161 if err := godotenv.Load(".envkm"); err != nil {
162 logger.SysLogf("警告: 加载.envkm文件失败: %v", err)
163 }
164 }
165
166 // 设置测试环境变量(如果未设置)
167 if os.Getenv("VECTOR_DB_TYPE") == "" {
168 os.Setenv("VECTOR_DB_TYPE", "qdrant")
169 }
170 if os.Getenv("VECTOR_DB_URL") == "" {
171 os.Setenv("VECTOR_DB_URL", "http://localhost:6333")
172 }
173 if os.Getenv("VECTOR_DB_API_KEY") == "" {
174 os.Setenv("VECTOR_DB_API_KEY", "difyai123456")
175 }
176
177 if err := TestBasicFunctionality(); err != nil {
178 logger.SysLogf("测试失败: %v", err)
179 os.Exit(1)
180 }
181}
182
183// TestEmbeddingServiceIntegration 测试EmbeddingService集成
184func TestEmbeddingServiceIntegration() error {

Callers

nothing calls this directly

Calls 3

TestBasicFunctionalityFunction · 0.85
StatMethod · 0.80
LoadMethod · 0.65

Tested by

no test coverage detected