Skip to content

Commit 43a5949

Browse files
committed
toggle milvus unit test
Signed-off-by: Huamin Chen <[email protected]>
1 parent 6275c19 commit 43a5949

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ test-jailbreak-classifier: rust
165165
test-semantic-router: build-router
166166
@echo "Testing semantic-router..."
167167
@export LD_LIBRARY_PATH=${PWD}/candle-binding/target/release && \
168+
export SKIP_MILVUS_TESTS=$${SKIP_MILVUS_TESTS:-true} && \
168169
cd src/semantic-router && CGO_ENABLED=1 go test -v ./...
169170

170171
# Test the Rust library and the Go binding

src/semantic-router/pkg/cache/cache_test.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
package cache_test
23

34
import (
@@ -88,13 +89,18 @@ var _ = Describe("Cache Package", func() {
8889
})
8990
})
9091

91-
Context("with Milvus backend", func() {
92-
var milvusConfigPath string
92+
Context("with Milvus backend", func() {
93+
var milvusConfigPath string
9394

94-
BeforeEach(func() {
95-
// Create a test Milvus configuration file
96-
milvusConfigPath = filepath.Join(tempDir, "milvus.yaml")
97-
milvusConfig := `
95+
BeforeEach(func() {
96+
// Skip Milvus tests if environment variable is set
97+
if os.Getenv("SKIP_MILVUS_TESTS") == "true" {
98+
Skip("Milvus tests skipped due to SKIP_MILVUS_TESTS=true")
99+
}
100+
101+
// Create a test Milvus configuration file
102+
milvusConfigPath = filepath.Join(tempDir, "milvus.yaml")
103+
milvusConfig := `
98104
connection:
99105
host: "localhost"
100106
port: 19530

0 commit comments

Comments
 (0)