Skip to content

ci: verify examples and Copilot integration tests - #931

Open
Michelle Clayton (michelle-clayton-work) wants to merge 7 commits into
mainfrom
dev/mclayton/live-examples-poc
Open

ci: verify examples and Copilot integration tests#931
Michelle Clayton (michelle-clayton-work) wants to merge 7 commits into
mainfrom
dev/mclayton/live-examples-poc

Conversation

@michelle-clayton-work

@michelle-clayton-work Michelle Clayton (michelle-clayton-work) commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Add scheduled and manually dispatched CI that runs every example supported by the configured credentials. Add GitHub Copilot provider integration tests to the normal test workflow.

The first provider covered is GitHub Copilot. Both workflows use the short-lived ${{ github.token }} with copilot-requests: write, so they require no repository secret, API key, Foundry project, or Azure setup.

Example verification

live-examples.yml runs the existing cmd/verifyexamples command without a name filter. Examples for providers without configured credentials skip with their existing reasons.

Two fixed-input number-guessing examples now use their existing deterministic output checks instead of requiring Foundry semantic grading.

A validated run executed 24 available examples and skipped 83 unavailable examples with explicit reasons:
https://github.com/microsoft/agent-framework-go/actions/runs/33197392893

Copilot integration tests

Port all tests from the .NET Agent Framework GitHubCopilotAgentTests.cs into provider/copilotprovider/agent_e2e_test.go:

  • nonstreaming response
  • streaming response
  • function-tool invocation
  • approval-required function tool
  • same-session context
  • cross-client session resume
  • shell command permission
  • URL fetch permission
  • local MCP filesystem server
  • remote MCP server, explicitly skipped to match its upstream disabled category

These tests run in a dedicated Linux job in .github/workflows/test.yml. Ordinary test runs skip them. GitHub Actions runs them when GITHUB_TOKEN is available, and developers can opt in locally with RUN_COPILOT_INTEGRATION_TESTS=true.

The integration job does not run for fork pull requests because it executes checked-out code with Copilot access.

Authentication and safety

  • Checkouts do not persist Git credentials.
  • Copilot receives the job-scoped GitHub Actions token only in live test steps.
  • Integration tests disable config discovery, file hooks, git operations, session storage, and skills.
  • The normal test workflow's conclusion job includes the Copilot integration job.
  • The examples workflow uploads reports even when verification fails.

Validation

Nine active Copilot integration tests passed. The remote MCP case skipped as intended.

Upstream reference

Copilot AI lite review requested due to automatic review settings August 27, 2026 22:28
@github-actions github-actions Bot added area:examples Changes files in the examples area area:github Changes files in the github area area:tooling Changes files in the tooling area size:large At most 300 changed lines across at most 10 files kind:ci Changes CI, build, or repository automation kind:code Changes production behavior or code kind:examples Changes examples or example-support metadata kind:tests Changes tests, fixtures, or test infrastructure labels Aug 27, 2026

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

Adds a scheduled GitHub Actions workflow that runs a minimal GitHub Copilot-backed example end-to-end via the existing cmd/verifyexamples harness, to continuously validate the Copilot provider integration without external secrets or Azure/Foundry setup.

Changes:

  • Add a new Copilot “function tool canary” example that exposes a fixed tool result and prompts Copilot to include it in the final response.
  • Register the new example in cmd/verifyexamples with output assertions to validate the run.
  • Add a new scheduled/manual GitHub Actions workflow to execute the example and upload logs/reports as artifacts.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
