2121 - ' yarn.lock'
2222 - ' .github/workflows/integration-tests.yml'
2323 workflow_dispatch :
24- inputs :
25- test-setup :
26- description : ' Test against a specific setup'
27- type : string
28- default : ' ollama'
2924
3025concurrency :
3126 # Skip concurrency for pushes to main - each commit should be tested independently
3227 group : ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}
3328 cancel-in-progress : true
3429
3530jobs :
36- generate-matrix :
37- runs-on : ubuntu-latest
38- outputs :
39- matrix : ${{ steps.set-matrix.outputs.matrix }}
40- steps :
41- - name : Checkout llama-stack repository
42- uses : actions/checkout@v4
43- with :
44- repository : llamastack/llama-stack
45- ref : main
46-
47- - name : Generate test matrix
48- id : set-matrix
49- run : |
50- # Generate matrix from CI_MATRIX in llama-stack tests/integration/ci_matrix.json
51- MATRIX=$(PYTHONPATH=. python3 scripts/generate_ci_matrix.py \
52- --test-setup "${{ github.event.inputs.test-setup }}")
53- echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
54- echo "Generated matrix: $MATRIX"
55-
5631 run-replay-mode-tests :
57- needs : generate-matrix
5832 runs-on : ubuntu-latest
59- name : ${{ format('Integration Tests (server, {0}, {1})', matrix.config.setup , matrix.config.suite ) }}
33+ name : ${{ format('Integration Tests ({0}, {1})', matrix.suite , matrix.setup ) }}
6034
6135 strategy :
6236 fail-fast : false
6337 matrix :
64- # Only test server mode - TypeScript client doesn't support library/docker modes
65- client : [server]
66- # Test configurations: Generated from CI_MATRIX in llama-stack tests/integration/ci_matrix.json
67- config : ${{ fromJSON(needs.generate-matrix.outputs.matrix).include }}
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
6845
6946 steps :
7047 - name : Checkout llama-stack-client-typescript repository
@@ -79,62 +56,18 @@ jobs:
7956 ref : main
8057 path : llama-stack
8158
82- - name : Check if TypeScript tests exist for this config
83- id : check-ts-tests
84- working-directory : llama-stack
85- run : |
86- # Check if this config allows server client (TypeScript only works with server mode)
87- ALLOWED_CLIENTS='${{ toJSON(matrix.config.allowed_clients) }}'
88- if [[ "$ALLOWED_CLIENTS" != "null" ]] && ! echo "$ALLOWED_CLIENTS" | grep -q "server"; then
89- echo "has_tests=false" >> $GITHUB_OUTPUT
90- echo "⚠️ Config doesn't allow server client, skipping TypeScript tests"
91- exit 0
92- fi
93-
94- # Check if this suite/setup combination has TypeScript tests
95- SUITE="${{ matrix.config.suite }}"
96- SETUP="${{ matrix.config.setup }}"
97-
98- if [[ ! -f "tests/integration/client-typescript/suites.json" ]]; then
99- echo "has_tests=false" >> $GITHUB_OUTPUT
100- echo "No TypeScript test mapping found"
101- exit 0
102- fi
103-
104- # Check if suite/setup is mapped in suites.json
105- HAS_TESTS=$(python3 -c "
106- import json
107- with open('tests/integration/client-typescript/suites.json') as f:
108- suites = json.load(f)
109- for entry in suites:
110- if entry.get('suite') == '$SUITE' and entry.get('setup') == '$SETUP':
111- print('true')
112- exit(0)
113- print('false')
114- ")
115-
116- echo "has_tests=$HAS_TESTS" >> $GITHUB_OUTPUT
117- if [[ "$HAS_TESTS" == "true" ]]; then
118- echo "✅ TypeScript tests found for suite=$SUITE setup=$SETUP"
119- else
120- echo "⚠️ No TypeScript tests mapped for suite=$SUITE setup=$SETUP"
121- fi
122-
12359 - name : Set up Node.js
124- if : steps.check-ts-tests.outputs.has_tests == 'true'
12560 uses : actions/setup-node@v4
12661 with :
12762 node-version : ' 20'
12863
12964 - name : Install uv
130- if : steps.check-ts-tests.outputs.has_tests == 'true'
13165 uses : astral-sh/setup-uv@v6
13266 with :
13367 python-version : ' 3.12'
13468 version : ' 0.7.6'
13569
13670 - name : Build TypeScript client
137- if : steps.check-ts-tests.outputs.has_tests == 'true'
13871 working-directory : llama-stack-client-typescript
13972 run : |
14073 echo "Building TypeScript client..."
@@ -144,52 +77,44 @@ jobs:
14477 echo "✅ TypeScript client built successfully"
14578
14679 - name : Install llama-stack dependencies
147- if : steps.check-ts-tests.outputs.has_tests == 'true'
14880 working-directory : llama-stack
14981 run : |
15082 echo "Installing llama-stack dependencies"
15183 uv sync --all-groups
15284 uv pip install faiss-cpu
15385
15486 - name : Build Llama Stack
155- if : steps.check-ts-tests.outputs.has_tests == 'true'
15687 working-directory : llama-stack
15788 run : |
15889 echo "Building Llama Stack"
15990 LLAMA_STACK_DIR=. \
16091 uv run --no-sync llama stack list-deps ci-tests | xargs -L1 uv pip install
16192
16293 - name : Configure git for commits
163- if : steps.check-ts-tests.outputs.has_tests == 'true'
16494 working-directory : llama-stack
16595 run : |
16696 git config --local user.email "github-actions[bot]@users.noreply.github.com"
16797 git config --local user.name "github-actions[bot]"
16898
16999 - name : Check Storage and Memory Available Before Tests
170- if : steps.check-ts-tests.outputs.has_tests == 'true' && always()
100+ if : always()
171101 run : |
172102 free -h
173103 df -h
174104
175105 - name : Run Integration Tests (Replay Mode)
176- if : steps.check-ts-tests.outputs.has_tests == 'true'
177106 working-directory : llama-stack
178107 env :
179108 OPENAI_API_KEY : dummy
180109 TS_CLIENT_PATH : ${{ github.workspace }}/llama-stack-client-typescript
181110 run : |
182- STACK_CONFIG="${{ matrix.config.stack_config || ' server:ci-tests' }} "
111+ STACK_CONFIG="server:ci-tests"
183112
184113 SCRIPT_ARGS="--stack-config $STACK_CONFIG --inference-mode replay"
185114
186- # Add optional arguments
187- if [ -n '${{ matrix.config.setup }}' ]; then
188- SCRIPT_ARGS="$SCRIPT_ARGS --setup ${{ matrix.config.setup }}"
189- fi
190- if [ -n '${{ matrix.config.suite }}' ]; then
191- SCRIPT_ARGS="$SCRIPT_ARGS --suite ${{ matrix.config.suite }}"
192- fi
115+ # Add suite and setup arguments
116+ SCRIPT_ARGS="$SCRIPT_ARGS --setup ${{ matrix.setup }}"
117+ SCRIPT_ARGS="$SCRIPT_ARGS --suite ${{ matrix.suite }}"
193118
194119 echo "=== Running integration tests with TypeScript client ==="
195120 echo "Client path: $TS_CLIENT_PATH"
0 commit comments