diff --git a/.github/workflows/python-merge-tests.yml b/.github/workflows/python-merge-tests.yml index 45f9b24f79..92a5934f0e 100644 --- a/.github/workflows/python-merge-tests.yml +++ b/.github/workflows/python-merge-tests.yml @@ -43,8 +43,8 @@ jobs: - name: not python tests if: steps.filter.outputs.python != 'true' run: echo "NOT python file" - python-tests-main: - name: Python Tests - Main + python-tests-core: + name: Python Tests - Core needs: paths-filter if: github.event_name != 'pull_request' && needs.paths-filter.outputs.pythonChanges == 'true' runs-on: ${{ matrix.os }} @@ -60,56 +60,6 @@ jobs: OPENAI_CHAT_MODEL_ID: ${{ vars.OPENAI__CHATMODELID }} OPENAI_RESPONSES_MODEL_ID: ${{ vars.OPENAI__RESPONSESMODELID }} OPENAI_API_KEY: ${{ secrets.OPENAI__APIKEY }} - LOCAL_MCP_URL: ${{ vars.LOCAL_MCP__URL }} - defaults: - run: - working-directory: python - steps: - - uses: actions/checkout@v5 - - name: Set up python and install the project - id: python-setup - uses: ./.github/actions/python-setup - with: - python-version: ${{ matrix.python-version }} - os: ${{ runner.os }} - env: - # Configure a constant location for the uv cache - UV_CACHE_DIR: /tmp/.uv-cache - - name: Test with pytest - timeout-minutes: 10 - run: uv run poe all-tests -n logical --dist loadfile --dist worksteal --timeout 300 --retries 3 --retry-delay 10 - working-directory: ./python - - name: Test main samples - timeout-minutes: 10 - if: env.RUN_SAMPLES_TESTS == 'true' - run: uv run pytest tests/samples/ -m "openai" - working-directory: ./python - - name: Surface failing tests - if: always() - uses: pmeier/pytest-results-action@v0.7.2 - with: - path: ./python/**.xml - summary: true - display-options: fEX - fail-on-empty: false - title: Test results - - python-tests-azure-ai: - name: Python Tests - Azure - needs: paths-filter - if: github.event_name != 'pull_request' && needs.paths-filter.outputs.pythonChanges == 'true' - runs-on: ${{ matrix.os }} - environment: ${{ matrix.environment }} - strategy: - fail-fast: true - matrix: - python-version: ["3.10"] - os: [ubuntu-latest] - environment: ["integration"] - env: - UV_PYTHON: ${{ matrix.python-version }} - AZURE_AI_PROJECT_ENDPOINT: ${{ secrets.AZUREAI__ENDPOINT }} - AZURE_AI_MODEL_DEPLOYMENT_NAME: ${{ vars.AZUREAI__DEPLOYMENTNAME }} AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ vars.AZUREOPENAI__CHATDEPLOYMENTNAME }} AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME: ${{ vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} AZURE_OPENAI_ENDPOINT: ${{ vars.AZUREOPENAI__ENDPOINT }} @@ -139,10 +89,67 @@ jobs: timeout-minutes: 10 run: uv run poe all-tests -n logical --dist loadfile --dist worksteal --timeout 300 --retries 3 --retry-delay 10 working-directory: ./python - - name: Test azure samples + - name: Test core samples timeout-minutes: 10 if: env.RUN_SAMPLES_TESTS == 'true' - run: uv run pytest tests/samples/ -m "azure-ai" -m "azure" + run: uv run pytest tests/samples/ -m "openai" -m "azure" + working-directory: ./python + - name: Surface failing tests + if: always() + uses: pmeier/pytest-results-action@v0.7.2 + with: + path: ./python/**.xml + summary: true + display-options: fEX + fail-on-empty: false + title: Test results + + python-tests-azure-ai: + name: Python Tests - Azure AI + needs: paths-filter + if: github.event_name != 'pull_request' && needs.paths-filter.outputs.pythonChanges == 'true' + runs-on: ${{ matrix.os }} + environment: ${{ matrix.environment }} + strategy: + fail-fast: true + matrix: + python-version: ["3.10"] + os: [ubuntu-latest] + environment: ["integration"] + env: + UV_PYTHON: ${{ matrix.python-version }} + AZURE_AI_PROJECT_ENDPOINT: ${{ secrets.AZUREAI__ENDPOINT }} + AZURE_AI_MODEL_DEPLOYMENT_NAME: ${{ vars.AZUREAI__DEPLOYMENTNAME }} + LOCAL_MCP_URL: ${{ vars.LOCAL_MCP__URL }} + defaults: + run: + working-directory: python + steps: + - uses: actions/checkout@v5 + - name: Set up python and install the project + id: python-setup + uses: ./.github/actions/python-setup + with: + python-version: ${{ matrix.python-version }} + os: ${{ runner.os }} + env: + # Configure a constant location for the uv cache + UV_CACHE_DIR: /tmp/.uv-cache + - name: Azure CLI Login + if: github.event_name != 'pull_request' + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + - name: Test with pytest + timeout-minutes: 10 + run: uv run poe azure-ai-tests -n logical --dist loadfile --dist worksteal --timeout 300 --retries 3 --retry-delay 10 + working-directory: ./python + - name: Test Azure AI samples + timeout-minutes: 10 + if: env.RUN_SAMPLES_TESTS == 'true' + run: uv run pytest tests/samples/ -m "azure-ai" working-directory: ./python - name: Surface failing tests if: always() @@ -161,7 +168,7 @@ jobs: runs-on: ubuntu-latest needs: [ - python-tests-main, + python-tests-core, python-tests-azure-ai ] steps: diff --git a/python/pyproject.toml b/python/pyproject.toml index 65f3aeab23..d25815da7e 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -252,6 +252,13 @@ pytest --import-mode=importlib packages/**/tests """ +[tool.poe.tasks.azure-ai-tests] +cmd = """ +pytest --import-mode=importlib +-n logical --dist loadfile --dist worksteal +packages/azure-ai/tests +""" + [tool.poe.tasks.venv] cmd = "uv venv --clear --python $python" args = [{ name = "python", default = "3.13", options = ['-p', '--python'] }]