Skip to content

Commit d99d3c3

Browse files
authored
feat(template): python use binary test tool (#13098)
* feat(template): python use binary test tool * fix: yaml schema * fix: yaml schema version * fix: update yaml schema version in template
1 parent bc4d78c commit d99d3c3

File tree

18 files changed

+231
-137
lines changed

18 files changed

+231
-137
lines changed

packages/fx-core/resource/yaml-schema/v1.8/yaml.schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,10 @@
13041304
"symlinkDir": {
13051305
"type": "string",
13061306
"description": "The path of the symlink target for the folder containing Teams App Test Tool binaries."
1307+
},
1308+
"releaseType": {
1309+
"type": "string",
1310+
"description": "The release type of Teams App Test Tool: binary or npm. Default to 'npm'."
13071311
}
13081312
}
13091313
}

packages/fx-core/resource/yaml-schema/yaml.schema.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"type": "string",
1616
"description": "The version of the yaml file schema",
17-
"const": "v1.7"
17+
"const": "v1.8"
1818
},
1919
"additionalMetadata": {
2020
"type": "object",
@@ -1277,10 +1277,6 @@
12771277
"symlinkDir": {
12781278
"type": "string",
12791279
"description": "The path of the symlink target for the folder containing Azure Functions Core Tools binaries."
1280-
},
1281-
"releaseType": {
1282-
"type": "string",
1283-
"description": "The release type of Teams App Test Tool: binary or npm. Default to 'npm'."
12841280
}
12851281
}
12861282
},
@@ -1308,6 +1304,10 @@
13081304
"symlinkDir": {
13091305
"type": "string",
13101306
"description": "The path of the symlink target for the folder containing Teams App Test Tool binaries."
1307+
},
1308+
"releaseType": {
1309+
"type": "string",
1310+
"description": "The release type of Teams App Test Tool: binary or npm. Default to 'npm'."
13111311
}
13121312
}
13131313
}

