Integration Tests (Manual) #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Integration Tests (Manual) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| spring_ai_version: | |
| description: 'Spring AI Version (e.g., 1.0.1 or 1.1.0-SNAPSHOT)' | |
| required: false | |
| default: '1.0.1' | |
| type: string | |
| test_filter: | |
| description: 'Test filter (optional, e.g., kotlin-hello-world)' | |
| required: false | |
| default: '' | |
| type: string | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Install JBang (manual fallback) | |
| run: | | |
| echo "π¦ Installing JBang manually via curl..." | |
| curl -Ls https://sh.jbang.dev | bash -s - app setup | |
| # Add JBang to PATH for following steps | |
| echo "$HOME/.jbang/bin" >> "$GITHUB_PATH" | |
| # Verify installation | |
| echo "π Verifying JBang installation..." | |
| export PATH="$HOME/.jbang/bin:$PATH" | |
| which jbang || echo "β JBang not found in PATH" | |
| jbang version || echo "β JBang version check failed" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Claude Code CLI | |
| run: | | |
| echo "π¦ Installing Claude Code CLI..." | |
| npm install -g @anthropic-ai/claude-code | |
| echo "π Verifying Claude installation..." | |
| which claude || echo "β Claude CLI not found in PATH" | |
| claude --version || echo "β οΈ Claude CLI version check failed" | |
| - name: Cache JBang dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.jbang | |
| key: ${{ runner.os }}-jbang-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-jbang- | |
| - name: Update Spring AI version | |
| run: | | |
| echo "π¦ Updating Spring AI version to: ${{ inputs.spring_ai_version }}" | |
| ./scripts/update-spring-ai-version.sh "${{ inputs.spring_ai_version }}" | |
| - name: Verify version update | |
| run: | | |
| echo "π Verifying Spring AI version update..." | |
| ./scripts/check-spring-ai-version.sh | |
| - name: Run integration tests for known passing examples | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| BRAVE_API_KEY: ${{ secrets.BRAVE_API_KEY }} | |
| run: | | |
| echo "π§ͺ Running integration tests with Spring AI ${{ inputs.spring_ai_version }}..." | |
| echo "π Testing all 17 known passing examples" | |
| echo "" | |
| # Track test results | |
| test_results=0 | |
| test_count=0 | |
| # List of known passing tests (17 total) | |
| # Excluding: | |
| # - kotlin/rag-with-kotlin (needs Docker) | |
| # - misc/openai-streaming-response (timeout - web server) | |
| # - model-context-protocol/weather/starter-webmvc-server (timeout - web server) | |
| # - prompt-engineering/prompt-engineering-patterns (timeout - long running) | |
| # - model-context-protocol/client-starter/starter-webflux-client (connection issue) | |
| # - model-context-protocol/dynamic-tool-update/client (needs server) | |
| # - model-context-protocol/dynamic-tool-update/server (needs client) | |
| echo "ββββββββββββββββββββββββββββββββββββ" | |
| echo " SIMPLE EXAMPLES (3 tests)" | |
| echo "ββββββββββββββββββββββββββββββββββββ" | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] models/chat/helloworld" | |
| ./integration-testing/scripts/run-integration-tests.sh "chat/helloworld" || test_results=$((test_results + 1)) | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] kotlin/kotlin-hello-world" | |
| ./integration-testing/scripts/run-integration-tests.sh "kotlin-hello-world" || test_results=$((test_results + 1)) | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] misc/spring-ai-java-function-callback" | |
| ./integration-testing/scripts/run-integration-tests.sh "spring-ai-java-function-callback" || test_results=$((test_results + 1)) | |
| echo "" | |
| echo "ββββββββββββββββββββββββββββββββββββ" | |
| echo " AGENT EXAMPLES (2 tests)" | |
| echo "ββββββββββββββββββββββββββββββββββββ" | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] agents/reflection" | |
| ./integration-testing/scripts/run-integration-tests.sh "agents/reflection" || test_results=$((test_results + 1)) | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] agents/tools-and-agent-tools" | |
| ./integration-testing/scripts/run-integration-tests.sh "agents/tools-and-agent-tools" || test_results=$((test_results + 1)) | |
| echo "" | |
| echo "ββββββββββββββββββββββββββββββββββββ" | |
| echo " AGENTIC PATTERNS (5 tests)" | |
| echo "ββββββββββββββββββββββββββββββββββββ" | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] agentic-patterns/chain-workflow" | |
| ./integration-testing/scripts/run-integration-tests.sh "agentic-patterns/chain-workflow" || test_results=$((test_results + 1)) | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] agentic-patterns/evaluator-optimizer-pattern" | |
| ./integration-testing/scripts/run-integration-tests.sh "agentic-patterns/evaluator-optimizer-pattern" || test_results=$((test_results + 1)) | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] agentic-patterns/orchestrator-workers" | |
| ./integration-testing/scripts/run-integration-tests.sh "agentic-patterns/orchestrator-workers" || test_results=$((test_results + 1)) | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] agentic-patterns/parallelization" | |
| ./integration-testing/scripts/run-integration-tests.sh "agentic-patterns/parallelization" || test_results=$((test_results + 1)) | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] agentic-patterns/routing-agent" | |
| ./integration-testing/scripts/run-integration-tests.sh "agentic-patterns/routing-agent" || test_results=$((test_results + 1)) | |
| echo "" | |
| echo "ββββββββββββββββββββββββββββββββββββ" | |
| echo " MCP EXAMPLES (7 tests)" | |
| echo "ββββββββββββββββββββββββββββββββββββ" | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] model-context-protocol/brave" | |
| ./integration-testing/scripts/run-integration-tests.sh "model-context-protocol/brave" || test_results=$((test_results + 1)) | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] model-context-protocol/client-starter/starter-default-client" | |
| ./integration-testing/scripts/run-integration-tests.sh "model-context-protocol/client-starter/starter-default-client" || test_results=$((test_results + 1)) | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] model-context-protocol/filesystem" | |
| ./integration-testing/scripts/run-integration-tests.sh "model-context-protocol/filesystem" || test_results=$((test_results + 1)) | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] model-context-protocol/sqlite/chatbot" | |
| ./integration-testing/scripts/run-integration-tests.sh "model-context-protocol/sqlite/chatbot" || test_results=$((test_results + 1)) | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] model-context-protocol/sqlite/simple" | |
| ./integration-testing/scripts/run-integration-tests.sh "model-context-protocol/sqlite/simple" || test_results=$((test_results + 1)) | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] model-context-protocol/web-search/brave-chatbot" | |
| ./integration-testing/scripts/run-integration-tests.sh "model-context-protocol/web-search/brave-chatbot" || test_results=$((test_results + 1)) | |
| echo "" | |
| test_count=$((test_count + 1)) | |
| echo "[$test_count/17] model-context-protocol/web-search/brave-starter" | |
| ./integration-testing/scripts/run-integration-tests.sh "model-context-protocol/web-search/brave-starter" || test_results=$((test_results + 1)) | |
| echo "" | |
| echo "ββββββββββββββββββββββββββββββββββββ" | |
| echo " TEST SUMMARY" | |
| echo "ββββββββββββββββββββββββββββββββββββ" | |
| if [ $test_results -eq 0 ]; then | |
| echo "β All 17 examples tested successfully with Spring AI ${{ inputs.spring_ai_version }}" | |
| else | |
| echo "β $test_results test(s) failed with Spring AI ${{ inputs.spring_ai_version }}" | |
| exit 1 | |
| fi | |
| - name: Run specific test (if filter provided) | |
| if: inputs.test_filter != '' | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| run: | | |
| echo "π Running filtered test: ${{ inputs.test_filter }}" | |
| ./integration-testing/scripts/run-integration-tests.sh "${{ inputs.test_filter }}" | |
| - name: Upload test logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-logs-${{ inputs.spring_ai_version }}-${{ github.run_number }} | |
| path: | | |
| integration-testing/logs/background-runs/*.log | |
| integration-testing/logs/integration-tests/*.log | |
| retention-days: 7 | |
| - name: Summary | |
| if: always() | |
| run: | | |
| echo "## π Test Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Spring AI Version**: ${{ inputs.spring_ai_version }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Test Filter**: ${{ inputs.test_filter || 'None (ran all 17 passing examples)' }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Status**: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Examples Tested (17 total)" >> $GITHUB_STEP_SUMMARY | |
| echo "#### Simple Examples:" >> $GITHUB_STEP_SUMMARY | |
| echo "1. models/chat/helloworld" >> $GITHUB_STEP_SUMMARY | |
| echo "2. kotlin/kotlin-hello-world" >> $GITHUB_STEP_SUMMARY | |
| echo "3. misc/spring-ai-java-function-callback" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "#### Agent Examples:" >> $GITHUB_STEP_SUMMARY | |
| echo "4. agents/reflection" >> $GITHUB_STEP_SUMMARY | |
| echo "5. agents/tools-and-agent-tools" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "#### Agentic Patterns:" >> $GITHUB_STEP_SUMMARY | |
| echo "6. agentic-patterns/chain-workflow" >> $GITHUB_STEP_SUMMARY | |
| echo "7. agentic-patterns/evaluator-optimizer-pattern" >> $GITHUB_STEP_SUMMARY | |
| echo "8. agentic-patterns/orchestrator-workers" >> $GITHUB_STEP_SUMMARY | |
| echo "9. agentic-patterns/parallelization" >> $GITHUB_STEP_SUMMARY | |
| echo "10. agentic-patterns/routing-agent" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "#### MCP Examples:" >> $GITHUB_STEP_SUMMARY | |
| echo "11. model-context-protocol/brave" >> $GITHUB_STEP_SUMMARY | |
| echo "12. model-context-protocol/client-starter/starter-default-client" >> $GITHUB_STEP_SUMMARY | |
| echo "13. model-context-protocol/filesystem" >> $GITHUB_STEP_SUMMARY | |
| echo "14. model-context-protocol/sqlite/chatbot" >> $GITHUB_STEP_SUMMARY | |
| echo "15. model-context-protocol/sqlite/simple" >> $GITHUB_STEP_SUMMARY | |
| echo "16. model-context-protocol/web-search/brave-chatbot" >> $GITHUB_STEP_SUMMARY | |
| echo "17. model-context-protocol/web-search/brave-starter" >> $GITHUB_STEP_SUMMARY | |
| if [ "${{ inputs.test_filter }}" != "" ]; then | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Additional filtered test**: ${{ inputs.test_filter }}" >> $GITHUB_STEP_SUMMARY | |
| fi |