Skip to content

Commit 95d5dc3

Browse files
authored
test: only run automated test cases for scheduled runs (#14218)
1 parent 30031f7 commit 95d5dc3

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.github/workflows/ui-test-vscuse.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,24 @@ jobs:
166166
subscription-id: ${{secrets.DEVOPS_SUB_ID}}
167167
enable-AzPSSession: true
168168

169+
- name: Fetch test cases from Azure DevOps for scheduled runs
170+
if: ${{ github.event.schedule == '0 17 * * *' }}
171+
working-directory: packages/tests
172+
env:
173+
AZURE_DEVOPS_ORG_URL: "https://dev.azure.com/msazure/"
174+
AZURE_DEVOPS_PROJECT: "Microsoft Teams Extensibility"
175+
AZURE_DEVOPS_TEST_PLAN_ID: "33256964"
176+
run: npx ts-node ./scripts/fetch-test-plan-test-cases.ts vscuse/agent_cases true
177+
169178
- name: Fetch test cases from Azure DevOps
179+
if: ${{ github.event_name == 'workflow_dispatch' }}
170180
working-directory: packages/tests
171181
env:
172182
AZURE_DEVOPS_ORG_URL: "https://dev.azure.com/msazure/"
173183
AZURE_DEVOPS_PROJECT: "Microsoft Teams Extensibility"
174184
AZURE_DEVOPS_TEST_PLAN_ID: "33256964"
175185
run: npx ts-node ./scripts/fetch-test-plan-test-cases.ts vscuse/agent_cases
176186

177-
178187
- name: Generate file list
179188
shell: pwsh
180189
run: |

packages/tests/scripts/fetch-test-plan-test-cases.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as fs from "fs";
66
import * as path from "path";
77

88
const outputDir = process.argv[2];
9+
const onlyTestAutomatedCases = process.argv[3];
910
if (!outputDir) {
1011
console.error("Please provide an output directory as the first argument.");
1112
process.exit(1);
@@ -83,6 +84,19 @@ async function run() {
8384
};
8485
const workItem = (await response.json()) as WorkItem;
8586

87+
// Get the automation status of the work item
88+
// If onlyTestAutomatedCases is true, skip test cases that are not automated
89+
const automationStatus =
90+
workItem.fields?.["Microsoft.VSTS.TCM.AutomationStatus"];
91+
if (onlyTestAutomatedCases && onlyTestAutomatedCases === "true") {
92+
if (automationStatus !== "Planned") {
93+
console.log(
94+
`Skipping test case ${tc.testCase.id} as it is not automated.`
95+
);
96+
continue; // Skip non-automated test cases
97+
}
98+
}
99+
86100
// The content fianlly to write into the file
87101
const outputLines: string[] = [];
88102

0 commit comments

Comments
 (0)