Skip to content

Commit 8d166f4

Browse files
committed
chore(vscode): add e2e test
1 parent 8b218a5 commit 8d166f4

File tree

3 files changed

+44
-10
lines changed

3 files changed

+44
-10
lines changed

.github/workflows/pr.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- main
5+
concurrency:
6+
group: 'pr-${{ github.event.pull_request.number }}'
7+
cancel-in-progress: true
8+
jobs:
9+
test-vscode-e2e:
10+
env:
11+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
12+
runs-on: macos-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.12'
18+
- name: Install Python dependencies
19+
run: make install-dev
20+
- uses: actions/setup-node@v3
21+
with:
22+
node-version: '20'
23+
- uses: pnpm/action-setup@v2
24+
with:
25+
version: latest
26+
- name: Install dependencies
27+
run: pnpm install
28+
- name: Run CI
29+
run: pnpm run ci
30+
- name: Fetch VSCode
31+
working-directory: vscode/extension
32+
run: pnpm run fetch-vscode
33+
- name: Run E2E tests
34+
working-directory: vscode/extension
35+
run: pnpm run test:e2e --max-failures 1
36+
- name: Upload test videos
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: test-videos
40+
path: vscode/extension/test-videos/

vscode/extension/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ out
55
*.vsix
66
LICENSE
77
src_react
8-
!src_react/.gitkeep
8+
!src_react/.gitkeep
9+
test-videos

vscode/extension/tests/utils.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,7 @@ export const startVSCode = async (
3333
const userDataDir = await fs.mkdtemp(
3434
path.join(os.tmpdir(), 'vscode-user-data-'),
3535
)
36-
const ciArgs = process.env.CI
37-
? [
38-
'--disable-gpu',
39-
'--headless',
40-
'--no-sandbox',
41-
'--disable-dev-shm-usage',
42-
'--window-position=-10000,0',
43-
]
44-
: []
36+
const ciArgs = process.env.CI ? ['--window-position=-10000,0'] : []
4537
const args = [
4638
...ciArgs,
4739
`--extensionDevelopmentPath=${EXT_PATH}`,
@@ -54,6 +46,7 @@ export const startVSCode = async (
5446
const electronApp = await electron.launch({
5547
executablePath: VS_CODE_EXE,
5648
args,
49+
recordVideo: { dir: 'test-videos' },
5750
})
5851
const window = await electronApp.firstWindow()
5952
await window.waitForLoadState('domcontentloaded')

0 commit comments

Comments
 (0)