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

Conversation

jpogran
Copy link
Contributor

@jpogran jpogran commented Nov 4, 2024

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 and it required a new way to run the tests. So a script that runs the tests has been created that will run the tests in a headless mode when running in CI and in a windowed mode when running locally. This is to ensure that the tests can be run in a reliable manner in both environments. It also mocks the HCP API so that the tests can be run without needing to have a connection to HCP infrastructure.

A bug in the login workflow was found during this effort. After successfully authenticing, the organization picker was left open and could not be closed. This was fixed by disposing the organization picker after successfully authenticating.

Since the primary focus was on the HCP treeview tests (most likely to break when changing this area), the Terraform treeview tests (which have much simpler functionality) were not updated and left for a future PR.

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.

A minor addition to the eslint ruleset to allow for the use of unsafe access or any in the codebase where it is needed, specifically in places where we interact with libraries that are not typed or where we need to access properties that are not typed.

@jpogran jpogran self-assigned this Nov 4, 2024
@jpogran jpogran force-pushed the redhat-ext-tester branch 3 times, most recently from 5533551 to 6bc8e54 Compare November 5, 2024 16:22
@jpogran jpogran force-pushed the redhat-ext-tester branch 10 times, most recently from 04c7403 to 3a4abcb Compare November 14, 2024 16:06
@jpogran jpogran changed the title redhat ext tester Port UI tests to vscode-extension-tester and remove wdio Nov 14, 2024
@jpogran jpogran force-pushed the redhat-ext-tester branch 4 times, most recently from 553b9e2 to a313c46 Compare November 14, 2024 19:16
@jpogran jpogran marked this pull request as ready for review November 14, 2024 19:22
@jpogran jpogran requested a review from a team as a code owner November 14, 2024 19:22
@jpogran jpogran changed the title Port UI tests to vscode-extension-tester and remove wdio (TFECO-8323) Port UI tests to vscode-extension-tester and remove wdio Nov 20, 2024
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! This looks much better than the previous wdio setup.

I left a couple of questions

src/providers/tfc/authenticationProvider.ts Outdated Show resolved Hide resolved
src/providers/tfc/planProvider.ts Outdated Show resolved Hide resolved
src/test/e2e/.mocharc.js Outdated Show resolved Hide resolved
src/test/e2e/mockSetup.ts Outdated Show resolved Hide resolved
src/test/e2e/specs/extension.e2e.ts Outdated Show resolved Hide resolved
src/test/e2e/specs/mocks/server.ts Show resolved Hide resolved
uitest.mjs Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
@jpogran jpogran mentioned this pull request Nov 25, 2024
@jpogran jpogran requested a review from dbanck November 26, 2024 15:07
@jpogran jpogran force-pushed the redhat-ext-tester branch 2 times, most recently from d3d22c9 to bd30f6a Compare December 2, 2024 20:32
dbanck
dbanck previously approved these changes Dec 4, 2024
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work!

Closes #1716

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 and it required a new way to run the tests. So a script that runs the tests has been created that will run the tests in a headless mode when running in CI and in a windowed mode when running locally. This is to ensure that the tests can be run in a reliable manner in both environments. It also mocks the HCP API so that the tests can be run without needing to have a connection to HCP infrastructure.

A bug in the login workflow was found during this effort. After successfully authenticing, the organization picker was left open and could not be closed. This was fixed by disposing the organization picker after successfully authenticating.

Since the primary focus was on the HCP treeview tests (most likely to break when changing this area), the Terraform treeview tests (which have much simpler functionality) were not updated and left for a future PR.

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.

A minor addition to the eslint ruleset to allow for the use of `unsafe` access or `any` in the codebase where it is needed, specifically in places where we interact with libraries that are not typed or where we need to access properties that are not typed.
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpogran jpogran merged commit 458c030 into main Dec 4, 2024
13 checks passed
@jpogran jpogran deleted the redhat-ext-tester branch December 4, 2024 14:51
Copy link

github-actions bot commented Jan 4, 2025

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants