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

VS Code integration tests is failing. #324

Open
aparnamichael opened this issue Feb 27, 2024 · 2 comments · May be fixed by #328
Open

VS Code integration tests is failing. #324

aparnamichael opened this issue Feb 27, 2024 · 2 comments · May be fixed by #328
Assignees
Labels
automated tests bug Something isn't working

Comments

@aparnamichael
Copy link
Contributor

Now the tests are failing by throwing the following error:

HTTPError: Response code 404 (Not Found)
at Request._onResponseBase (/Users/runner/work/liberty-tools-vscode/liberty-tools-vscode/node_modules/got/dist/source/core/index.js:913:31)
at Request._onResponse (/Users/runner/work/liberty-tools-vscode/liberty-tools-vscode/node_modules/got/dist/source/core/index.js:948:24)
at ClientRequest. (/Users/runner/work/liberty-tools-vscode/liberty-tools-vscode/node_modules/got/dist/source/core/index.js:962:23)
at Object.onceWrapper (node:events:633:26)
at ClientRequest.emit (node:events:530:35)

@aparnamichael
Copy link
Contributor Author

From the logs, we understood that it is failing while running "npm run test". "test" is defined as "test": "npm run test-compile && extest setup-and-run -o .vscode/settings.json 'out/test/*.js'". 'npm run test-compile' is working. As a next step, we have updated the extest framework with the latest, after that 404 error gone.
Now error is coming for 'clipboardy' node module.
Error [ERR_REQUIRE_ESM]: require() of ES Module node_modules/clipboardy/index.js from out/test/utils/testUtils.js not supported.
Instead change the require of index.js in out/test/utils/testUtils.js to a dynamic import() which is available in all CommonJS modules.

@vaisakhkannan
Copy link
Contributor

As part of my investigation, first, I updated the test framework to the latest version. Then, I found a component called 'clipboardy' causing issues. The reason behind the issue was that the clipboardy version defaulted to 4.0.0 after the test-framework update. This new version requires ES modules in the compiler options.As shown in the screenshot, we are using commonjs as default.
Screenshot 2024-03-21 at 5 54 09 PM

To resolve this, I downgraded the clipboardy component version from 4.0.0 to 2.3.0.
After this change, the tests started running. However, a new issue was found in the UI test code during the Maven project testing.

The command palette in Visual Studio Code (VSCode) provides suggestions for recently used commands in a dropdown list. However, based on our UI testing code, it sometimes selects the incorrect command, such as choosing "Liberty: Start ..." instead of "Liberty: Start" from the recent suggestions. This discrepancy arises because we specifically require "Liberty: Start" at that moment.

I checked the possibility of selecting the exact same command from the list using the dev mode action, but unfortunately, I couldn't find a solution that way.

However, I did discover a solution involving clearing the command history in the command palette. To investigate this further, I reviewed the sample test code in vscode-extension-tester.

During this investigation, I identified a problem on their end.
await dialog.pushButton('Clear');
Specifically, the method pushButton('Clear') is not functioning as expected due to their issue.

Consequently, I have raised an issue on GitHub. You can find the link : redhat-developer/vscode-extension-tester#1195

They mentioned in the issue that the fix will be included in another release of ExTester scheduled for this week.

vaisakhkannan added a commit to vaisakhkannan/liberty-tools-vscode that referenced this issue Mar 25, 2024
@vaisakhkannan vaisakhkannan linked a pull request Mar 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automated tests bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

3 participants