Merge pull request #1234 from trheyi/main

Add Neo loading in test preparation
This commit is contained in:
Max 2025-10-25 16:43:48 +08:00 committed by GitHub
commit 4829a2b761
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,6 +16,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/yaoapp/yao/config"
"github.com/yaoapp/yao/kb"
"github.com/yaoapp/yao/neo"
"github.com/yaoapp/yao/openapi"
"github.com/yaoapp/yao/openapi/oauth"
"github.com/yaoapp/yao/openapi/oauth/types"
@ -153,8 +154,14 @@ func Prepare(t *testing.T) string {
// Step 1: Initialize base test environment with all Yao dependencies
test.Prepare(t, config.Conf)
// Load Neo
err := neo.Load(config.Conf)
if err != nil {
t.Fatalf("Failed to load Neo: %v", err)
}
// Step 1.5: Initialize Knowledge Base (must be done before OpenAPI load)
_, err := kb.Load(config.Conf)
_, err = kb.Load(config.Conf)
if err != nil {
// KB loading failure is not fatal for tests, just log it
t.Logf("Warning: Failed to load Knowledge Base: %v", err)