Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(TFECO-8323) Port UI tests to vscode-extension-tester and remove wdio #1873

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
45 changes: 45 additions & 0 deletions .vscode-uitest.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { ExTester, ReleaseQuality } from 'vscode-extension-tester';

async function runTests() {
let code_version;
let code_type;

if (process.env.VSCODE_VERSION === 'insiders') {
code_type = ReleaseQuality.Insider;
} else if (process.env.VSCODE_VERSION === 'stable') {
code_type = ReleaseQuality.Stable;
} else {
code_version = process.env.VSCODE_VERSION;
}

if (code_type) {
console.log(`Running tests for ${code_version} ${code_type} version of VS Code`);
} else {
console.log(`Running tests for ${code_version} version of VS Code`);
}

process.env.HASHI_CODE_TEST = 'true';

const tester = new ExTester('.test-storage', code_type, '.test-extensions', false);
await tester.setupAndRunTests(
'out/test/e2e/specs/**/*.e2e.js',
code_version,
{
installDependencies: false,
},
{
settings: 'src/test/e2e/settings.json',
cleanup: true,
config: 'src/test/e2e/.mocharc.js',
logLevel: 'info',
resources: [],
},
);
}

runTests().catch(console.error);
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 @@ -17,6 +18,8 @@ META.d
.vscode-test.mjs
.vscodeignore
.wdio-vscode-service
.test-storage
.test-extensions
**/__mocks__
build/
DEVELOPMENT.md
Expand All @@ -28,3 +31,6 @@ out/
esbuild.mjs
eslint.config.mjs
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
Loading