-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Updated GitHub action for manual integration tests #4147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dmytrostruk
wants to merge
12
commits into
main
Choose a base branch
from
feature-integration-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+277
−36
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ae9a540
Updated merge test permissions
dmytrostruk d6ad111
Removed repo check
dmytrostruk e63f40b
Added fetch from main for comparison
dmytrostruk 30c3abd
Updated path detection logic
dmytrostruk 661f858
Small updates
dmytrostruk b41dd2b
Reverted file rename
dmytrostruk 93930ee
Created dedicated workflows for integration tests
dmytrostruk b65f8f0
Small fix for Python
dmytrostruk fb9ff62
Small fixes
dmytrostruk 95d3efd
Small update
dmytrostruk de1a7e7
Small update
dmytrostruk ac4aa7b
Added tests check for Python
dmytrostruk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| # | ||
| # Dedicated .NET integration tests workflow, called from the manual integration test orchestrator. | ||
| # Only runs integration test matrix entries (net10.0 and net472). | ||
| # | ||
|
|
||
| name: dotnet-integration-tests | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| checkout-ref: | ||
| description: "Git ref to checkout (e.g., refs/pull/123/head)" | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| dotnet-integration-tests: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - { targetFramework: "net10.0", os: "ubuntu-latest", configuration: Release } | ||
| - { targetFramework: "net472", os: "windows-latest", configuration: Release } | ||
| runs-on: ${{ matrix.os }} | ||
| environment: integration | ||
| timeout-minutes: 60 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ inputs.checkout-ref }} | ||
| persist-credentials: false | ||
| sparse-checkout: | | ||
| . | ||
| .github | ||
| dotnet | ||
| python | ||
| workflow-samples | ||
|
|
||
| - name: Start Azure Cosmos DB Emulator | ||
| if: runner.os == 'Windows' | ||
| shell: pwsh | ||
| run: | | ||
| Write-Host "Launching Azure Cosmos DB Emulator" | ||
| Import-Module "$env:ProgramFiles\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator" | ||
| Start-CosmosDbEmulator -NoUI -Key "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" | ||
| echo "COSMOS_EMULATOR_AVAILABLE=true" >> $env:GITHUB_ENV | ||
|
|
||
| - name: Setup dotnet | ||
| uses: actions/setup-dotnet@v5.1.0 | ||
| with: | ||
| global-json-file: ${{ github.workspace }}/dotnet/global.json | ||
|
|
||
| - name: Build dotnet solutions | ||
| shell: bash | ||
| run: | | ||
| export SOLUTIONS=$(find ./dotnet/ -type f -name "*.slnx" | tr '\n' ' ') | ||
| for solution in $SOLUTIONS; do | ||
| dotnet build $solution -c ${{ matrix.configuration }} --warnaserror | ||
| done | ||
|
|
||
| - name: Azure CLI Login | ||
| uses: azure/login@v2 | ||
| with: | ||
| client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
| tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
|
||
| - name: Set up Durable Task and Azure Functions Integration Test Emulators | ||
| if: matrix.os == 'ubuntu-latest' | ||
| uses: ./.github/actions/azure-functions-integration-setup | ||
|
|
||
| - name: Run Integration Tests | ||
| shell: bash | ||
| run: | | ||
| export INTEGRATION_TEST_PROJECTS=$(find ./dotnet -type f -name "*IntegrationTests.csproj" | tr '\n' ' ') | ||
| for project in $INTEGRATION_TEST_PROJECTS; do | ||
| target_frameworks=$(dotnet msbuild $project -getProperty:TargetFrameworks -p:Configuration=${{ matrix.configuration }} -nologo 2>/dev/null | tr -d '\r') | ||
| if [[ "$target_frameworks" == *"${{ matrix.targetFramework }}"* ]]; then | ||
| dotnet test -f ${{ matrix.targetFramework }} -c ${{ matrix.configuration }} $project --no-build -v Normal --logger trx --filter "Category!=IntegrationDisabled" | ||
| else | ||
| echo "Skipping $project - does not support target framework ${{ matrix.targetFramework }} (supports: $target_frameworks)" | ||
| fi | ||
| done | ||
| env: | ||
| COSMOSDB_ENDPOINT: https://localhost:8081 | ||
| COSMOSDB_KEY: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw== | ||
| OpenAI__ApiKey: ${{ secrets.OPENAI__APIKEY }} | ||
| OpenAI__ChatModelId: ${{ vars.OPENAI__CHATMODELID }} | ||
| OpenAI__ChatReasoningModelId: ${{ vars.OPENAI__CHATREASONINGMODELID }} | ||
| AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ vars.AZUREOPENAI__CHATDEPLOYMENTNAME }} | ||
| AZURE_OPENAI_ENDPOINT: ${{ vars.AZUREOPENAI__ENDPOINT }} | ||
| AzureAI__Endpoint: ${{ secrets.AZUREAI__ENDPOINT }} | ||
| AzureAI__DeploymentName: ${{ vars.AZUREAI__DEPLOYMENTNAME }} | ||
| AzureAI__BingConnectionId: ${{ vars.AZUREAI__BINGCONECTIONID }} | ||
| FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT }} | ||
| FOUNDRY_MEDIA_DEPLOYMENT_NAME: ${{ vars.FOUNDRY_MEDIA_DEPLOYMENT_NAME }} | ||
| FOUNDRY_MODEL_DEPLOYMENT_NAME: ${{ vars.FOUNDRY_MODEL_DEPLOYMENT_NAME }} | ||
| FOUNDRY_CONNECTION_GROUNDING_TOOL: ${{ vars.FOUNDRY_CONNECTION_GROUNDING_TOOL }} |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| # | ||
| # Dedicated Python integration tests workflow, called from the manual integration test orchestrator. | ||
| # Runs all tests (unit + integration). | ||
| # | ||
|
|
||
| name: python-integration-tests | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| checkout-ref: | ||
| description: "Git ref to checkout (e.g., refs/pull/123/head)" | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| env: | ||
| UV_CACHE_DIR: /tmp/.uv-cache | ||
| RUN_INTEGRATION_TESTS: "true" | ||
|
|
||
| jobs: | ||
| python-tests-core: | ||
| name: Python Integration Tests - Core | ||
| runs-on: ubuntu-latest | ||
| environment: integration | ||
| timeout-minutes: 60 | ||
| env: | ||
| UV_PYTHON: "3.10" | ||
| OPENAI_CHAT_MODEL_ID: ${{ vars.OPENAI__CHATMODELID }} | ||
| OPENAI_RESPONSES_MODEL_ID: ${{ vars.OPENAI__RESPONSESMODELID }} | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI__APIKEY }} | ||
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| ANTHROPIC_CHAT_MODEL_ID: ${{ vars.ANTHROPIC_CHAT_MODEL_ID }} | ||
| AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ vars.AZUREOPENAI__CHATDEPLOYMENTNAME }} | ||
| AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME: ${{ vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} | ||
| AZURE_OPENAI_ENDPOINT: ${{ vars.AZUREOPENAI__ENDPOINT }} | ||
| LOCAL_MCP_URL: ${{ vars.LOCAL_MCP__URL }} | ||
| FUNCTIONS_WORKER_RUNTIME: "python" | ||
| DURABLE_TASK_SCHEDULER_CONNECTION_STRING: "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None" | ||
| AzureWebJobsStorage: "UseDevelopmentStorage=true" | ||
| defaults: | ||
| run: | ||
| working-directory: python | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ inputs.checkout-ref }} | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up python and install the project | ||
| id: python-setup | ||
| uses: ./.github/actions/python-setup | ||
| with: | ||
| python-version: "3.10" | ||
| os: ${{ runner.os }} | ||
| env: | ||
| UV_CACHE_DIR: /tmp/.uv-cache | ||
|
|
||
| - name: Azure CLI Login | ||
| uses: azure/login@v2 | ||
| with: | ||
| client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
| tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
|
||
| - name: Set up Azure Functions Integration Test Emulators | ||
| uses: ./.github/actions/azure-functions-integration-setup | ||
| id: azure-functions-setup | ||
|
|
||
| - name: Test with pytest | ||
| run: uv run poe all-tests -n logical --dist loadfile --dist worksteal --timeout=120 --session-timeout=900 --timeout_method thread --retries 2 --retry-delay 5 | ||
|
|
||
| python-tests-azure-ai: | ||
| name: Python Integration Tests - Azure AI | ||
| runs-on: ubuntu-latest | ||
| environment: integration | ||
| timeout-minutes: 60 | ||
| env: | ||
| UV_PYTHON: "3.10" | ||
| 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@v6 | ||
| with: | ||
| ref: ${{ inputs.checkout-ref }} | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up python and install the project | ||
| id: python-setup | ||
| uses: ./.github/actions/python-setup | ||
| with: | ||
| python-version: "3.10" | ||
| os: ${{ runner.os }} | ||
| env: | ||
| UV_CACHE_DIR: /tmp/.uv-cache | ||
|
|
||
| - name: Azure CLI Login | ||
| 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: 15 | ||
| run: uv run --directory packages/azure-ai poe integration-tests -n logical --dist loadfile --dist worksteal --timeout=120 --session-timeout=900 --timeout_method thread --retries 2 --retry-delay 5 | ||
dmytrostruk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| python-integration-tests-check: | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| [ | ||
| python-tests-core, | ||
| python-tests-azure-ai | ||
| ] | ||
| steps: | ||
| - name: Fail workflow if tests failed | ||
| if: contains(join(needs.*.result, ','), 'failure') | ||
| uses: actions/github-script@v8 | ||
| with: | ||
| script: core.setFailed('Integration Tests Failed!') | ||
|
|
||
| - name: Fail workflow if tests cancelled | ||
| if: contains(join(needs.*.result, ','), 'cancelled') | ||
| uses: actions/github-script@v8 | ||
| with: | ||
| script: core.setFailed('Integration Tests Cancelled!') | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.