Skip to content

Commit 21c5b85

Browse files
Jian WuCopilot
andcommitted
Add E2E test pipeline for azure.ai.agents extension
MCP-tool-driven workflow for running cli-interactive-tester scenarios. Manual dispatch only (workflow_dispatch) with tier selection (0, 0+1, 0+1+2). Key design: - All scenarios executed via cli-interactive-tester MCP tool (not shell parsing) - Tool installed via git clone + pip install -e from coreai-microsoft repo - Checkout hardcoded to trangevi/test-scenarios (until PR Azure#8524 merges) - ubuntu-22.04 runner (consistent with existing pipelines) - profile.local.yaml generated from GitHub secrets at runtime - Tier 2 includes always-run teardown step for resource cleanup - Results uploaded as artifacts Blocking: python -m auto_test_tool.runner batch mode needs to be confirmed or implemented. Without it, scenarios cannot run headlessly in CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3672e81 commit 21c5b85

1 file changed

Lines changed: 140 additions & 0 deletions

File tree

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
name: "ext-azure-ai-agents-e2e"
2+
3+
# E2E tests for the azure.ai.agents CLI extension.
4+
# Driven by cli-interactive-tester MCP tool (tmux-based scenario execution).
5+
#
6+
# Manual trigger only — switch to PR-trigger once pipeline is stable.
7+
# Scenarios live on branch trangevi/test-scenarios until PR #8524 merges.
8+
9+
on:
10+
workflow_dispatch:
11+
inputs:
12+
tier:
13+
description: "Which tiers to run"
14+
type: choice
15+
options:
16+
- "0"
17+
- "0+1"
18+
- "0+1+2"
19+
default: "0"
20+
confirm_tier2_cost:
21+
description: "Confirm Tier 2 Azure costs (~$2-5)"
22+
type: boolean
23+
default: false
24+
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.run_id }}
27+
cancel-in-progress: true
28+
29+
permissions:
30+
contents: read
31+
32+
env:
33+
SCENARIOS_DIR: cli/azd/extensions/azure.ai.agents/tests/cli-interactive-tester-scenarios
34+
AZD_AGENTS_FIXTURES: cli/azd/extensions/azure.ai.agents/tests/cli-interactive-tester-scenarios/fixtures
35+
# TODO: change to 'main' after PR #8524 merges
36+
TARGET_BRANCH: trangevi/test-scenarios
37+
38+
jobs:
39+
e2e-test:
40+
name: "E2E scenarios (Tier ${{ inputs.tier }})"
41+
runs-on: ubuntu-22.04
42+
timeout-minutes: 90
43+
steps:
44+
- uses: actions/checkout@v6
45+
with:
46+
# TODO: remove ref after PR #8524 merges to main
47+
ref: ${{ env.TARGET_BRANCH }}
48+
49+
- uses: actions/setup-go@v6
50+
with:
51+
go-version-file: "cli/azd/go.mod"
52+
53+
- uses: actions/setup-python@v5
54+
with:
55+
python-version: "3.12"
56+
57+
- name: Build azd + install extension
58+
working-directory: cli/azd
59+
run: |
60+
go build -o ./azd .
61+
export PATH="$PWD:$PATH"
62+
azd extension install azure.ai.agents --source ./extensions/azure.ai.agents
63+
64+
- name: Install cli-interactive-tester
65+
run: |
66+
sudo apt-get install -y tmux
67+
git clone https://github.com/coreai-microsoft/cli-interactive-tester.git /tmp/cli-interactive-tester
68+
cd /tmp/cli-interactive-tester
69+
pip install -e .
70+
python -c "from auto_test_tool.mcp_server import main; print('MCP tool ready')"
71+
72+
- name: Install uv (for Tier 2 run-local scenario)
73+
if: contains(inputs.tier, '2')
74+
uses: astral-sh/setup-uv@v6
75+
76+
- name: Azure Login
77+
uses: azure/login@v2
78+
with:
79+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
80+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
81+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
82+
83+
- name: GitHub CLI Auth
84+
run: echo "${{ secrets.GH_TOKEN }}" | gh auth login --with-token
85+
86+
- name: Create test profile
87+
working-directory: ${{ env.SCENARIOS_DIR }}
88+
run: |
89+
cat > profile.local.yaml <<EOF
90+
prefix: "ci-${{ github.run_number }}"
91+
subscription: "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
92+
region: "North Central US"
93+
foundry_project_endpoint: "${{ secrets.FOUNDRY_PROJECT_ENDPOINT }}"
94+
EOF
95+
96+
- name: Run scenarios via MCP tool
97+
working-directory: ${{ env.SCENARIOS_DIR }}
98+
env:
99+
AZD_AGENTS_FIXTURES: ${{ github.workspace }}/${{ env.AZD_AGENTS_FIXTURES }}
100+
UV_HTTP_TIMEOUT: "300"
101+
run: |
102+
export PATH="${{ github.workspace }}/cli/azd:$PATH"
103+
# Drive all scenarios through cli-interactive-tester.
104+
# Each scenario is: load_scenario → run_pre_hooks → start_session
105+
# → [driver accomplishes goals] → finish_session → run_post_hooks
106+
#
107+
# TODO: confirm batch runner CLI exists. If not, need to implement
108+
# a wrapper that calls auto_test_tool internal APIs directly.
109+
python -m auto_test_tool.runner \
110+
--scenarios-dir . \
111+
--profile profile.yaml \
112+
--profile-local profile.local.yaml \
113+
--tier ${{ inputs.tier }} \
114+
--output results.json
115+
116+
- name: Upload results
117+
if: always()
118+
uses: actions/upload-artifact@v4
119+
with:
120+
name: e2e-results-tier-${{ inputs.tier }}
121+
path: |
122+
${{ env.SCENARIOS_DIR }}/results.json
123+
${{ env.SCENARIOS_DIR }}/reports/
124+
retention-days: 30
125+
126+
- name: Teardown (Tier 2 always cleanup)
127+
if: always() && contains(inputs.tier, '2')
128+
working-directory: ${{ env.SCENARIOS_DIR }}
129+
env:
130+
AZD_AGENTS_FIXTURES: ${{ github.workspace }}/${{ env.AZD_AGENTS_FIXTURES }}
131+
run: |
132+
export PATH="${{ github.workspace }}/cli/azd:$PATH"
133+
# Ensure Azure resources are cleaned up even on failure
134+
python -m auto_test_tool.runner \
135+
--scenarios-dir . \
136+
--scenario 2Z-teardown-down.yaml \
137+
--profile profile.yaml \
138+
--profile-local profile.local.yaml || true
139+
140+

0 commit comments

Comments
 (0)