This document explains how to run AI tests in CI/CD pipelines using GitHub Actions.
- Trigger: Push/PR to AI-related files
- Duration: ~5-10 minutes
- Features:
- ✅ Compiles AI framework
- ✅ Runs SimpleAIClient tests (no Ollama needed)
- ✅ Validates framework integrity
- ❌ No real LLM integration
- Trigger: Push to main, manual dispatch
- Duration: ~15-25 minutes
- Features:
- ✅ Installs Ollama + AI model
- ✅ Runs complete AI test suite
- ✅ Tests real LLM integration
- ✅ Generates AI reports
env:
OLLAMA_HOST: http://localhost:11434
AI_MODEL: tinyllama # or llama3 for full features
AI_TIMEOUT: 120000mvn test -Dai.model=tinyllama -Dollama.host=http://localhost:11434mvn test -Dtest='!org.k11techlab.framework_unittests.aiTests.**'mvn test -Dtest="org.k11techlab.framework_unittests.aiTests.**"mvn test -Dtest="SimpleAIDemo"- Size: ~1.1GB
- Speed: Fast responses (15-30s)
- Quality: Good for basic suggestions
- Install:
ollama pull tinyllama
- Size: ~4.7GB
- Speed: Comprehensive responses (40-60s)
- Quality: Excellent, detailed suggestions
- Install:
ollama pull llama3
- Size: ~2.3GB
- Speed: Balanced (20-40s)
- Quality: Good quality, Microsoft model
- Install:
ollama pull phi3
# Using GitHub CLI
gh workflow run "AI Testing Assistant CI"
# Or via GitHub web interface:
# Actions → AI Testing Assistant CI → Run workflow# Triggered automatically on AI file changes
# Or manually:
gh workflow run "Fast AI Tests"ai-test-results/- Test reports and logstarget/surefire-reports/- Maven test results- GitHub Step Summary with AI insights
🤖 AI Test Results
AI tests completed with Ollama + tinyllama model
✅ AI locator generation: PASSED
✅ AI test case creation: PASSED
✅ AI debugging assistance: PASSED
✅ AI page analysis: PASSED
-
Ollama Installation Timeout
- name: Wait for Ollama run: timeout 60 bash -c 'until curl -f http://localhost:11434; do sleep 2; done'
-
Model Pull Timeout
- name: Pull model with timeout run: timeout 600 ollama pull tinyllama
-
Chrome/ChromeDriver Issues
- name: Debug Chrome setup run: | google-chrome --version chromedriver --version
- Use Smaller Models:
tinyllamainstead ofllama3 - Cache Dependencies: Maven and Ollama models
- Parallel Jobs: Separate AI and non-AI tests
- Conditional Runs: Only on AI file changes
- ✅ Build time < 20 minutes
- ✅ AI response time < 60 seconds
- ✅ All tests passing
- ✅ No timeout errors
- name: Notify on AI Test Failure
if: failure()
run: |
echo "🚨 AI tests failed - check Ollama integration"
echo "Model: ${{ env.AI_MODEL }}"
echo "Host: ${{ env.OLLAMA_HOST }}"- Separate Workflows: Keep AI tests separate from standard tests
- Timeout Management: Set appropriate timeouts for LLM responses
- Model Selection: Use appropriate models for CI vs local development
- Caching: Cache Maven dependencies and potentially AI models
- Fallback Testing: Always test SimpleAIClient fallback path
| Aspect | Local Development | CI Environment |
|---|---|---|
| Model | llama3 (full features) | tinyllama (speed) |
| Timeout | 90s | 120s |
| Chrome | GUI | Headless |
| Ollama | Manual install | Auto-install |
| Tests | All features | Core functionality |
This setup ensures your AI Testing Assistant works reliably in both development and CI environments! 🚀