templates/python/custom-copilot-assistant-assistants-api/.vscode/launch.json.tpl

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"request": "launch",
88
"url": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}",
99
"presentation": {
10-
"group": "1-Teams",
10+
"group": "2-Teams",
1111
"order": 4
1212
},
1313
"internalConsoleOptions": "neverOpen"
@@ -18,7 +18,7 @@
1818
"request": "launch",
1919
"url": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}",
2020
"presentation": {
21-
"group": "1-Teams",
21+
"group": "2-Teams",
2222
"order": 5
2323
},
2424
"internalConsoleOptions": "neverOpen"
@@ -29,7 +29,7 @@
2929
"request": "launch",
3030
"preLaunchTask": "Start Teams App in Desktop Client (Remote)",
3131
"presentation": {
32-
"group": "1-Teams",
32+
"group": "2-Teams",
3333
"order": 6
3434
},
3535
"internalConsoleOptions": "neverOpen"
@@ -63,18 +63,6 @@
6363
"program": "${workspaceFolder}/src/app.py",
6464
"cwd": "${workspaceFolder}/src",
6565
"console": "integratedTerminal"
66-
},
67-
{
68-
"name": "Start Test Tool",
69-
"type": "node",
70-
"request": "launch",
71-
"program": "${workspaceFolder}/devTools/teamsapptester/node_modules/@microsoft/teams-app-test-tool/cli.js",
72-
"args": [
73-
"start"
74-
],
75-
"cwd": "${workspaceFolder}",
76-
"console": "integratedTerminal",
77-
"internalConsoleOptions": "neverOpen"
7866
{{#CEAEnabled}}
7967
},
8068
{
@@ -150,7 +138,7 @@
150138
"cascadeTerminateToConfigurations": ["Start Python"],
151139
"preLaunchTask": "Start Teams App Locally",
152140
"presentation": {
153-
"group": "1-Teams",
141+
"group": "2-Teams",
154142
"order": 1
155143
},
156144
"stopAll": true
@@ -161,7 +149,7 @@
161149
"cascadeTerminateToConfigurations": ["Start Python"],
162150
"preLaunchTask": "Start Teams App Locally",
163151
"presentation": {
164-
"group": "1-Teams",
152+
"group": "2-Teams",
165153
"order": 2
166154
},
167155
"stopAll": true
@@ -171,7 +159,7 @@
171159
"configurations": ["Start Python"],
172160
"preLaunchTask": "Start Teams App in Desktop Client",
173161
"presentation": {
174-
"group": "1-Teams",
162+
"group": "2-Teams",
175163
"order": 3
176164
},
177165
"stopAll": true
@@ -180,14 +168,10 @@
180168
"name": "Debug in Test Tool",
181169
"configurations": [
182170
"Start Python",
183-
"Start Test Tool"
184-
],
185-
"cascadeTerminateToConfigurations": [
186-
"Start Test Tool"
187171
],
188-
"preLaunchTask": "Deploy (Test Tool)",
172+
"preLaunchTask": "Test Tool",
189173
"presentation": {
190-
"group": "2-local",
174+
"group": "1-local",
191175
"order": 1
192176
},
193177
"stopAll": true

templates/python/custom-copilot-assistant-assistants-api/.vscode/tasks.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
{
55
"version": "2.0.0",
66
"tasks": [
7+
{
8+
"label": "Test Tool",
9+
"dependsOn": ["Validate prerequisites (Test Tool)", "Deploy (Test Tool)", "Start Test Tool"],
10+
"dependsOrder": "sequence",
11+
"presentation": {
12+
"reveal": "never"
13+
},
14+
},
715
{
816
// Check all required prerequisites.
917
// See https://aka.ms/teamsfx-tasks/check-prerequisites to know the details and how to customize the args.
@@ -34,6 +42,31 @@
3442
"env": "testtool",
3543
}
3644
},
45+
{
46+
"label": "Start Test Tool",
47+
"type": "shell",
48+
"command": "${workspaceFolder}/devTools/teamsapptester/teamsapptester.exe",
49+
"args": [
50+
"start"
51+
],
52+
"isBackground": true,
53+
"problemMatcher": {
54+
"owner": "custom",
55+
"pattern": {
56+
"regexp": ".*InternalServiceError: (.*)",
57+
"message": 1
58+
},
59+
"background": {
60+
"activeOnStart": true,
61+
"beginsPattern": {
62+
"regexp": ".*Teams App Test Tool"
63+
},
64+
"endsPattern": {
65+
"regexp": ".*started web socket client"
66+
}
67+
},
68+
}
69+
},
3770
{
3871
"label": "Start Teams App Locally",
3972
"dependsOn": [

templates/python/custom-copilot-assistant-assistants-api/teamsapp.testtool.yml.tpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.7/yaml.schema.json
1+
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.8/yaml.schema.json
22
# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file
33
# Visit https://aka.ms/teamsfx-actions for details on actions
4-
version: v1.7
4+
version: v1.8
55

66
deploy:
77
# Install development tool(s)
@@ -10,6 +10,7 @@ deploy:
1010
testTool:
1111
version: ~0.2.1
1212
symlinkDir: ./devTools/teamsapptester
13+
releaseType: binary
1314

1415
# Generate runtime environment variables
1516
- uses: file/createOrUpdateEnvironmentFile

templates/python/custom-copilot-assistant-new/.vscode/launch.json.tpl

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"request": "launch",
88
"url": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}",
99
"presentation": {
10-
"group": "1-Teams",
10+
"group": "2-Teams",
1111
"order": 4
1212
},
1313
"internalConsoleOptions": "neverOpen"
@@ -18,7 +18,7 @@
1818
"request": "launch",
1919
"url": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}",
2020
"presentation": {
21-
"group": "1-Teams",
21+
"group": "2-Teams",
2222
"order": 5
2323
},
2424
"internalConsoleOptions": "neverOpen"
@@ -29,7 +29,7 @@
2929
"request": "launch",
3030
"preLaunchTask": "Start Teams App in Desktop Client (Remote)",
3131
"presentation": {
32-
"group": "1-Teams",
32+
"group": "2-Teams",
3333
"order": 6
3434
},
3535
"internalConsoleOptions": "neverOpen"
@@ -63,18 +63,6 @@
6363
"program": "${workspaceFolder}/src/app.py",
6464
"cwd": "${workspaceFolder}/src",
6565
"console": "integratedTerminal"
66-
},
67-
{
68-
"name": "Start Test Tool",
69-
"type": "node",
70-
"request": "launch",
71-
"program": "${workspaceFolder}/devTools/teamsapptester/node_modules/@microsoft/teams-app-test-tool/cli.js",
72-
"args": [
73-
"start"
74-
],
75-
"cwd": "${workspaceFolder}",
76-
"console": "integratedTerminal",
77-
"internalConsoleOptions": "neverOpen"
7866
{{#CEAEnabled}}
7967
},
8068
{
@@ -150,7 +138,7 @@
150138
"cascadeTerminateToConfigurations": ["Start Python"],
151139
"preLaunchTask": "Start Teams App Locally",
152140
"presentation": {
153-
"group": "1-Teams",
141+
"group": "2-Teams",
154142
"order": 1
155143
},
156144
"stopAll": true
@@ -161,7 +149,7 @@
161149
"cascadeTerminateToConfigurations": ["Start Python"],
162150
"preLaunchTask": "Start Teams App Locally",
163151
"presentation": {
164-
"group": "1-Teams",
152+
"group": "2-Teams",
165153
"order": 2
166154
},
167155
"stopAll": true
@@ -171,7 +159,7 @@
171159
"configurations": ["Start Python"],
172160
"preLaunchTask": "Start Teams App in Desktop Client",
173161
"presentation": {
174-
"group": "1-Teams",
162+
"group": "2-Teams",
175163
"order": 3
176164
},
177165
"stopAll": true
@@ -180,14 +168,10 @@
180168
"name": "Debug in Test Tool",
181169
"configurations": [
182170
"Start Python",
183-
"Start Test Tool"
184-
],
185-
"cascadeTerminateToConfigurations": [
186-
"Start Test Tool"
187171
],
188-
"preLaunchTask": "Deploy (Test Tool)",
172+
"preLaunchTask": "Test Tool",
189173
"presentation": {
190-
"group": "2-local",
174+
"group": "1-local",
191175
"order": 1
192176
},
193177
"stopAll": true

templates/python/custom-copilot-assistant-new/.vscode/tasks.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
{
55
"version": "2.0.0",
66
"tasks": [
7+
{
8+
"label": "Test Tool",
9+
"dependsOn": ["Validate prerequisites (Test Tool)", "Deploy (Test Tool)", "Start Test Tool"],
10+
"dependsOrder": "sequence",
11+
"presentation": {
12+
"reveal": "never"
13+
},
14+
},
715
{
816
// Check all required prerequisites.
917
// See https://aka.ms/teamsfx-tasks/check-prerequisites to know the details and how to customize the args.
@@ -34,6 +42,31 @@
3442
"env": "testtool",
3543
}
3644
},
45+
{
46+
"label": "Start Test Tool",
47+
"type": "shell",
48+
"command": "${workspaceFolder}/devTools/teamsapptester/teamsapptester.exe",
49+
"args": [
50+
"start"
51+
],
52+
"isBackground": true,
53+
"problemMatcher": {
54+
"owner": "custom",
55+
"pattern": {
56+
"regexp": ".*InternalServiceError: (.*)",
57+
"message": 1
58+
},
59+
"background": {
60+
"activeOnStart": true,
61+
"beginsPattern": {
62+
"regexp": ".*Teams App Test Tool"
63+
},
64+
"endsPattern": {
65+
"regexp": ".*started web socket client"
66+
}
67+
},
68+
}
69+
},
3770
{
3871
"label": "Start Teams App Locally",
3972
"dependsOn": [

templates/python/custom-copilot-assistant-new/teamsapp.testtool.yml.tpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.7/yaml.schema.json
1+
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.8/yaml.schema.json
22
# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file
33
# Visit https://aka.ms/teamsfx-actions for details on actions
4-
version: v1.7
4+
version: v1.8
55

66
deploy:
77
# Install development tool(s)
@@ -10,6 +10,7 @@ deploy:
1010
testTool:
1111
version: ~0.2.1
1212
symlinkDir: ./devTools/teamsapptester
13+
releaseType: binary
1314

1415
# Generate runtime environment variables
1516
- uses: file/createOrUpdateEnvironmentFile

templates/python/custom-copilot-basic/teamsapp.testtool.yml.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.7/yaml.schema.json
1+
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.8/yaml.schema.json
22
# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file
33
# Visit https://aka.ms/teamsfx-actions for details on actions
4-
version: v1.7
4+
version: v1.8
55

66
deploy:
77
# Install development tool(s)

0 commit comments

Comments
 (0)