vscode-go
vscode-go copied to clipboard
Consider migrating to VSCode's integration test scaffolding
vscode-go uses extension/test/runTest.ts to execute integration tests. Consider migrating to @vscode/test-cli and .vscode-test.js (or .mjs/.cjs). Looking at runTest.ts, I think it should be feasible. The only part I see that might be tricky is the two separate test runs, other than that everything looks pretty straightforward. I am interested in trying this myself.
vscode-go's integration test setup is a little janky. It executes two different sets of tests (two calls to runTest); if all the tests in the second run pass, it's not obvious whether any tests in the first run failed because I have to scroll to the ~middle of the output (which is quite long) to find the report from the first run. Also the Testing UI is very convenient but vscode-go's setup seems to confuse it.
CC @h9jiang.
You are referring to https://github.com/microsoft/vscode-test-cli, right? I'm not experienced with vscode-go's integration test, but would not be surprised if they are using outdated patterns or libraries. I defer to Hongxiang for prioritization.
You are referring to https://github.com/microsoft/vscode-test-cli, right?
Yes, but more generally the instructions here.
I'm not experienced with vscode-go's integration test, but would not be surprised if they are using outdated patterns or libraries.
There's already a pretty strong correspondence between how we're running integration tests now and what the page I linked suggests so on paper it looks like a small change. I tried to do this myself and ran into strange failures. When I executed the tests via npm run <script> (I forget the exact name of the script) I got an error in mocha, but when I tried to debug, it just "process exited with code ..." without hitting any useful breakpoints. I followed their guide (the 'normal'/non-advanced process) but clearly there are some issues. My next step would be to start from scratch and get a single test to work their way, and then migrate bit by bit until I figured out what broke it. I would link my work in a branch but it appears that I discarded it. I don't think this needs to be a priority, it's just a minor developer experience thing.