Skip to content

Commit f965ae2

Browse files
authored
fix: template e2e cases part 2 (#14575)
* fix(e2e): permission test * fix: m365 title id check * fix: add message extension test * refactor: e2e cases * fix: multi env test * refactor: clean codes * fix: update e2e workflow * fix: script * fix: bug * fix: setup bug * fix: sample env setup
1 parent acc0210 commit f965ae2

37 files changed

+492
-871
lines changed

.github/actions/setup-project/action.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ inputs:
55
description: 'setup project'
66
required: true
77
default: 'true'
8+
range: # id of input
9+
description: 'package range to install (vscode, cli, e2e, all)'
10+
required: false
11+
default: 'all'
12+
813
runs:
914
using: "composite"
1015
steps:
@@ -22,4 +27,17 @@ runs:
2227
timeout_minutes: 10
2328
max_attempts: 5
2429
command: |
25-
npm run setup
30+
case "${{ inputs.range }}" in
31+
"cli")
32+
npm run setup:cli
33+
;;
34+
"vscode")
35+
npm run setup:vsc
36+
;;
37+
"e2e")
38+
npm run setup:e2e
39+
;;
40+
"all"|*)
41+
npm run setup
42+
;;
43+
esac

.github/workflows/e2e-test.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ jobs:
7878

7979
- name: setup project
8080
uses: ./.github/actions/setup-project
81+
with:
82+
range: "e2e"
8183

8284
- name: List cases for schedule or pull request
8385
id: schedule-cases
@@ -87,7 +89,6 @@ jobs:
8789
cases=`find . -wholename "*.tests.ts" | jq -Rsc '[split("\n") | .[]| select(.!="")]'`
8890
echo "cases=$cases" >> $GITHUB_OUTPUT
8991
90-
9192
- name: List cases for pull request
9293
id: pr-cases
9394
if: ${{ github.event_name == 'pull_request' }}
@@ -189,19 +190,15 @@ jobs:
189190
with:
190191
node-version: 22
191192

192-
- name: Setup node for SPFx project
193-
if: contains(matrix.cases, 'SPFx')
194-
uses: actions/setup-node@v3
195-
with:
196-
node-version: 22
197-
198193
- name: Setup node for Retail project
199194
if: contains(matrix.cases, 'Retail')
200195
uses: actions/setup-node@v3
201196
with:
202197
node-version: 18
203198

199+
# Azure Function is not used in templates now
204200
- name: Setup Azure Functions Core Tools For Linux
201+
if: contains(matrix.cases, 'samples')
205202
run: |
206203
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
207204
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
@@ -220,10 +217,11 @@ jobs:
220217
uses: actions/setup-dotnet@v3
221218
with:
222219
dotnet-version: |
223-
6.0.x
224220
8.0.x
225221
222+
# Python is not used in templates now
226223
- name: Setup Python
224+
if: contains(matrix.cases, 'samples')
227225
uses: actions/setup-python@v5
228226
with:
229227
python-version: '3.11'
@@ -232,7 +230,7 @@ jobs:
232230

233231
- name: Setup project
234232
run: |
235-
npm run setup
233+
npm run setup:e2e
236234
237235
- name: install cli with specific version
238236
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.cli-version != '' }}

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"main": "index.js",
66
"scripts": {
77
"setup": "pnpm install && npm run build",
8+
"setup:e2e": "pnpm install && pnpm --filter templates --filter @microsoft/teamsfx-test... build",
9+
"setup:cli": "pnpm install && pnpm --filter templates --filter @microsoft/m365agentstoolkit-cli... build",
10+
"setup:vsc": "pnpm install && pnpm --filter templates --filter ms-teams-vscode-extension... build",
811
"watch": "pnpm --parallel -r run watch",
912
"build": "pnpm -r run build",
1013
"precommit": "lint-staged",

packages/tests/src/e2e/m365/ProvisionApiSpecMessageExtension.tests.ts renamed to packages/tests/src/e2e/archive/ProvisionApiSpecMessageExtension.tests.bak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* @author Yuqi Zhou <[email protected]>
66
*/
77

8-
import { describe } from "mocha";
98
import * as chai from "chai";
9+
import { describe } from "mocha";
1010
import * as path from "path";
1111

1212
import { it } from "@microsoft/extra-shot-mocha";

packages/tests/src/e2e/debug/DebugCustomCopilotAgentAssistantsApiBotForPython.tests.ts renamed to packages/tests/src/e2e/archive/teamsAgent/DebugCustomCopilotAgentAssistantsApiBotForPython.tests.bak

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ import * as path from "path";
1212

1313
import { it } from "@microsoft/extra-shot-mocha";
1414

15-
import { CliHelper } from "../../commonlib/cliHelper";
15+
import { CliHelper } from "../../../commonlib/cliHelper";
16+
import { execAsync } from "../../../utils/commonUtils";
1617
import {
1718
cleanUpLocalProject,
1819
getTestFolder,
1920
getUniqueAppName,
2021
readContextMultiEnvV3,
21-
} from "../commonUtils";
22+
} from "../../commonUtils";
2223
import {
2324
deleteAadAppByClientId,
2425
deleteBot,
2526
deleteTeamsApp,
2627
getAadAppByClientId,
2728
getBot,
2829
getTeamsApp,
29-
} from "./utility";
30-
import { execAsync } from "../../utils/commonUtils";
30+
} from "../../debug/utility";
3131

3232
describe("Debug V3 command-and-response template", () => {
3333
const testFolder = getTestFolder();

0 commit comments

Comments
 (0)