SDK Library Integration Tests Runner 6103/merge by @Nimrod007 #6364
Workflow file for this run
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
| # Runner for the suite of library integration tests | |
| # | |
| # echo "result=${{ secrets.OPENAI_API_KEY != '' }}" >> $GITHUB_OUTPUT | |
| name: SDK Library Integration Tests Runner | |
| run-name: "SDK Library Integration Tests Runner ${{ github.ref_name }} by @${{ github.actor }}" | |
| permissions: | |
| contents: read | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| libs: | |
| description: "Choose specific library to test against or all" | |
| required: true | |
| type: choice | |
| options: | |
| - all | |
| - openai | |
| - langchain | |
| - langchain_legacy | |
| - llama_index | |
| - anthropic | |
| - aisuite | |
| - haystack | |
| - guardrails | |
| - dspy | |
| - crewai_v0 | |
| - crewai_v1 | |
| - genai | |
| - adk | |
| - adk_legacy_1_3_0 | |
| - metrics | |
| - bedrock | |
| - litellm | |
| - harbor | |
| run_expensive_tests: | |
| description: "Run expensive tests (e.g., video generation). Enabled by default on weekly scheduled runs." | |
| required: false | |
| type: boolean | |
| default: false | |
| schedule: | |
| # Daily run at midnight UTC Monday-Saturday (without expensive tests) | |
| - cron: "0 0 * * 1-6" | |
| # Weekly run on Sunday at midnight UTC (with expensive tests) | |
| - cron: "0 0 * * 0" | |
| pull_request: | |
| paths: | |
| - 'sdks/python/**' | |
| push: | |
| branches: | |
| - 'main' | |
| paths: | |
| - 'sdks/python/**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| LIBS: ${{ github.event.inputs.libs != '' && github.event.inputs.libs || 'all' }} | |
| OPIK_SENTRY_ENABLE: False | |
| jobs: | |
| has_needed_secrets: | |
| name: Check Secrets | |
| runs-on: ubuntu-latest | |
| outputs: | |
| has_secrets: ${{ steps.init.outputs.has_secrets }} | |
| steps: | |
| - name: Print has secrets into output | |
| id: init | |
| run: | | |
| echo "has_secrets=${{ secrets.OPENAI_API_KEY != '' }}" >> $GITHUB_OUTPUT | |
| missed_api_key_warning: | |
| name: Missed OpenAI API Key Warning | |
| needs: [has_needed_secrets] | |
| runs-on: ubuntu-latest | |
| if: ${{ needs.has_needed_secrets.outputs.has_secrets == 'false' }} | |
| steps: | |
| - name: Print disabled message | |
| run: | | |
| echo "::warning::SDK Library Integration Tests are disabled because OPENAI_API_KEY is not set" | |
| init_environment: | |
| name: Build | |
| needs: [has_needed_secrets] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| if: ${{ needs.has_needed_secrets.outputs.has_secrets == 'true' }} | |
| outputs: | |
| LIBS: ${{ steps.init.outputs.LIBS }} | |
| steps: | |
| - name: Make LIBS variable global (workaround for cron) | |
| id: init | |
| run: | | |
| echo "LIBS=${{ env.LIBS }}" >> $GITHUB_OUTPUT | |
| openai_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["openai", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-openai-tests.yml | |
| with: | |
| # Run expensive tests on weekly schedule (Sunday) or when manually requested | |
| run_expensive_tests: ${{ (github.event_name == 'schedule' && github.event.schedule == '0 0 * * 0') || github.event.inputs.run_expensive_tests == 'true' }} | |
| secrets: inherit | |
| langchain_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["langchain", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-langchain-tests.yml | |
| secrets: inherit | |
| langchain_legacy_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["langchain_legacy", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-langchain-legacy-tests.yml | |
| secrets: inherit | |
| llama_index_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["llama_index", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-llama-index-tests.yml | |
| secrets: inherit | |
| anthropic_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["anthropic", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-anthropic-tests.yml | |
| secrets: inherit | |
| aisuite_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["aisuite", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-aisuite-tests.yml | |
| secrets: inherit | |
| haystack_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["haystack", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-haystack-tests.yml | |
| secrets: inherit | |
| guardrails_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["guardrails", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-guardrails-tests.yml | |
| secrets: inherit | |
| dspy_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["dspy", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-dspy-tests.yml | |
| secrets: inherit | |
| crewai_v0_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["crewai_v0", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-crewai-v0-tests.yml | |
| secrets: inherit | |
| crewai_v1_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["crewai_v1", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-crewai-v1-tests.yml | |
| secrets: inherit | |
| genai_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["genai", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-genai-tests.yml | |
| with: | |
| # Run expensive tests on weekly schedule (Sunday) or when manually requested | |
| run_expensive_tests: ${{ (github.event_name == 'schedule' && github.event.schedule == '0 0 * * 0') || github.event.inputs.run_expensive_tests == 'true' }} | |
| secrets: inherit | |
| adk_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["adk", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-adk-tests.yml | |
| secrets: inherit | |
| adk_legacy_1_3_0_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["adk_legacy_1_3_0", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-adk-legacy-1-3-0-tests.yml | |
| secrets: inherit | |
| evaluation_metrics_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["metrics", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-metrics-with-llm-judge-tests.yml | |
| secrets: inherit | |
| bedrock_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["bedrock", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-bedrock-tests.yml | |
| secrets: inherit | |
| litellm_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["litellm", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-litellm-tests.yml | |
| secrets: inherit | |
| harbor_tests: | |
| needs: [init_environment] | |
| if: contains(fromJSON('["harbor", "all"]'), needs.init_environment.outputs.LIBS) | |
| uses: ./.github/workflows/lib-harbor-tests.yml | |
| secrets: inherit | |
| # ======================================== | |
| # Slack Notification (manual and scheduled runs only) | |
| # ======================================== | |
| notify-slack: | |
| name: "Slack Notification" | |
| runs-on: ubuntu-latest | |
| needs: | |
| - openai_tests | |
| - langchain_tests | |
| - langchain_legacy_tests | |
| - llama_index_tests | |
| - anthropic_tests | |
| - aisuite_tests | |
| - haystack_tests | |
| - guardrails_tests | |
| - dspy_tests | |
| - crewai_v0_tests | |
| - crewai_v1_tests | |
| - genai_tests | |
| - adk_tests | |
| - adk_legacy_1_3_0_tests | |
| - evaluation_metrics_tests | |
| - bedrock_tests | |
| - litellm_tests | |
| - harbor_tests | |
| if: always() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | |
| steps: | |
| - name: "🔍 Check Slack configuration" | |
| id: check-slack | |
| run: | | |
| if [ -z "${{ secrets.SLACK_WEBHOOK_URL }}" ]; then | |
| echo "configured=false" >> $GITHUB_OUTPUT | |
| echo "::notice::SLACK_WEBHOOK_URL not configured - Slack notification will be skipped" | |
| else | |
| echo "configured=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: "📢 Send Slack notification" | |
| if: steps.check-slack.outputs.configured == 'true' | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| SLACK_USER_ID: ${{ secrets.SLACK_SDK_TESTS_NOTIFY_USER_ID }} | |
| run: | | |
| # Gather information | |
| WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| BRANCH="${{ github.ref_name }}" | |
| COMMIT_SHA="${{ github.sha }}" | |
| SHORT_SHA="${COMMIT_SHA:0:7}" | |
| # Determine trigger type for display | |
| if [ "${{ github.event_name }}" == "schedule" ]; then | |
| TRIGGER_TYPE=$([[ "${{ github.event.schedule }}" == "0 0 * * 0" ]] && echo "Weekly Schedule" || echo "Daily Schedule") | |
| else | |
| TRIGGER_TYPE="Manual Dispatch" | |
| fi | |
| # Categorize test suites by result | |
| SUCCESS_SUITES="" | |
| FAILED_SUITES="" | |
| SKIPPED_SUITES="" | |
| SUCCESS_COUNT=0 | |
| FAILURE_COUNT=0 | |
| SKIPPED_COUNT=0 | |
| # Helper function to categorize suite | |
| categorize_suite() { | |
| local result="$1" | |
| local name="$2" | |
| case "$result" in | |
| success) | |
| [ -n "$SUCCESS_SUITES" ] && SUCCESS_SUITES="${SUCCESS_SUITES}, " | |
| SUCCESS_SUITES="${SUCCESS_SUITES}${name}" | |
| SUCCESS_COUNT=$((SUCCESS_COUNT + 1)) | |
| ;; | |
| failure) | |
| [ -n "$FAILED_SUITES" ] && FAILED_SUITES="${FAILED_SUITES}, " | |
| FAILED_SUITES="${FAILED_SUITES}${name}" | |
| FAILURE_COUNT=$((FAILURE_COUNT + 1)) | |
| ;; | |
| skipped|cancelled) | |
| [ -n "$SKIPPED_SUITES" ] && SKIPPED_SUITES="${SKIPPED_SUITES}, " | |
| SKIPPED_SUITES="${SKIPPED_SUITES}${name}" | |
| SKIPPED_COUNT=$((SKIPPED_COUNT + 1)) | |
| ;; | |
| esac | |
| } | |
| categorize_suite "${{ needs.openai_tests.result }}" "OpenAI" | |
| categorize_suite "${{ needs.langchain_tests.result }}" "LangChain" | |
| categorize_suite "${{ needs.langchain_legacy_tests.result }}" "LangChain Legacy" | |
| categorize_suite "${{ needs.llama_index_tests.result }}" "LlamaIndex" | |
| categorize_suite "${{ needs.anthropic_tests.result }}" "Anthropic" | |
| categorize_suite "${{ needs.aisuite_tests.result }}" "AISuite" | |
| categorize_suite "${{ needs.haystack_tests.result }}" "Haystack" | |
| categorize_suite "${{ needs.guardrails_tests.result }}" "Guardrails" | |
| categorize_suite "${{ needs.dspy_tests.result }}" "DSPy" | |
| categorize_suite "${{ needs.crewai_v0_tests.result }}" "CrewAI v0" | |
| categorize_suite "${{ needs.crewai_v1_tests.result }}" "CrewAI v1" | |
| categorize_suite "${{ needs.genai_tests.result }}" "GenAI" | |
| categorize_suite "${{ needs.adk_tests.result }}" "ADK" | |
| categorize_suite "${{ needs.adk_legacy_1_3_0_tests.result }}" "ADK Legacy 1.3.0" | |
| categorize_suite "${{ needs.evaluation_metrics_tests.result }}" "Evaluation Metrics" | |
| categorize_suite "${{ needs.bedrock_tests.result }}" "Bedrock" | |
| categorize_suite "${{ needs.litellm_tests.result }}" "LiteLLM" | |
| categorize_suite "${{ needs.harbor_tests.result }}" "Harbor" | |
| # Determine overall status | |
| if [ "$FAILURE_COUNT" -gt 0 ]; then | |
| STATUS_EMOJI="❌" | |
| STATUS_TEXT="Failed" | |
| COLOR="danger" | |
| else | |
| STATUS_EMOJI="✅" | |
| STATUS_TEXT="Passed" | |
| COLOR="good" | |
| fi | |
| # Build blocks array | |
| BLOCKS='[]' | |
| # Header | |
| BLOCKS=$(echo "$BLOCKS" | jq --arg title "$STATUS_EMOJI Python SDK Integration Tests $STATUS_TEXT" \ | |
| '. + [{"type": "header", "text": {"type": "plain_text", "text": $title, "emoji": true}}]') | |
| # Info fields | |
| BLOCKS=$(echo "$BLOCKS" | jq \ | |
| --arg trigger "$TRIGGER_TYPE" \ | |
| --arg branch "$BRANCH" \ | |
| --arg commit_url "https://github.com/${{ github.repository }}/commit/$COMMIT_SHA" \ | |
| --arg short_sha "$SHORT_SHA" \ | |
| '. + [{"type": "section", "fields": [ | |
| {"type": "mrkdwn", "text": ("*Trigger:*\n" + $trigger)}, | |
| {"type": "mrkdwn", "text": ("*Branch:*\n`" + $branch + "`")}, | |
| {"type": "mrkdwn", "text": ("*Commit:*\n<" + $commit_url + "|`" + $short_sha + "`>")} | |
| ]}]') | |
| # Summary counts | |
| BLOCKS=$(echo "$BLOCKS" | jq \ | |
| --arg success "$SUCCESS_COUNT" \ | |
| --arg failed "$FAILURE_COUNT" \ | |
| --arg skipped "$SKIPPED_COUNT" \ | |
| '. + [{"type": "section", "text": {"type": "mrkdwn", "text": ("✅ *Passed:* " + $success + " | ❌ *Failed:* " + $failed + " | ⏭️ *Skipped:* " + $skipped)}}]') | |
| # Failed suites (if any) | |
| if [ -n "$FAILED_SUITES" ]; then | |
| BLOCKS=$(echo "$BLOCKS" | jq --arg suites "$FAILED_SUITES" \ | |
| '. + [{"type": "section", "text": {"type": "mrkdwn", "text": ("❌ *Failed:* " + $suites)}}]') | |
| fi | |
| # Success suites (if any) | |
| if [ -n "$SUCCESS_SUITES" ]; then | |
| BLOCKS=$(echo "$BLOCKS" | jq --arg suites "$SUCCESS_SUITES" \ | |
| '. + [{"type": "section", "text": {"type": "mrkdwn", "text": ("✅ *Passed:* " + $suites)}}]') | |
| fi | |
| # Skipped suites (if any) | |
| if [ -n "$SKIPPED_SUITES" ]; then | |
| BLOCKS=$(echo "$BLOCKS" | jq --arg suites "$SKIPPED_SUITES" \ | |
| '. + [{"type": "section", "text": {"type": "mrkdwn", "text": ("⏭️ *Skipped:* " + $suites)}}]') | |
| fi | |
| # Action button | |
| BLOCKS=$(echo "$BLOCKS" | jq --arg url "$WORKFLOW_URL" \ | |
| '. + [{"type": "actions", "elements": [{"type": "button", "text": {"type": "plain_text", "text": "🔍 View Workflow", "emoji": true}, "url": $url}]}]') | |
| # Mention (if configured) | |
| if [ -n "$SLACK_USER_ID" ]; then | |
| BLOCKS=$(echo "$BLOCKS" | jq --arg user_id "$SLACK_USER_ID" \ | |
| '. + [{"type": "context", "elements": [{"type": "mrkdwn", "text": ("👤 cc: <@" + $user_id + ">")}]}]') | |
| fi | |
| # Build final payload | |
| echo "$BLOCKS" | jq --arg color "$COLOR" '{"attachments": [{"color": $color, "blocks": .}]}' > payload.json | |
| # Debug: show payload | |
| echo "Payload:" | |
| cat payload.json | |
| # Send notification | |
| HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \ | |
| -X POST \ | |
| -H 'Content-type: application/json' \ | |
| --data @payload.json \ | |
| "$SLACK_WEBHOOK_URL") | |
| if [ "$HTTP_CODE" -eq 200 ]; then | |
| echo "✅ Slack notification sent successfully" | |
| else | |
| echo "⚠️ Slack notification failed with HTTP code: $HTTP_CODE" | |
| exit 1 | |
| fi | |
| - name: "ℹ️ Slack not configured" | |
| if: steps.check-slack.outputs.configured != 'true' | |
| run: | | |
| echo "## 📢 Slack Notification Skipped" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Slack notifications are not configured. To enable them:" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Add the webhook URL as a repository secret named \`SLACK_WEBHOOK_URL\`" >> $GITHUB_STEP_SUMMARY |