1+ name : Comprehensive Test Suite
2+
3+ on :
4+ workflow_dispatch : # Allow manual triggering
5+ inputs :
6+ test_type :
7+ description : ' Type of tests to run'
8+ required : true
9+ default : ' all'
10+ type : choice
11+ options :
12+ - all
13+ - unit
14+ - integration
15+ - fast
16+ - performance
17+ release :
18+ types : [published, prereleased]
19+ schedule :
20+ # Run comprehensive tests weekly on Sundays at 3 AM UTC
21+ - cron : ' 0 3 * * 0'
22+
23+ jobs :
24+ comprehensive-test :
25+ runs-on : ubuntu-latest
26+ strategy :
27+ matrix :
28+ python-version : [3.9, 3.10, 3.11]
29+
30+ steps :
31+ - name : Checkout code
32+ uses : actions/checkout@v4
33+
34+ - name : Set up Python ${{ matrix.python-version }}
35+ uses : actions/setup-python@v4
36+ with :
37+ python-version : ${{ matrix.python-version }}
38+
39+ - name : Install UV
40+ run : |
41+ curl -LsSf https://astral.sh/uv/install.sh | sh
42+ echo "$HOME/.local/bin" >> $GITHUB_PATH
43+
44+ - name : Install dependencies
45+ run : |
46+ uv pip install --system ."[ui,gradio,api,agentops,google,openai,anthropic,cohere,chat,code,realtime,call,crewai,autogen]"
47+ uv pip install --system duckduckgo_search
48+ uv pip install --system pytest pytest-asyncio pytest-cov pytest-benchmark
49+
50+ - name : Set environment variables
51+ run : |
52+ echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV
53+ echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE }}" >> $GITHUB_ENV
54+ echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME }}" >> $GITHUB_ENV
55+ echo "PYTHONPATH=${{ github.workspace }}/src/praisonai-agents:$PYTHONPATH" >> $GITHUB_ENV
56+
57+ - name : Run Comprehensive Test Suite
58+ run : |
59+ # Determine test type from input or default to 'all'
60+ TEST_TYPE="${{ github.event.inputs.test_type || 'all' }}"
61+
62+ echo "🧪 Running comprehensive test suite (type: $TEST_TYPE)"
63+
64+ case $TEST_TYPE in
65+ "unit")
66+ python tests/test_runner.py --unit
67+ ;;
68+ "integration")
69+ python tests/test_runner.py --integration
70+ ;;
71+ "fast")
72+ python tests/test_runner.py --fast
73+ ;;
74+ "performance")
75+ python tests/test_runner.py --pattern "performance"
76+ ;;
77+ "all"|*)
78+ python tests/test_runner.py --all
79+ ;;
80+ esac
81+
82+ - name : Generate Comprehensive Test Report
83+ if : always()
84+ run : |
85+ echo "# 📋 Comprehensive Test Report" > comprehensive_report.md
86+ echo "" >> comprehensive_report.md
87+ echo "**Python Version:** ${{ matrix.python-version }}" >> comprehensive_report.md
88+ echo "**Test Type:** ${{ github.event.inputs.test_type || 'all' }}" >> comprehensive_report.md
89+ echo "**Trigger:** ${{ github.event_name }}" >> comprehensive_report.md
90+ echo "**Date:** $(date -u)" >> comprehensive_report.md
91+ echo "" >> comprehensive_report.md
92+
93+ echo "## 🧪 Test Categories Covered:" >> comprehensive_report.md
94+ echo "" >> comprehensive_report.md
95+ echo "### Unit Tests:" >> comprehensive_report.md
96+ echo "- ✅ Core agent functionality" >> comprehensive_report.md
97+ echo "- ✅ Async operations" >> comprehensive_report.md
98+ echo "- ✅ Tool integrations" >> comprehensive_report.md
99+ echo "- ✅ UI components" >> comprehensive_report.md
100+ echo "" >> comprehensive_report.md
101+
102+ echo "### Integration Tests:" >> comprehensive_report.md
103+ echo "- ✅ MCP (Model Context Protocol)" >> comprehensive_report.md
104+ echo "- ✅ RAG (Retrieval Augmented Generation)" >> comprehensive_report.md
105+ echo "- ✅ Base URL API mapping" >> comprehensive_report.md
106+ echo "- ✅ Multi-agent workflows" >> comprehensive_report.md
107+ echo "" >> comprehensive_report.md
108+
109+ echo "### Key Features Tested:" >> comprehensive_report.md
110+ echo "- 🤖 Agent creation and configuration" >> comprehensive_report.md
111+ echo "- 📋 Task management and execution" >> comprehensive_report.md
112+ echo "- 🔄 Sync/async workflows" >> comprehensive_report.md
113+ echo "- 🛠️ Custom tools and error handling" >> comprehensive_report.md
114+ echo "- 🧠 Knowledge bases and RAG" >> comprehensive_report.md
115+ echo "- 🔌 MCP server connections" >> comprehensive_report.md
116+ echo "- 💬 LLM integrations (OpenAI, Anthropic, etc.)" >> comprehensive_report.md
117+ echo "- 🖥️ UI frameworks (Gradio, Streamlit)" >> comprehensive_report.md
118+ echo "- 📊 Memory and persistence" >> comprehensive_report.md
119+ echo "- 🌐 Multi-modal capabilities" >> comprehensive_report.md
120+
121+ - name : Upload Comprehensive Test Results
122+ uses : actions/upload-artifact@v3
123+ if : always()
124+ with :
125+ name : comprehensive-test-results-python-${{ matrix.python-version }}
126+ path : |
127+ comprehensive_report.md
128+ htmlcov/
129+ coverage.xml
130+ .coverage
131+ retention-days : 30
132+
133+ test-matrix-summary :
134+ runs-on : ubuntu-latest
135+ needs : comprehensive-test
136+ if : always()
137+
138+ steps :
139+ - name : Generate Matrix Summary
140+ run : |
141+ echo "# 🎯 Test Matrix Summary" > matrix_summary.md
142+ echo "" >> matrix_summary.md
143+ echo "## Python Version Results:" >> matrix_summary.md
144+ echo "- Python 3.9: ${{ needs.comprehensive-test.result }}" >> matrix_summary.md
145+ echo "- Python 3.10: ${{ needs.comprehensive-test.result }}" >> matrix_summary.md
146+ echo "- Python 3.11: ${{ needs.comprehensive-test.result }}" >> matrix_summary.md
147+ echo "" >> matrix_summary.md
148+ echo "## Overall Status:" >> matrix_summary.md
149+ if [ "${{ needs.comprehensive-test.result }}" == "success" ]; then
150+ echo "✅ **All tests passed across all Python versions!**" >> matrix_summary.md
151+ else
152+ echo "❌ **Some tests failed. Check individual job logs for details.**" >> matrix_summary.md
153+ fi
154+
155+ - name : Upload Matrix Summary
156+ uses : actions/upload-artifact@v3
157+ with :
158+ name : test-matrix-summary
159+ path : matrix_summary.md
160+ retention-days : 30
0 commit comments