Skip to content

Commit 28c43a0

Browse files
authored
More shell tests (#653)
1 parent 313cf3e commit 28c43a0

File tree

8 files changed

+259
-214
lines changed

8 files changed

+259
-214
lines changed

.github/workflows/build-ts.yml

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ jobs:
6666
working-directory: ts
6767
run: |
6868
pnpm install --frozen-lockfile --strict-peer-dependencies
69-
# - name: Install Playwright Browsers
70-
# if: ${{ runner.os == 'windows' && matrix.version == '22' }}
71-
# run: pnpm exec playwright install --with-deps
72-
# working-directory: ts/packages/shell
7369
- name: Build
7470
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
7571
working-directory: ts
@@ -85,43 +81,3 @@ jobs:
8581
working-directory: ts
8682
run: |
8783
npm run lint
88-
# - name: Login to Azure
89-
# if: ${{ github.event_name != 'merge_group' }}
90-
# uses: azure/[email protected]
91-
# with:
92-
# client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_5B0D2D6BA40F4710B45721D2112356DD }}
93-
# tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_39BB903136F14B6EAD8F53A8AB78E3AA }}
94-
# subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_F36C1F2C4B2C49CA8DD5C52FAB98FA30 }}
95-
# - name: Get Keys
96-
# if: ${{ github.event_name != 'merge_group' }}
97-
# run: |
98-
# node tools/scripts/getKeys.mjs --vault build-pipeline-kv
99-
# working-directory: ts
100-
# - name: Test CLI - smoke
101-
# if: ${{ github.event_name != 'merge_group' }}
102-
# run: |
103-
# npm run start:dev 'prompt' 'why is the sky blue'
104-
# working-directory: ts/packages/cli
105-
# continue-on-error: true
106-
# - name: Shell Tests - smoke (windows)
107-
# if: ${{ github.event_name != 'merge_group' && runner.os == 'windows' && matrix.version == '22' }}
108-
# timeout-minutes: 60
109-
# run: |
110-
# npx playwright test simple.spec.ts
111-
# rm ../../.env
112-
# - name: Shell Tests - smoke (linux)
113-
# if: ${{ github.event_name != 'merge_group' && runner.os == 'Linux' && matrix.version == '22' }}
114-
# timeout-minutes: 60
115-
# run: |
116-
# Xvfb :99 -screen 0 1600x1200x24 & export DISPLAY=:99
117-
# npx playwright test simple.spec.ts
118-
# rm ../../.env
119-
# working-directory: ts/packages/shell
120-
# continue-on-error: true
121-
# - name: Live Tests
122-
# if: ${{ github.event_name != 'merge_group' && runner.os == 'linux' && matrix.version == '22' }}
123-
# timeout-minutes: 60
124-
# run: |
125-
# npm run test:live
126-
# working-directory: ts
127-
# continue-on-error: true

.github/workflows/shell-tests.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
strategy:
2929
fail-fast: false
3030
matrix:
31-
os: ["windows-latest"]
31+
os: ["windows-latest", "ubuntu-latest"]
3232
version: [20]
3333

3434
runs-on: ${{ matrix.os }}
@@ -98,19 +98,15 @@ jobs:
9898
timeout-minutes: 60
9999
run: |
100100
npm run shell:test
101-
rm ../../.env
102101
working-directory: ts/packages/shell
103102
continue-on-error: true
104103

105104
- name: Shell Tests (linux)
106105
if: ${{ runner.os == 'Linux' }}
107106
timeout-minutes: 60
108-
# https://github.com/microsoft/playwright/issues/34251 - sysctl command
109107
run: |
110-
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
111108
Xvfb :99 -screen 0 1600x1200x24 & export DISPLAY=:99
112109
npm run shell:test
113-
rm ../../.env
114110
working-directory: ts/packages/shell
115111
continue-on-error: true
116112

@@ -129,3 +125,9 @@ jobs:
129125
path: ts/packages/shell/playwright-report/
130126
overwrite: true
131127
retention-days: 30
128+
129+
- name: Clean up Keys
130+
run: |
131+
rm ./.env
132+
working-directory: ts
133+
if: always()

.github/workflows/smoke-tests-pull_request_targets.yml.bak

Lines changed: 0 additions & 121 deletions
This file was deleted.

.github/workflows/smoke-tests.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ on:
99
workflow_dispatch:
1010
push:
1111
branches: ["main"]
12-
# pull_request:
13-
# branches: ["main"]
1412
pull_request_target:
1513
branches: ["main"]
1614
merge_group:
@@ -27,7 +25,9 @@ permissions:
2725

2826
env:
2927
NODE_OPTIONS: --max_old_space_size=8192
30-
DEBUG: pw:browser*
28+
# DEBUG: pw:browser* # PlayWright debug messages
29+
# ELECTRON_ENABLE_LOGGING: true # Electron debug messages
30+
# DEBUG: typeagent:* # TypeAgent debug messages
3131

3232
jobs:
3333
shell_and_cli:
@@ -37,7 +37,6 @@ jobs:
3737
fail-fast: false
3838
matrix:
3939
os: ["ubuntu-latest", "windows-latest"]
40-
#os: ["ubuntu-latest"]
4140
version: [20]
4241

4342
runs-on: ${{ matrix.os }}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
import test, {
5+
ElectronApplication,
6+
Page,
7+
_electron,
8+
_electron as electron,
9+
expect,
10+
} from "@playwright/test";
11+
import {
12+
exitApplication,
13+
getAppPath,
14+
sendUserRequestAndWaitForCompletion,
15+
getLaunchArgs,
16+
startShell,
17+
testUserRequest,
18+
} from "./testHelper";
19+
20+
// Annotate entire file as serial.
21+
test.describe.configure({ mode: "serial" });
22+
23+
test.describe("List Agent Tests", () => {
24+
test("create_update_clear_list", async ({}, testInfo) => {
25+
console.log(`Running test '${testInfo.title}`);
26+
27+
await testUserRequest(
28+
[
29+
"create a shopping list",
30+
"what's on the shopping list?",
31+
"add eggs, milk, flour to the shopping list",
32+
"what's on the shopping list?",
33+
"remove milk from the shopping list",
34+
"what's on the shopping list?",
35+
"clear the shopping list",
36+
"what's on the shopping list?",
37+
],
38+
[
39+
"Created list: shopping",
40+
"List 'shopping' is empty",
41+
"Added items: eggs,milk,flour to list shopping",
42+
"eggs\nmilk\nflour",
43+
"Removed items: milk from list shopping",
44+
"eggs\nflour",
45+
"Cleared list: shopping",
46+
"List 'shopping' is empty",
47+
],
48+
);
49+
});
50+
51+
// test("delete_list", async ({}, testInfo) => {
52+
// console.log(`Running test '${testInfo.title}`);
53+
54+
// await testUserRequest(
55+
// [
56+
// "delete the shopping list",
57+
// "is there a shopping list?"
58+
// ],
59+
// [
60+
// "Cleared list: shopping",
61+
// "List 'shopping' is empty"
62+
// ]);
63+
// });
64+
});

0 commit comments

Comments
 (0)