Skip to content

Commit

Permalink
Port UI tests to vscode-extension-tester and remove wdio
Browse files Browse the repository at this point in the history
This installs the redhat extension tester and removes the wdio test runner and its dependencies from the project. This allows us to test treeviews, which is what the HCP integration uses, locally and in CI in a reliable manner.

This is large port of existing UI tests to a new API, this required a new way to run the tests so a script that runs the tests has been created.

This also fixes the issue with the `test.yml` file where the `VSCODE_VERSION` was not being set correctly. This was causing the tests to not actually run with different versions of VSCode.
  • Loading branch information
jpogran committed Nov 14, 2024
1 parent 2a9af6f commit a313c46
Show file tree
Hide file tree
Showing 34 changed files with 3,779 additions and 16,828 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/INTERNAL-20241105-111825.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: INTERNAL
body: Port UI tests to vscode-extension-tester and remove wdio
time: 2024-11-05T11:18:25.988501-05:00
custom:
Issue: "1873"
Repository: vscode-terraform
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
- ubuntu-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 10
env:
VSCODE_VERSION: ${{ matrix.vscode }}
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -72,3 +74,9 @@ jobs:
- name: Run Tests
run: npm test
if: runner.os != 'Linux'
- name: Run UI Tests
run: xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' npm run test:ui
if: runner.os == 'Linux'
- name: Run UI Tests
run: npm run test:ui
if: runner.os != 'Linux'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
.terraform
.vscode-test
.vscode-test-web
.wdio-vscode-service
.test-storage
.test-extensions
*.vsix
bin
node_modules
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.vscode-test
.vscode-test-web
.wdio-vscode-service
.test-storage
.test-extensions
language-configuration.json
node_modules
dist
Expand Down
6 changes: 6 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.mocharc.js
.changes
.changie.yaml
.copywrite.hcl
Expand All @@ -16,6 +17,8 @@
.vscode-test.mjs
.vscodeignore
.wdio-vscode-service
.test-storage
.test-extensions
**/__mocks__
build/
DEVELOPMENT.md
Expand All @@ -26,3 +29,6 @@ src/
out/
esbuild.js
tsconfig.json
esbuild.mjs
eslint.config.mjs
uitest.mjs
9 changes: 6 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ export default [
semi: 'warn',
'@typescript-eslint/no-explicit-any': ['warn', { ignoreRestArgs: true }],
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/restrict-template-expressions': [
'error',
{
Expand All @@ -64,6 +65,8 @@ export default [
ignores: [
'.vscode-test',
'.wdio-vscode-service',
'.test-storage',
'.test-extensions',
'dist',
'out',
'src/test',
Expand Down
Loading

0 comments on commit a313c46

Please sign in to comment.