-
Notifications
You must be signed in to change notification settings - Fork 149
270 lines (244 loc) · 13 KB
/
Copy pathtest_gaia_cli.yml
File metadata and controls
270 lines (244 loc) · 13 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# Copyright(C) 2025-2026 Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
# Main GAIA CLI testing workflow that coordinates platform-specific tests
# This workflow calls both Windows (full integration) and Linux (Lemonade-independent) tests
# Platform Coverage: Windows (full) + Linux (partial) + cross-platform validation
name: GAIA CLI Tests (All Platforms)
on:
# Only run via workflow_call or manual dispatch
# Individual child workflows (test_unit.yml, test_code_agent.yml, etc.) trigger
# on push/pull_request independently - this avoids duplicate/conflicting runs
workflow_call:
workflow_dispatch:
permissions:
contents: read
# Group concurrent runs but don't cancel - child workflows have their own concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
# Run linting first (fast feedback)
lint:
name: Code Quality (Linting)
uses: ./.github/workflows/lint.yml
# Run unit tests second (fast, no external dependencies)
unit-tests:
name: Unit Tests (Fast)
needs: lint
uses: ./.github/workflows/test_unit.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
# Note: Lemonade Server Smoke Test runs as standalone workflow (test_lemonade_server.yml)
# It's not called here to avoid duplicate runs on self-hosted [stx] runner
# Test Windows CLI with full Lemonade integration
test-windows:
name: Windows CLI Tests (Full Integration)
needs: lint
uses: ./.github/workflows/test_gaia_cli_windows.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
# Test Linux CLI with full Lemonade integration
test-linux:
name: Linux CLI Tests (Full Integration)
needs: lint
uses: ./.github/workflows/test_gaia_cli_linux.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
# Test MCP Bridge functionality
test-mcp:
name: MCP Bridge Tests
needs: lint
uses: ./.github/workflows/test_mcp.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
# Test Code Agent functionality
test-code-agent:
name: Code Agent Tests
needs: lint
uses: ./.github/workflows/test_code_agent.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
# Test Chat Agent functionality
test-chat-agent:
name: Chat Agent Tests
needs: lint
uses: ./.github/workflows/test_chat_agent.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
# Test Connectors Demo Agent (standalone hub wheel, #1102)
test-connectors-demo:
name: Connectors Demo Agent Tests
needs: lint
uses: ./.github/workflows/test_connectors_demo.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
# Test Analyst Agent (standalone hub wheel, #1102)
test-analyst-agent:
name: Analyst Agent Tests
needs: lint
uses: ./.github/workflows/test_analyst_agent.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
# Test Browser Agent (standalone hub wheel, #1102)
test-browser-agent:
name: Browser Agent Tests
needs: lint
uses: ./.github/workflows/test_browser_agent.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
# Test DocQA Agent (standalone hub wheel, #1102)
test-docqa-agent:
name: DocQA Agent Tests
needs: lint
uses: ./.github/workflows/test_docqa_agent.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
# Test Routing Agent (standalone hub wheel, #1102)
test-routing-agent:
name: Routing Agent Tests
needs: lint
uses: ./.github/workflows/test_routing_agent.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
# Test Email Agent (standalone hub wheel, #1102)
test-email-agent:
name: Email Agent Tests
needs: lint
uses: ./.github/workflows/test_email_agent.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
# Test Security features
test-security:
name: Security Tests
needs: lint
uses: ./.github/workflows/test_security.yml
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
# Summary job that reports overall status
test-summary:
name: Test Summary
runs-on: ubuntu-latest
needs: [lint, unit-tests, test-windows, test-linux, test-mcp, test-code-agent, test-chat-agent, test-connectors-demo, test-analyst-agent, test-browser-agent, test-docqa-agent, test-routing-agent, test-email-agent, test-security]
# Run always except when workflow or any dependency is cancelled (e.g., by cancel-in-progress)
if: >-
${{ always() && !cancelled() &&
needs.lint.result != 'cancelled' &&
needs.unit-tests.result != 'cancelled' &&
needs.test-windows.result != 'cancelled' &&
needs.test-linux.result != 'cancelled' &&
needs.test-mcp.result != 'cancelled' &&
needs.test-code-agent.result != 'cancelled' &&
needs.test-chat-agent.result != 'cancelled' &&
needs.test-security.result != 'cancelled' }}
steps:
- name: Check test results
run: |
echo "=== GAIA CLI Test Summary ==="
echo "Lint Status: ${{ needs.lint.result }}"
echo "Unit Tests Status: ${{ needs.unit-tests.result }}"
echo "Windows Tests Status: ${{ needs.test-windows.result }}"
echo "Linux Tests Status: ${{ needs.test-linux.result }}"
echo "MCP Tests Status: ${{ needs.test-mcp.result }}"
echo "Code Agent Tests Status: ${{ needs.test-code-agent.result }}"
echo "Chat Agent Tests Status: ${{ needs.test-chat-agent.result }}"
echo "Security Tests Status: ${{ needs.test-security.result }}"
echo ""
# Check if all tests were skipped (draft PR without ready_for_ci label)
if [[ "${{ needs.lint.result }}" == "skipped" &&
"${{ needs.unit-tests.result }}" == "skipped" &&
"${{ needs.test-windows.result }}" == "skipped" &&
"${{ needs.test-linux.result }}" == "skipped" &&
"${{ needs.test-mcp.result }}" == "skipped" &&
"${{ needs.test-code-agent.result }}" == "skipped" &&
"${{ needs.test-chat-agent.result }}" == "skipped" &&
"${{ needs.test-security.result }}" == "skipped" ]]; then
echo "⏭️ All tests skipped (draft PR - add 'ready_for_ci' label to run)"
exit 0
fi
# Check if all integration tests were skipped/cancelled (workflow cancelled early)
if [[ "${{ needs.unit-tests.result }}" == "skipped" &&
"${{ needs.test-windows.result }}" == "skipped" &&
"${{ needs.test-linux.result }}" == "skipped" &&
"${{ needs.test-mcp.result }}" == "skipped" &&
"${{ needs.test-code-agent.result }}" == "skipped" &&
"${{ needs.test-chat-agent.result }}" == "skipped" &&
"${{ needs.test-security.result }}" == "skipped" ]]; then
echo "⏭️ Workflow cancelled or lint failed - no integration tests ran"
exit 0
fi
# Helper function to check if result is acceptable (success or skipped)
check_result() {
[[ "$1" == "success" || "$1" == "skipped" ]]
}
# Determine overall status (success or skipped are both acceptable)
if check_result "${{ needs.lint.result }}" &&
check_result "${{ needs.unit-tests.result }}" &&
check_result "${{ needs.test-windows.result }}" &&
check_result "${{ needs.test-linux.result }}" &&
check_result "${{ needs.test-mcp.result }}" &&
check_result "${{ needs.test-code-agent.result }}" &&
check_result "${{ needs.test-chat-agent.result }}" &&
check_result "${{ needs.test-security.result }}"; then
echo "✅ All tests passed!"
echo "- Unit Tests: Fast SDK component tests (DatabaseMixin, LLM, ASR, TTS)"
echo "- Windows: Full CLI functionality with Lemonade integration"
echo "- Linux: Full CLI functionality with Lemonade integration"
echo "- MCP: HTTP-native bridge and protocol compliance"
echo "- Code Agent: Autonomous code generation and modification"
echo "- Chat Agent: Session persistence and chat history"
echo "- Security: Path validation and shell injection prevention"
echo "- Cross-platform: Code quality and compatibility"
else
echo "❌ Some tests failed:"
[[ "${{ needs.lint.result }}" == "failure" ]] && echo " - Linting failed"
[[ "${{ needs.unit-tests.result }}" == "failure" ]] && echo " - Unit tests failed"
[[ "${{ needs.test-windows.result }}" == "failure" ]] && echo " - Windows tests failed"
[[ "${{ needs.test-linux.result }}" == "failure" ]] && echo " - Linux tests failed"
[[ "${{ needs.test-mcp.result }}" == "failure" ]] && echo " - MCP tests failed"
[[ "${{ needs.test-code-agent.result }}" == "failure" ]] && echo " - Code Agent tests failed"
[[ "${{ needs.test-chat-agent.result }}" == "failure" ]] && echo " - Chat Agent tests failed"
[[ "${{ needs.test-security.result }}" == "failure" ]] && echo " - Security tests failed"
exit 1
fi
- name: Report test coverage
run: |
echo ""
echo "=== Test Coverage by Platform ==="
echo "🔌 Lemonade Server (Smoke Test):"
echo " ✅ Health endpoint verification"
echo " ✅ Models endpoint verification"
echo " ✅ Basic inference test"
echo ""
echo "⚡ Unit Tests (Fast, No Dependencies):"
echo " ✅ DatabaseMixin: SQLite database access for agents"
echo " ✅ LLM Client: Language model client utilities"
echo " ✅ ASR: Automatic speech recognition utilities"
echo " ✅ TTS: Text-to-speech utilities"
echo ""
echo "🪟 Windows (Full Integration):"
echo " ✅ CLI installation and setup"
echo " ✅ Lemonade server integration"
echo " ✅ Core commands (chat, prompt, llm)"
echo " ✅ Audio features (talk command)"
echo " ✅ Evaluation tools"
echo " ✅ Summarizer CLI integration"
echo " ✅ Process management"
echo ""
echo "🐧 Linux (Full Integration):"
echo " ✅ CLI installation and setup"
echo " ✅ Lemonade server with Gemma model"
echo " ✅ Core commands (chat, prompt, llm)"
echo " ✅ Evaluation tools (eval, groundtruth, report)"
echo " ✅ Summarizer CLI integration"
echo " ✅ Cross-platform process management"
echo " ✅ Python import compatibility"
echo ""
echo "🌐 MCP Bridge (Cross-Platform):"
echo " ✅ HTTP-native bridge server"
echo " ✅ JSON-RPC protocol compliance"
echo " ✅ LLM agent integration"
echo " ✅ Tool registration and discovery"
echo " ✅ Error handling and recovery"
echo " ✅ CORS support for browser clients"
echo " ⏭️ Jira integration (skipped - requires auth)"
echo ""
echo "🔒 Security Tests (Cross-Platform):"
echo " ✅ Path traversal prevention (PathValidator)"
echo " ✅ Shell command injection prevention"
echo " ✅ Agent security boundary enforcement"
echo " ✅ Argument sanitization"
echo " ✅ Access control validation"
echo " ✅ Windows and Linux security verification"
echo ""
echo "🎉 Full Platform Support Achieved!"
echo " 🔧 Future enhancements:"
echo " 🚧 Audio/TTS functionality testing"
echo " 🚧 NPU driver support (if available)"
echo " 🚧 Performance optimization"