Skip to content

Commit 0186df2

Browse files
author
Yehudit Kerido
committed
run embedding tests
Signed-off-by: Yehudit Kerido <[email protected]>
1 parent 86b6ae2 commit 0186df2

File tree

7 files changed

+1994
-0
lines changed

7 files changed

+1994
-0
lines changed
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
name: Integration Tests
2+
3+
# Run integration tests on:
4+
# - Nightly schedule (comprehensive validation)
5+
# - Manual trigger (for debugging/pre-merge validation)
6+
# - Push to main (after PR merge)
7+
# - Pull requests that modify relevant paths (embedding infrastructure)
8+
on:
9+
schedule:
10+
# Run nightly at 3:00 AM UTC (after main test-and-build at 2:00 AM)
11+
- cron: "0 3 * * *"
12+
13+
workflow_dispatch:
14+
inputs:
15+
test_suite:
16+
description: 'Integration test suite to run'
17+
required: false
18+
default: 'all'
19+
type: choice
20+
options:
21+
- all # All integration tests
22+
- embedding # Only embedding tests
23+
- cache # Only cache integration tests (future)
24+
25+
push:
26+
branches:
27+
- main
28+
# Only run if relevant files changed
29+
paths:
30+
- 'candle-binding/**'
31+
- 'src/semantic-router/test/integration/**'
32+
- 'src/semantic-router/pkg/classification/**'
33+
- '.github/workflows/integration-tests-embedding.yml'
34+
35+
pull_request:
36+
branches:
37+
- main
38+
# Only run if relevant files changed
39+
paths:
40+
- 'candle-binding/**'
41+
- 'src/semantic-router/test/integration/**'
42+
- 'src/semantic-router/pkg/classification/**'
43+
- '.github/workflows/integration-tests-embedding.yml'
44+
45+
jobs:
46+
integration-tests:
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- name: Check out the repo
51+
uses: actions/checkout@v4
52+
53+
- name: Set up Rust
54+
uses: dtolnay/rust-toolchain@stable
55+
with:
56+
toolchain: 1.90
57+
58+
- name: Set up Go
59+
uses: actions/setup-go@v5
60+
with:
61+
go-version: "1.24"
62+
63+
- name: Install system dependencies
64+
run: |
65+
sudo apt-get update
66+
sudo apt-get install -y \
67+
make \
68+
build-essential \
69+
pkg-config
70+
71+
- name: Cache Rust dependencies
72+
uses: actions/cache@v4
73+
with:
74+
path: |
75+
~/.cargo/bin/
76+
~/.cargo/registry/index/
77+
~/.cargo/registry/cache/
78+
~/.cargo/git/db/
79+
candle-binding/target/
80+
key: ${{ runner.os }}-cargo-integration-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
81+
restore-keys: |
82+
${{ runner.os }}-cargo-integration-
83+
${{ runner.os }}-cargo-
84+
85+
- name: Cache Go dependencies
86+
uses: actions/cache@v4
87+
with:
88+
path: |
89+
~/go/pkg/mod
90+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
91+
restore-keys: |
92+
${{ runner.os }}-go-
93+
94+
- name: Cache Integration Test Models
95+
uses: actions/cache@v4
96+
with:
97+
path: |
98+
models/Qwen3-Embedding-0.6B/
99+
models/embeddinggemma-300m/
100+
models/lora_*_model/
101+
key: ${{ runner.os }}-integration-models-${{ hashFiles('tools/make/models.mk') }}
102+
restore-keys: |
103+
${{ runner.os }}-integration-models-
104+
continue-on-error: true
105+
106+
- name: Build Rust library (CPU-only, no CUDA)
107+
run: make rust-ci
108+
109+
- name: Build Go router
110+
run: make build-router
111+
112+
- name: Install HuggingFace CLI
113+
run: |
114+
pip install -U "huggingface_hub[cli]" hf_transfer
115+
116+
- name: Download embedding models
117+
env:
118+
HF_HUB_ENABLE_HF_TRANSFER: 1
119+
HF_HUB_DISABLE_TELEMETRY: 1
120+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
121+
run: |
122+
echo "Downloading models for integration tests..."
123+
make download-models-lora
124+
125+
- name: Run embedding integration tests
126+
run: make test-embedding
127+
env:
128+
CI: true
129+
CGO_ENABLED: 1
130+
LD_LIBRARY_PATH: ${{ github.workspace }}/candle-binding/target/release
131+
timeout-minutes: 30
132+
133+
- name: Run embedding benchmarks (nightly only)
134+
if: github.event_name == 'schedule'
135+
run: make bench-embedding
136+
env:
137+
CI: true
138+
CGO_ENABLED: 1
139+
LD_LIBRARY_PATH: ${{ github.workspace }}/candle-binding/target/release
140+
timeout-minutes: 45
141+
142+
- name: Upload test results on failure
143+
if: failure()
144+
uses: actions/upload-artifact@v4
145+
with:
146+
name: integration-test-results
147+
path: |
148+
**/*.log
149+
**/test-output.*
150+
retention-days: 7
151+
152+
- name: Comment PR with results (if PR)
153+
if: github.event_name == 'pull_request' && always()
154+
uses: actions/github-script@v7
155+
with:
156+
script: |
157+
const status = '${{ job.status }}';
158+
const emoji = status === 'success' ? '✅' : '❌';
159+
const message = `${emoji} Integration Tests: **${status.toUpperCase()}**
160+
161+
- Embedding concurrency tests: ${status === 'success' ? 'PASSED' : 'FAILED'}
162+
- Embedding memory tests: ${status === 'success' ? 'PASSED' : 'FAILED'}
163+
- Embedding performance tests: ${status === 'success' ? 'PASSED' : 'FAILED'}
164+
165+
View details: [Workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})`;
166+
167+
github.rest.issues.createComment({
168+
issue_number: context.issue.number,
169+
owner: context.repo.owner,
170+
repo: context.repo.repo,
171+
body: message
172+
});
173+
174+
- name: Notify on failure
175+
if: failure() && github.event_name == 'schedule'
176+
run: |
177+
echo "::error::Integration tests failed on nightly run. Please investigate."

0 commit comments

Comments
 (0)