Test suite fails in various scenarios on Windows
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Describe the bug
When trying to contribute to VSCode VIM it's advised to write tests and make sure that they pass before submitting your PR. To execute the test suite a contributor can either run npm test to test locally or gulp test to build a docker container and execute the test suite within a linux environment.
The issue happens when a potential contributor is using Windows as the host OS and manages to do the following (or vice-versa):
-
Run
npm testfor the first time, this will likely download a stable Windows build of VSCode into.vscode-test. -
Attempt to run
gulp testto execute the suite in the Linux container, this will result in anENONTerror since the download script sees a.vscode-test/vscode-n.nn.ndirectory and assumes VSCode is downloaded and good to go.
To Reproduce
Steps to reproduce the behavior:
1.) On a Windows host, run cmd prompt as Administrator (required to run test suite locally)
2.) Clone the VSCode VIM repo and cd into it
3.) Execute gulp build and then npm test
4.) Attempt to run gulp test
Expected behavior
vscode-test should make an effort to make sure that a stable version of VSCode that matches process.platform is downloaded. This prevents any foul-up when executing the test suite.
Environment (please complete the following information):
- OS: Windows 10 x64
Additional context
I think this makes sense to create as an issue on the upstream vscode-test repo where a fix would make the most sense. I am just opening this here because I think VSCode VIM can implement a stop-gap in the meantime by checking the error code and giving the end-user some feedback on steps to take to remedy the issue.
I have tested a "fix" locally by checking data.code === ENONT within cmd.on('error', ()=>{}); and then console.logging out a helpful message with a yellow background. The message tells the user to try deleting the .vscode-test directory and re-running the command they just tried, this helps in both cases whether the user-tested with docker first (and downloaded a Linux version of VSCode) or whether they tried npm test first (and downloaded VSCode for Windows).
This 'bandaid' would need made to the vscode-extension-vscode repo to their bin/test script I think, not as part of VSCode VIM, just opening this here for some feedback.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the npm test and gulp test paths and the .vscode-test directory behavior described in the report. The issue points to the upstream vscode-test project and the vscode-extension-vscode bin/test script rather than a specific VSCodeVim file. Done would mean establishing where the platform mismatch should be handled and documenting or implementing an agreed fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, nodejs, typescript
- Domain
- build-system, devops, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100