-
Notifications
You must be signed in to change notification settings - Fork 50
Adding new samples to the test suite #205
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
42e0a92
Adding new samples to the test suite
abdulanu0 043fcd4
fix: Use existing Python OpenAI secrets for Agent Framework sample
abdulanu0 1e02409
fix: Improve PR comment posting in e2e-orchestrator
abdulanu0 a64dbe7
Merge remote-tracking branch 'origin/main' into users/anabdul/add_sam…
abdulanu0 c64a3af
fix: Remove Node.js Copilot Studio from E2E tests
abdulanu0 d633f8c
fix: Extract Python module name from StartCommand for pre-flight check
abdulanu0 766b013
fix: Add missing wrapt dependency to Google ADK sample
abdulanu0 182d973
fix: Make auth_handler_name configurable in Google ADK sample
abdulanu0 faf7695
fix: Add graceful fallback for MCP session errors in Google ADK sample
abdulanu0 0629a84
Fix MCP tool URL - use server_config.url instead of mcp_server_unique…
abdulanu0 0c87d05
Improve MCP error handling with fallback and better logging
abdulanu0 1aaeaf0
Trigger E2E tests after ADK tooling update
abdulanu0 4e51d76
fix: Add missing instruction to Agent and improve error messages in G…
abdulanu0 e8544cb
Remove Google ADK from E2E tests
abdulanu0 7fe275f
Merge branch 'main' into users/anabdul/add_samples_to_test
abdulanu0 18dac31
Merge branch 'main' into users/anabdul/add_samples_to_test
abdulanu0 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,180 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT License. | ||
|
|
||
| name: E2E - Node.js Copilot Studio | ||
|
|
||
| on: | ||
| workflow_call: # Allow orchestrator to call this workflow | ||
| workflow_dispatch: # Allow manual triggering | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - 'nodejs/copilot-studio/**' | ||
| - 'scripts/e2e/**' | ||
| - '.github/workflows/e2e-nodejs-copilot-studio.yml' | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - 'nodejs/copilot-studio/**' | ||
| - 'scripts/e2e/**' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| SAMPLE_PATH: nodejs/copilot-studio/sample-agent | ||
| AGENT_PORT: 3978 | ||
| SCRIPTS_PATH: scripts/e2e | ||
| E2E_TESTS_PATH: tests/e2e | ||
|
|
||
| jobs: | ||
| nodejs-copilot-studio: | ||
| name: Node.js Copilot Studio Agent | ||
| runs-on: windows-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup .NET SDK | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: '8.0.x' | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: ${{ env.SAMPLE_PATH }} | ||
| run: | | ||
| if (Test-Path "package-lock.json") { | ||
| npm ci | ||
| } else { | ||
| npm install | ||
| } | ||
| if (Test-Path "tsconfig.json") { | ||
| npm run build | ||
| } | ||
| shell: pwsh | ||
|
|
||
| - name: Log SDK Versions | ||
| shell: pwsh | ||
| run: | | ||
| & "${{ env.SCRIPTS_PATH }}/Get-SDKVersions.ps1" ` | ||
| -Runtime "nodejs" ` | ||
| -WorkingDirectory "${{ env.SAMPLE_PATH }}" | ||
|
|
||
| - name: Acquire Bearer Token (ROPC) | ||
| id: token | ||
| shell: pwsh | ||
| run: | | ||
| $token = & "${{ env.SCRIPTS_PATH }}/Acquire-BearerToken.ps1" ` | ||
| -ClientId "${{ secrets.MCP_CLIENT_ID }}" ` | ||
| -TenantId "${{ secrets.MCP_TENANT_ID }}" ` | ||
| -Username "${{ secrets.MCP_TEST_USERNAME }}" ` | ||
| -Password "${{ secrets.MCP_TEST_PASSWORD }}" | ||
| echo "BEARER_TOKEN=$token" >> $env:GITHUB_OUTPUT | ||
| echo "::add-mask::$token" | ||
|
|
||
| - name: Generate .env configuration | ||
| shell: pwsh | ||
| run: | | ||
| $configMappings = @{ | ||
| "NODE_ENV" = "development" | ||
| "directConnectUrl" = "${{ secrets.NODEJS_COPILOT_STUDIO_DIRECT_CONNECT_URL }}" | ||
| "environmentId" = "${{ secrets.NODEJS_COPILOT_STUDIO_ENVIRONMENT_ID }}" | ||
| "agentIdentifier" = "${{ secrets.NODEJS_COPILOT_STUDIO_AGENT_IDENTIFIER }}" | ||
| "connections__service_connection__settings__authType" = "ClientSecret" | ||
| "connections__service_connection__settings__clientId" = "${{ secrets.NODEJS_COPILOT_STUDIO_AGENT_ID }}" | ||
| "connections__service_connection__settings__clientSecret" = "${{ secrets.NODEJS_COPILOT_STUDIO_CLIENT_SECRET }}" | ||
| "connections__service_connection__settings__tenantId" = "${{ secrets.TENANT_ID }}" | ||
| "connectionsMap__0__serviceUrl" = "*" | ||
| "connectionsMap__0__connection" = "service_connection" | ||
| "agentic_scopes" = "https://api.powerplatform.com/.default" | ||
| } | ||
| & "${{ env.SCRIPTS_PATH }}/Generate-EnvConfig.ps1" ` | ||
| -OutputPath "${{ env.SAMPLE_PATH }}/.env" ` | ||
| -BearerToken "${{ steps.token.outputs.BEARER_TOKEN }}" ` | ||
| -Port ${{ env.AGENT_PORT }} ` | ||
| -ConfigMappings $configMappings | ||
|
|
||
| - name: Start Agent | ||
| id: start-agent | ||
| shell: pwsh | ||
| run: | | ||
| $agentPid = & "${{ env.SCRIPTS_PATH }}/Start-Agent.ps1" ` | ||
| -AgentPath "${{ env.SAMPLE_PATH }}" ` | ||
| -StartCommand "node dist/index.js" ` | ||
| -Port ${{ env.AGENT_PORT }} ` | ||
| -BearerToken "${{ steps.token.outputs.BEARER_TOKEN }}" ` | ||
| -Environment "Development" ` | ||
| -Runtime "nodejs" | ||
| echo "AGENT_PID=$agentPid" >> $env:GITHUB_OUTPUT | ||
|
|
||
| - name: Verify Agent Running | ||
| shell: pwsh | ||
| run: | | ||
| $agentPid = "${{ steps.start-agent.outputs.AGENT_PID }}" | ||
| if ($agentPid) { | ||
| try { | ||
| $proc = Get-Process -Id $agentPid -ErrorAction Stop | ||
| Write-Host "Agent process (PID: $agentPid) is running: $($proc.ProcessName)" -ForegroundColor Green | ||
| } catch { | ||
| Write-Host "ERROR: Agent process (PID: $agentPid) is NOT running!" -ForegroundColor Red | ||
| throw "Agent process has stopped" | ||
| } | ||
| } | ||
| $agentUrl = "http://localhost:${{ env.AGENT_PORT }}" | ||
| $healthResponse = Invoke-WebRequest -Uri "$agentUrl/api/health" -Method GET -UseBasicParsing -ErrorAction SilentlyContinue | ||
| Write-Host "Health check: $($healthResponse.StatusCode)" -ForegroundColor Green | ||
|
|
||
| - name: Restore E2E Test Dependencies | ||
| run: dotnet restore "${{ env.E2E_TESTS_PATH }}/Agent365.E2E.Tests.csproj" | ||
|
|
||
| - name: Run .NET E2E Tests | ||
| shell: pwsh | ||
| run: | | ||
| dotnet test "${{ env.E2E_TESTS_PATH }}/Agent365.E2E.Tests.csproj" ` | ||
| --no-restore ` | ||
| --verbosity normal ` | ||
| --logger "console;verbosity=detailed" ` | ||
| --logger "trx;LogFileName=test-results-nodejs-copilot-studio.trx" ` | ||
| --filter "Category=HTTP" | ||
| env: | ||
| AGENT_URL: http://localhost:${{ env.AGENT_PORT }} | ||
| TEST_RESULTS_DIR: ${{ runner.temp }}/TestConversations | ||
|
|
||
| - name: Emit Test Conversations | ||
| if: always() | ||
| shell: pwsh | ||
| run: | | ||
| & "${{ env.SCRIPTS_PATH }}/Emit-TestConversations.ps1" ` | ||
| -TestResultsDir "${{ runner.temp }}/TestConversations" | ||
|
|
||
| - name: Capture Agent Logs | ||
| if: always() | ||
| shell: pwsh | ||
| run: | | ||
| & "${{ env.SCRIPTS_PATH }}/Capture-AgentLogs.ps1" ` | ||
| -AgentPath "${{ env.SAMPLE_PATH }}" | ||
|
|
||
| - name: Stop Agent Process | ||
| if: always() | ||
| shell: pwsh | ||
| run: | | ||
| $agentPid = "${{ steps.start-agent.outputs.AGENT_PID }}" | ||
| if ($agentPid) { | ||
| & "${{ env.SCRIPTS_PATH }}/Stop-AgentProcess.ps1" -AgentPID $agentPid | ||
| } | ||
|
|
||
| - name: Upload Test Results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: test-results-nodejs-copilot-studio | ||
| path: | | ||
| ${{ env.E2E_TESTS_PATH }}/TestResults/**/*.trx | ||
| ${{ env.E2E_TESTS_PATH }}/TestResults/**/*-logs.txt | ||
| retention-days: 7 | ||
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
Oops, something went wrong.
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.