examples/02-agents/providers/github-copilot/function_tool/main.go New minimal Copilot-backed agent example with a single fixed function tool and locked-down session config.
examples/02-agents/providers/github-copilot/function_tool/main_test.go Unit test to verify the function tool returns the expected canary string.
cmd/verifyexamples/examples.go Adds the Copilot canary example to the 02-agents verifyexamples set with must-contain / must-not-contain assertions.
.github/workflows/live-examples.yml New scheduled/manual workflow that installs Copilot CLI, runs verifyexamples for the canary, writes a job summary, and uploads artifacts.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cmd/verifyexamples/examples.go Outdated
@github-actions github-actions Bot added pending-auto-risk Automatic risk classification is in progress parity-approved Go API consistency review found no parity issues labels Aug 27, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added risk:low Limited blast radius and straightforward rollback and removed pending-auto-risk Automatic risk classification is in progress labels Aug 27, 2026
@github-actions github-actions Bot added area:provider Changes files in the provider area area:provider/copilot Changes files in the provider / copilot area size:xlarge More than 300 changed lines or 10 files and removed size:large At most 300 changed lines across at most 10 files labels Aug 28, 2026
@michelle-clayton-work Michelle Clayton (michelle-clayton-work) changed the title ci: verify Copilot example end to end Aug 28, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added pending-auto-risk Automatic risk classification is in progress risk:low Limited blast radius and straightforward rollback and removed risk:low Limited blast radius and straightforward rollback pending-auto-risk Automatic risk classification is in progress labels Aug 28, 2026

@qmuntal Quim Muntal (qmuntal) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Like the direction 😸

Comment thread provider/copilotprovider/agent_e2e_test.go
Comment thread .github/workflows/live-examples.yml Outdated
@github-actions

Copy link
Copy Markdown
Contributor

API Consistency Review

Scope: internal-only (CI workflows and tests)

Changed Go contract: None — no exported Go identifiers were added, removed, or modified. The PR adds two GitHub Actions workflow files (.github/workflows/), refactors internal test-tool verification logic in cmd/verifyexamples/examples.go (unexported helpers), and adds a new integration test file provider/copilotprovider/agent_e2e_test.go (test package, not part of the public API surface).

Upstream evidence reviewed: The PR description cites dotnet/tests/Microsoft.Agents.AI.GitHub.Copilot.IntegrationTests/GitHubCopilotAgentTests.cs as the upstream reference. The three ported test cases (non-streaming response, streaming response, function-tool invocation) map directly to the upstream test class. No public API or behavioral contract is being introduced or changed; this is a test coverage port.

Result: Out of scope — the change is limited to CI configuration and tests with no user-visible Go API or behavior change. No parity issues identified.

Generated by Go API Consistency Review Agent for #931 · sonnet46 · 23.1 AIC · ⌖ 4.06 AIC · ⊞ 6.4K ·

@github-actions github-actions Bot added pending-auto-risk Automatic risk classification is in progress risk:low Limited blast radius and straightforward rollback and removed kind:code Changes production behavior or code risk:low Limited blast radius and straightforward rollback pending-auto-risk Automatic risk classification is in progress labels Aug 31, 2026
@@ -708,14 +708,13 @@ var agentsExamples = []ExampleDefinition{
SkipReason: "Spawns a local stdio MCP server subprocess (go run) that requires live Foundry credentials.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why the changes in this file?

if [[ "$EXAMPLES_OUTCOME" != "success" ]]; then
echo "Example verification failed."
exit 1
fi No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add a new line at the end of the file.

})
session := newE2ESession(t, canaryAgent, client)

ctx, cancel := context.WithTimeout(t.Context(), 2*time.Minute)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't hardcode timeouts. The testing framework already cancels the t.Context() when the test should time out. Adding another source of cancellation only adds noise. Same for subsequent WithTimeout Calls.


- name: Install Copilot CLI
shell: bash
run: npm install --global @github/copilot@1.0.75

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we make this version handled by dependabot?


- name: Install Copilot CLI
shell: bash
run: npm install --global @github/copilot@1.0.75

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we make this version handled by dependabot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:examples Changes files in the examples area area:github Changes files in the github area area:provider/copilot Changes files in the provider / copilot area area:provider Changes files in the provider area area:tooling Changes files in the tooling area kind:ci Changes CI, build, or repository automation kind:examples Changes examples or example-support metadata kind:tests Changes tests, fixtures, or test infrastructure parity-approved Go API consistency review found no parity issues risk:low Limited blast radius and straightforward rollback size:xlarge More than 300 changed lines or 10 files

3 participants