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