-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: 1.14.0
-
Component/s: None
-
5
-
None
-
Developer Tools
The vscode test setup is failing with both `stable` and `insiders` builds and that is because the recent changes from VSCode does not allow having multiple providers for a registered scheme. And apparently our test setup attempts to register, for the scheme, multiple providers.
After some investigation, it came to light that runTest helper from vscode-tests already calls extension.activate function which create MDBExtensionController instance and activates it thereby setting up all the scheme providers.
Then in our test setup script in `test/suite/index.ts` we additionally create a stub extension controller and activate which attempts registering for the already register schema, another provider and that is why the test runs fails with the following error:
Error: a provider for the scheme 'VIEW_DOCUMENT_SCHEME' is already registered at o5.registerFileSystemProvider (file:///Users/himanshu.singh/PSource/@mongodb/vscode/.vscode-test/vscode-darwin-arm64-1.104.0/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:140:113862) at Object.registerFileSystemProvider (file:///Users/himanshu.singh/PSource/@mongodb/vscode/.vscode-test/vscode-darwin-arm64-1.104.0/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:199:120968) at EditorsController.registerProviders (/Users/himanshu.singh/PSource/@mongodb/vscode/src/editors/editorsController.ts:385:24) at new MDBExtensionController (/Users/himanshu.singh/PSource/@mongodb/vscode/src/mdbExtensionController.ts:167:29) at Object.run (/Users/himanshu.singh/PSource/@mongodb/vscode/src/test/suite/index.ts:29:46) at file:///Users/himanshu.singh/PSource/@mongodb/vscode/.vscode-test/vscode-darwin-arm64-1.104.0/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:116:17929 at new Promise (<anonymous>) at aJ.sb (file:///Users/himanshu.singh/PSource/@mongodb/vscode/.vscode-test/vscode-darwin-arm64-1.104.0/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:116:17650) at aJ.$extensionTestsExecute (file:///Users/himanshu.singh/PSource/@mongodb/vscode/.vscode-test/vscode-darwin-arm64-1.104.0/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:116:17238)
Ideally the test setup should not have to create a Context stub, many threads on SO mentions that we should be able to get actual context straight from original activate call but that is not so straight forward as the answers on those threads.