Skip to content

Commit 5675ef1

Browse files
authored
feat: add integration tests CI workflow (#49)
1 parent e78b187 commit 5675ef1

File tree

1 file changed

+133
-0
lines changed

1 file changed

+133
-0
lines changed
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: Integration Tests (Client-side)
2+
3+
run-name: Run TypeScript client tests from llama-stack (replay mode)
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
- generated
10+
- 'release-[0-9]+.[0-9]+.x'
11+
pull_request:
12+
branches:
13+
- main
14+
- generated
15+
- 'release-[0-9]+.[0-9]+.x'
16+
types: [opened, synchronize, reopened]
17+
paths:
18+
- 'src/**'
19+
- 'tests/integration/**'
20+
- 'package.json'
21+
- 'yarn.lock'
22+
- '.github/workflows/integration-tests.yml'
23+
workflow_dispatch:
24+
25+
concurrency:
26+
# Skip concurrency for pushes to main - each commit should be tested independently
27+
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}
28+
cancel-in-progress: true
29+
30+
jobs:
31+
run-replay-mode-tests:
32+
runs-on: ubuntu-latest
33+
name: ${{ format('Integration Tests ({0}, {1})', matrix.suite, matrix.setup) }}
34+
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
# TypeScript client test configurations
39+
# Must match entries in llama-stack/tests/integration/client-typescript/suites.json
40+
include:
41+
- suite: responses
42+
setup: gpt
43+
- suite: base
44+
setup: ollama
45+
46+
steps:
47+
- name: Checkout llama-stack-client-typescript repository
48+
uses: actions/checkout@v4
49+
with:
50+
path: llama-stack-client-typescript
51+
52+
- name: Checkout llama-stack repository
53+
uses: actions/checkout@v4
54+
with:
55+
repository: llamastack/llama-stack
56+
ref: main
57+
path: llama-stack
58+
59+
- name: Set up Node.js
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version: '20'
63+
64+
- name: Install uv
65+
uses: astral-sh/setup-uv@v6
66+
with:
67+
python-version: '3.12'
68+
version: '0.7.6'
69+
70+
- name: Build TypeScript client
71+
working-directory: llama-stack-client-typescript
72+
run: |
73+
echo "Building TypeScript client..."
74+
yarn install --frozen-lockfile
75+
yarn build
76+
77+
echo "✅ TypeScript client built successfully"
78+
79+
- name: Install llama-stack dependencies
80+
working-directory: llama-stack
81+
run: |
82+
echo "Installing llama-stack dependencies"
83+
uv sync --all-groups
84+
uv pip install faiss-cpu
85+
86+
- name: Build Llama Stack
87+
working-directory: llama-stack
88+
run: |
89+
echo "Building Llama Stack"
90+
LLAMA_STACK_DIR=. \
91+
uv run --no-sync llama stack list-deps ci-tests | xargs -L1 uv pip install
92+
93+
- name: Configure git for commits
94+
working-directory: llama-stack
95+
run: |
96+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
97+
git config --local user.name "github-actions[bot]"
98+
99+
- name: Check Storage and Memory Available Before Tests
100+
if: always()
101+
run: |
102+
free -h
103+
df -h
104+
105+
- name: Run Integration Tests (TypeScript only)
106+
working-directory: llama-stack
107+
env:
108+
OPENAI_API_KEY: dummy
109+
TS_CLIENT_PATH: ${{ github.workspace }}/llama-stack-client-typescript
110+
run: |
111+
STACK_CONFIG="server:ci-tests"
112+
113+
SCRIPT_ARGS="--stack-config $STACK_CONFIG --inference-mode replay --typescript-only"
114+
115+
# Add suite and setup arguments
116+
SCRIPT_ARGS="$SCRIPT_ARGS --setup ${{ matrix.setup }}"
117+
SCRIPT_ARGS="$SCRIPT_ARGS --suite ${{ matrix.suite }}"
118+
119+
echo "=== Running TypeScript client tests only ==="
120+
echo "Client path: $TS_CLIENT_PATH"
121+
echo "Command: uv run --no-sync ./scripts/integration-tests.sh $SCRIPT_ARGS"
122+
echo ""
123+
124+
uv run --no-sync ./scripts/integration-tests.sh $SCRIPT_ARGS | tee typescript-tests.log
125+
126+
- name: Upload logs
127+
if: always()
128+
uses: actions/upload-artifact@v4
129+
with:
130+
name: logs-${{ github.run_id }}-${{ github.run_attempt || '1' }}-${{ strategy.job-index || github.job }}-${{ github.action }}
131+
path: |
132+
llama-stack/*.log
133+
retention-days: 1

0 commit comments

Comments
 (0)