@@ -142,4 +142,122 @@ jobs:
142142 pkill -f "python.*optillm" 2>/dev/null || true
143143 sleep 2
144144 echo "Server shutdown completed"
145- exit 0
145+ exit 0
146+
147+ conversation-logging-tests :
148+ runs-on : ubuntu-latest
149+ needs : unit-tests
150+ strategy :
151+ matrix :
152+ python-version : ['3.12']
153+
154+ steps :
155+ - uses : actions/checkout@v4
156+
157+ - name : Set up Python ${{ matrix.python-version }}
158+ uses : actions/setup-python@v4
159+ with :
160+ python-version : ${{ matrix.python-version }}
161+
162+ - name : Cache pip packages
163+ uses : actions/cache@v3
164+ with :
165+ path : ~/.cache/pip
166+ key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
167+ restore-keys : |
168+ ${{ runner.os }}-pip-
169+
170+ - name : Install dependencies
171+ run : |
172+ python -m pip install --upgrade pip
173+ pip install -r requirements.txt
174+ pip install -r tests/requirements.txt
175+ pip install -e .
176+
177+ - name : Start optillm server with conversation logging
178+ run : |
179+ echo "Starting optillm server with conversation logging..."
180+ mkdir -p /tmp/optillm_conversations
181+ OPTILLM_API_KEY=optillm python optillm.py \
182+ --model google/gemma-3-270m-it \
183+ --port 8000 \
184+ --log-conversations \
185+ --conversation-log-dir /tmp/optillm_conversations &
186+ echo $! > server.pid
187+
188+ # Wait for server to be ready
189+ echo "Waiting for server to start..."
190+ sleep 20
191+
192+ # Test server health
193+ curl -s http://localhost:8000/health || echo "Server health check failed"
194+ env :
195+ OPTILLM_API_KEY : optillm
196+ HF_TOKEN : ${{ secrets.HF_TOKEN }}
197+
198+ - name : Run conversation logging tests
199+ run : |
200+ echo "Running conversation logging approach tests..."
201+ OPTILLM_API_KEY=optillm python -m pytest tests/test_conversation_logging_approaches.py -v --tb=short
202+
203+ echo "Running conversation logging server tests..."
204+ OPTILLM_API_KEY=optillm python -m pytest tests/test_conversation_logging_server.py -v --tb=short
205+
206+ echo "All conversation logging tests completed successfully!"
207+ env :
208+ OPTILLM_API_KEY : optillm
209+ HF_TOKEN : ${{ secrets.HF_TOKEN }}
210+
211+ - name : Stop optillm server
212+ if : always()
213+ run : |
214+ echo "Stopping optillm server..."
215+ if [ -f server.pid ]; then
216+ kill $(cat server.pid) 2>/dev/null || true
217+ rm -f server.pid
218+ fi
219+ pkill -f "python.*optillm" 2>/dev/null || true
220+ sleep 2
221+ echo "Server shutdown completed"
222+ exit 0
223+
224+ mcp-tests :
225+ runs-on : ubuntu-latest
226+ needs : unit-tests
227+ if : github.event_name == 'push' && github.ref == 'refs/heads/main' # Only run on main branch pushes (secrets available)
228+ strategy :
229+ matrix :
230+ python-version : ['3.12']
231+
232+ steps :
233+ - uses : actions/checkout@v4
234+
235+ - name : Set up Python ${{ matrix.python-version }}
236+ uses : actions/setup-python@v4
237+ with :
238+ python-version : ${{ matrix.python-version }}
239+
240+ - name : Cache pip packages
241+ uses : actions/cache@v3
242+ with :
243+ path : ~/.cache/pip
244+ key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
245+ restore-keys : |
246+ ${{ runner.os }}-pip-
247+
248+ - name : Install dependencies
249+ run : |
250+ python -m pip install --upgrade pip
251+ pip install -r requirements.txt
252+ pip install -r tests/requirements.txt
253+ pip install -e .
254+
255+ - name : Run MCP plugin tests
256+ run : |
257+ echo "Running MCP plugin tests..."
258+ python -m pytest tests/test_mcp_plugin.py -v --tb=short
259+ echo "MCP tests completed successfully!"
260+ env :
261+ OPTILLM_API_KEY : optillm
262+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
263+ HF_TOKEN : ${{ secrets.HF_TOKEN }}
0 commit comments