Skip to content

Init E2E Integration Test#189

Merged
rahuldevikar761 merged 23 commits into
mainfrom
users/radevika/githubActions
Jan 27, 2026
Merged

Init E2E Integration Test#189
rahuldevikar761 merged 23 commits into
mainfrom
users/radevika/githubActions

Conversation

@rahuldevikar761

Copy link
Copy Markdown
Collaborator

No description provided.

@rahuldevikar761 rahuldevikar761 requested a review from a team as a code owner January 26, 2026 22:59
Copilot AI review requested due to automatic review settings January 26, 2026 22:59
Comment thread .github/workflows/e2e-agent-samples.yml Fixed
Comment thread .github/workflows/e2e-agent-samples.yml Fixed
Comment thread .github/workflows/e2e-agent-samples.yml Fixed
Comment thread .github/workflows/e2e-agent-samples.yml Fixed
Comment thread .github/workflows/e2e-agent-samples.yml Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces an initial end-to-end (E2E) GitHub Actions workflow to spin up multiple agent samples (Python/Node.js/.NET), provision runtime configuration, and validate basic health/message endpoints using a shared set of PowerShell helper scripts.

Changes:

  • Adds a new GitHub Actions workflow to run E2E integration checks for agent samples.
  • Adds PowerShell utilities to acquire MCP bearer tokens, generate runtime config files, start/stop agents, and capture logs.
  • Adds documentation for the E2E scripts and required CI secrets.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
.github/workflows/e2e-agent-samples.yml New E2E workflow that installs dependencies, starts each sample agent, validates endpoints, and collects logs/cleanup.
scripts/e2e/Acquire-BearerToken.ps1 Acquires an MCP bearer token via ROPC for CI use.
scripts/e2e/Generate-EnvConfig.ps1 Generates .env files for Python/Node agents from secret mappings.
scripts/e2e/Generate-AppSettings.ps1 Updates .NET appsettings.json with mapped config values.
scripts/e2e/Start-Agent.ps1 Starts an agent process and waits until it is reachable via health/messages endpoints.
scripts/e2e/Stop-AgentProcess.ps1 Stops an agent process and kills any listeners on the test port.
scripts/e2e/Capture-AgentLogs.ps1 Prints agent logs and shows redacted .env/wrapper script content for debugging.
scripts/e2e/Copy-ToolingManifest.ps1 Writes a standardized ToolingManifest.json into the sample directory for E2E runs.
scripts/e2e/README.md Documents scripts, MCP auth approach, and required secrets.

Comment on lines +205 to +213
try {
$response = Invoke-WebRequest -Uri $messagesUrl -Method GET -UseBasicParsing -TimeoutSec 5 -ErrorAction Stop
}
catch {
if ($_.Exception.Response.StatusCode.value__ -eq 405) {
$ready = $true
Write-Host "Agent is ready! (messages endpoint returned 405)" -ForegroundColor Green
break
}

Copilot AI Jan 26, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the messages-endpoint fallback, the catch block dereferences $_.Exception.Response.StatusCode.value__ without checking whether Response is present. For connection failures/timeouts, Response can be null and this will throw inside the catch, aborting the readiness wait loop. Handle non-HTTP errors by null-checking Response (or using the exception type) before reading StatusCode, and only treat 405 as ready when an HTTP response exists.

Copilot uses AI. Check for mistakes.
Comment thread scripts/e2e/Start-Agent.ps1 Outdated
Comment on lines +136 to +143
$wrapperScript = Join-Path $AgentPath "run-agent.ps1"
$escapedToken = $BearerToken -replace "'", "''"

$scriptLines = @(
"`$env:PORT = '$Port'"
"`$env:ASPNETCORE_URLS = 'http://localhost:$Port'"
"`$env:BEARER_TOKEN = '$escapedToken'"
"`$env:PYTHONIOENCODING = 'utf-8'"

Copilot AI Jan 26, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script writes the bearer token into run-agent.ps1 on disk ($env:BEARER_TOKEN = '...'). That leaves a plaintext secret in the repo working directory, which is easy to leak if the workspace is reused or artifacts are collected. Prefer setting env vars in the current process before Start-Process (child inherits them) or write the wrapper into a temp path and delete it once the process is started/after cleanup.

Copilot uses AI. Check for mistakes.
Comment thread scripts/e2e/Capture-AgentLogs.ps1
Comment on lines +1 to +8
# =============================================================================
# E2E Tests: Agent Samples
# =============================================================================
# Runs E2E integration tests for all agent samples
# Uses external PowerShell scripts for maintainability
# =============================================================================

name: E2E Agent Samples

Copilot AI Jan 26, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow is missing the standard Microsoft copyright header and a minimal permissions: block. Other workflows in this repo consistently include both (e.g., .github/workflows/ci-orchestrator.yml:1-14). Add the header and set least-privilege permissions such as contents: read at the workflow or job level.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/e2e-agent-samples.yml Outdated
Comment thread .github/workflows/e2e-agent-samples.yml Outdated
MCP_ENVIRONMENT: 'Development'

# Common settings
TEST_TIMEOUT: 120

Copilot AI Jan 26, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TEST_TIMEOUT is defined as a workflow env var but is never used. Either wire it into Start-Agent.ps1 via -TimeoutSeconds ${{ env.TEST_TIMEOUT }} (or the E2E test step timeouts) or remove it to avoid configuration drift.

Suggested change
TEST_TIMEOUT: 120

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/e2e-agent-samples.yml
Comment thread scripts/e2e/Start-Agent.ps1
Restored E2E test workflow configuration for agent samples, including job definitions and environment variables.
Restored E2E tests for agent samples with detailed job configurations for Python, Node.js, and .NET agents. Added summary generation for test results.
Updated PowerShell script to enhance error handling and diagnostics.
Updated the Start-Agent.ps1 script to include additional runtime checks for Python, Node.js, and .NET environments. Enhanced logging and error handling for better diagnostics during agent startup.
- Add e2e-agent-samples.yml workflow for all 4 sample types
- Add PowerShell scripts for agent management (Start-Agent, token acquisition, etc.)
- Add E2E test project with HTTP integration tests
- Add MockBotFrameworkServer to capture agent responses
- Tests are self-contained - no external repo dependencies

Merge conflict resolve
abdulanu0
abdulanu0 previously approved these changes Jan 27, 2026
Comment thread scripts/e2e/Start-Agent.ps1 Outdated
Comment thread scripts/e2e/Capture-AgentLogs.ps1
tmlsousa
tmlsousa previously approved these changes Jan 27, 2026
@rahuldevikar761 rahuldevikar761 dismissed stale reviews from tmlsousa and abdulanu0 via f3d964e January 27, 2026 07:37
- Add Microsoft copyright header to workflow file
- Remove unused TEST_TIMEOUT env var from workflow
- Move wrapper script to temp directory (not repo working dir)
- Pass BEARER_TOKEN via env var inheritance instead of writing to script
- Delete wrapper script after process starts for additional security
Comment thread scripts/e2e/Copy-ToolingManifest.ps1
Comment thread scripts/e2e/Generate-AppSettings.ps1
@rahuldevikar761 rahuldevikar761 merged commit 09a8e55 into main Jan 27, 2026
23 checks passed
@rahuldevikar761 rahuldevikar761 deleted the users/radevika/githubActions branch January 27, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants