Skip to content

Commit

Permalink
feat(template): python use binary test tool (#13098)
Browse files Browse the repository at this point in the history
* feat(template): python use binary test tool

* fix: yaml schema

* fix: yaml schema version

* fix: update yaml schema version in template
  • Loading branch information
tecton authored Jan 24, 2025
1 parent bc4d78c commit d99d3c3
Show file tree
Hide file tree
Showing 18 changed files with 231 additions and 137 deletions.
4 changes: 4 additions & 0 deletions packages/fx-core/resource/yaml-schema/v1.8/yaml.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1304,6 +1304,10 @@
"symlinkDir": {
"type": "string",
"description": "The path of the symlink target for the folder containing Teams App Test Tool binaries."
},
"releaseType": {
"type": "string",
"description": "The release type of Teams App Test Tool: binary or npm. Default to 'npm'."
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions packages/fx-core/resource/yaml-schema/yaml.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"type": "string",
"description": "The version of the yaml file schema",
"const": "v1.7"
"const": "v1.8"
},
"additionalMetadata": {
"type": "object",
Expand Down Expand Up @@ -1277,10 +1277,6 @@
"symlinkDir": {
"type": "string",
"description": "The path of the symlink target for the folder containing Azure Functions Core Tools binaries."
},
"releaseType": {
"type": "string",
"description": "The release type of Teams App Test Tool: binary or npm. Default to 'npm'."
}
}
},
Expand Down Expand Up @@ -1308,6 +1304,10 @@
"symlinkDir": {
"type": "string",
"description": "The path of the symlink target for the folder containing Teams App Test Tool binaries."
},
"releaseType": {
"type": "string",
"description": "The release type of Teams App Test Tool: binary or npm. Default to 'npm'."
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"request": "launch",
"url": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}",
"presentation": {
"group": "1-Teams",
"group": "2-Teams",
"order": 4
},
"internalConsoleOptions": "neverOpen"
Expand All @@ -18,7 +18,7 @@
"request": "launch",
"url": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}",
"presentation": {
"group": "1-Teams",
"group": "2-Teams",
"order": 5
},
"internalConsoleOptions": "neverOpen"
Expand All @@ -29,7 +29,7 @@
"request": "launch",
"preLaunchTask": "Start Teams App in Desktop Client (Remote)",
"presentation": {
"group": "1-Teams",
"group": "2-Teams",
"order": 6
},
"internalConsoleOptions": "neverOpen"
Expand Down Expand Up @@ -63,18 +63,6 @@
"program": "${workspaceFolder}/src/app.py",
"cwd": "${workspaceFolder}/src",
"console": "integratedTerminal"
},
{
"name": "Start Test Tool",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/devTools/teamsapptester/node_modules/@microsoft/teams-app-test-tool/cli.js",
"args": [
"start"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
{{#CEAEnabled}}
},
{
Expand Down Expand Up @@ -150,7 +138,7 @@
"cascadeTerminateToConfigurations": ["Start Python"],
"preLaunchTask": "Start Teams App Locally",
"presentation": {
"group": "1-Teams",
"group": "2-Teams",
"order": 1
},
"stopAll": true
Expand All @@ -161,7 +149,7 @@
"cascadeTerminateToConfigurations": ["Start Python"],
"preLaunchTask": "Start Teams App Locally",
"presentation": {
"group": "1-Teams",
"group": "2-Teams",
"order": 2
},
"stopAll": true
Expand All @@ -171,7 +159,7 @@
"configurations": ["Start Python"],
"preLaunchTask": "Start Teams App in Desktop Client",
"presentation": {
"group": "1-Teams",
"group": "2-Teams",
"order": 3
},
"stopAll": true
Expand All @@ -180,14 +168,10 @@
"name": "Debug in Test Tool",
"configurations": [
"Start Python",
"Start Test Tool"
],
"cascadeTerminateToConfigurations": [
"Start Test Tool"
],
"preLaunchTask": "Deploy (Test Tool)",
"preLaunchTask": "Test Tool",
"presentation": {
"group": "2-local",
"group": "1-local",
"order": 1
},
"stopAll": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Test Tool",
"dependsOn": ["Validate prerequisites (Test Tool)", "Deploy (Test Tool)", "Start Test Tool"],
"dependsOrder": "sequence",
"presentation": {
"reveal": "never"
},
},
{
// Check all required prerequisites.
// See https://aka.ms/teamsfx-tasks/check-prerequisites to know the details and how to customize the args.
Expand Down Expand Up @@ -34,6 +42,31 @@
"env": "testtool",
}
},
{
"label": "Start Test Tool",
"type": "shell",
"command": "${workspaceFolder}/devTools/teamsapptester/teamsapptester.exe",
"args": [
"start"
],
"isBackground": true,
"problemMatcher": {
"owner": "custom",
"pattern": {
"regexp": ".*InternalServiceError: (.*)",
"message": 1
},
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": ".*Teams App Test Tool"
},
"endsPattern": {
"regexp": ".*started web socket client"
}
},
}
},
{
"label": "Start Teams App Locally",
"dependsOn": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.7/yaml.schema.json
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.8/yaml.schema.json
# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file
# Visit https://aka.ms/teamsfx-actions for details on actions
version: v1.7
version: v1.8

deploy:
# Install development tool(s)
Expand All @@ -10,6 +10,7 @@ deploy:
testTool:
version: ~0.2.1
symlinkDir: ./devTools/teamsapptester
releaseType: binary

# Generate runtime environment variables
- uses: file/createOrUpdateEnvironmentFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"request": "launch",
"url": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}",
"presentation": {
"group": "1-Teams",
"group": "2-Teams",
"order": 4
},
"internalConsoleOptions": "neverOpen"
Expand All @@ -18,7 +18,7 @@
"request": "launch",
"url": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}",
"presentation": {
"group": "1-Teams",
"group": "2-Teams",
"order": 5
},
"internalConsoleOptions": "neverOpen"
Expand All @@ -29,7 +29,7 @@
"request": "launch",
"preLaunchTask": "Start Teams App in Desktop Client (Remote)",
"presentation": {
"group": "1-Teams",
"group": "2-Teams",
"order": 6
},
"internalConsoleOptions": "neverOpen"
Expand Down Expand Up @@ -63,18 +63,6 @@
"program": "${workspaceFolder}/src/app.py",
"cwd": "${workspaceFolder}/src",
"console": "integratedTerminal"
},
{
"name": "Start Test Tool",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/devTools/teamsapptester/node_modules/@microsoft/teams-app-test-tool/cli.js",
"args": [
"start"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
{{#CEAEnabled}}
},
{
Expand Down Expand Up @@ -150,7 +138,7 @@
"cascadeTerminateToConfigurations": ["Start Python"],
"preLaunchTask": "Start Teams App Locally",
"presentation": {
"group": "1-Teams",
"group": "2-Teams",
"order": 1
},
"stopAll": true
Expand All @@ -161,7 +149,7 @@
"cascadeTerminateToConfigurations": ["Start Python"],
"preLaunchTask": "Start Teams App Locally",
"presentation": {
"group": "1-Teams",
"group": "2-Teams",
"order": 2
},
"stopAll": true
Expand All @@ -171,7 +159,7 @@
"configurations": ["Start Python"],
"preLaunchTask": "Start Teams App in Desktop Client",
"presentation": {
"group": "1-Teams",
"group": "2-Teams",
"order": 3
},
"stopAll": true
Expand All @@ -180,14 +168,10 @@
"name": "Debug in Test Tool",
"configurations": [
"Start Python",
"Start Test Tool"
],
"cascadeTerminateToConfigurations": [
"Start Test Tool"
],
"preLaunchTask": "Deploy (Test Tool)",
"preLaunchTask": "Test Tool",
"presentation": {
"group": "2-local",
"group": "1-local",
"order": 1
},
"stopAll": true
Expand Down
33 changes: 33 additions & 0 deletions templates/python/custom-copilot-assistant-new/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Test Tool",
"dependsOn": ["Validate prerequisites (Test Tool)", "Deploy (Test Tool)", "Start Test Tool"],
"dependsOrder": "sequence",
"presentation": {
"reveal": "never"
},
},
{
// Check all required prerequisites.
// See https://aka.ms/teamsfx-tasks/check-prerequisites to know the details and how to customize the args.
Expand Down Expand Up @@ -34,6 +42,31 @@
"env": "testtool",
}
},
{
"label": "Start Test Tool",
"type": "shell",
"command": "${workspaceFolder}/devTools/teamsapptester/teamsapptester.exe",
"args": [
"start"
],
"isBackground": true,
"problemMatcher": {
"owner": "custom",
"pattern": {
"regexp": ".*InternalServiceError: (.*)",
"message": 1
},
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": ".*Teams App Test Tool"
},
"endsPattern": {
"regexp": ".*started web socket client"
}
},
}
},
{
"label": "Start Teams App Locally",
"dependsOn": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.7/yaml.schema.json
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.8/yaml.schema.json
# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file
# Visit https://aka.ms/teamsfx-actions for details on actions
version: v1.7
version: v1.8

deploy:
# Install development tool(s)
Expand All @@ -10,6 +10,7 @@ deploy:
testTool:
version: ~0.2.1
symlinkDir: ./devTools/teamsapptester
releaseType: binary

# Generate runtime environment variables
- uses: file/createOrUpdateEnvironmentFile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.7/yaml.schema.json
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.8/yaml.schema.json
# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file
# Visit https://aka.ms/teamsfx-actions for details on actions
version: v1.7
version: v1.8

deploy:
# Install development tool(s)
Expand Down
Loading

0 comments on commit d99d3c3

Please sign in to comment.