diff --git a/package-lock.json b/package-lock.json index 8a01e1cd0801..51c3a42a862d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13970,7 +13970,7 @@ }, "convert-source-map": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "resolved": "", "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", "dev": true, "requires": { @@ -13979,7 +13979,7 @@ }, "execa": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "resolved": "", "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", "dev": true, "requires": { @@ -14005,7 +14005,7 @@ }, "find-up": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "resolved": "", "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { @@ -14020,7 +14020,7 @@ }, "get-stream": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "resolved": "", "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "dev": true, "requires": { @@ -14043,7 +14043,7 @@ }, "locate-path": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "resolved": "", "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { @@ -14063,7 +14063,7 @@ }, "os-locale": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "resolved": "", "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", "dev": true, "requires": { @@ -14074,7 +14074,7 @@ }, "path-exists": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "resolved": "", "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, @@ -14086,7 +14086,7 @@ }, "pkg-dir": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "resolved": "", "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", "dev": true, "requires": { @@ -14095,7 +14095,7 @@ }, "pump": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "resolved": "", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, "requires": { @@ -14111,13 +14111,13 @@ }, "resolve-from": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "resolved": "", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, "rimraf": { "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "resolved": "", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "requires": { diff --git a/src/test/datascience/dataScienceIocContainer.ts b/src/test/datascience/dataScienceIocContainer.ts index 25d6d59d4ce7..e0c6b4f441f3 100644 --- a/src/test/datascience/dataScienceIocContainer.ts +++ b/src/test/datascience/dataScienceIocContainer.ts @@ -49,9 +49,15 @@ import { RegistryImplementation } from '../../client/common/platform/registry'; import { IPlatformService, IRegistry } from '../../client/common/platform/types'; import { CurrentProcess } from '../../client/common/process/currentProcess'; import { BufferDecoder } from '../../client/common/process/decoder'; +import { ProcessLogger } from '../../client/common/process/logger'; import { ProcessServiceFactory } from '../../client/common/process/processFactory'; import { PythonExecutionFactory } from '../../client/common/process/pythonExecutionFactory'; -import { IBufferDecoder, IProcessServiceFactory, IPythonExecutionFactory } from '../../client/common/process/types'; +import { + IBufferDecoder, + IProcessLogger, + IProcessServiceFactory, + IPythonExecutionFactory +} from '../../client/common/process/types'; import { Bash } from '../../client/common/terminal/environmentActivationProviders/bash'; import { CommandPromptAndPowerShell } from '../../client/common/terminal/environmentActivationProviders/commandPrompt'; import { @@ -227,7 +233,7 @@ export class DataScienceIocContainer extends UnitTestIocContainer { public wrapperCreatedPromise: Deferred | undefined; public postMessage: ((ev: MessageEvent) => void) | undefined; // tslint:disable-next-line:no-any - private missedMessages : any[] = []; + private missedMessages: any[] = []; private pythonSettings = new class extends PythonSettings { public fireChangeEvent() { this.changed.fire(); @@ -510,6 +516,7 @@ export class DataScienceIocContainer extends UnitTestIocContainer { this.serviceManager.addSingleton(IInterpreterService, InterpreterService); this.serviceManager.addSingleton(IJupyterSessionManager, JupyterSessionManager); this.serviceManager.addSingleton(IJupyterPasswordConnect, JupyterPasswordConnect); + this.serviceManager.addSingleton(IProcessLogger, ProcessLogger); } if (this.serviceManager.get(IPlatformService).isWindows) { @@ -552,23 +559,23 @@ export class DataScienceIocContainer extends UnitTestIocContainer { // Setup the webpanel provider so that it returns our dummy web panel. It will have to talk to our global JSDOM window so that the react components can link into it webPanelProvider.setup(p => p.create(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAnyString(), TypeMoq.It.isAnyString(), TypeMoq.It.isAnyString(), TypeMoq.It.isAny())).returns( (_viewColumn: ViewColumn, listener: IWebPanelMessageListener, _title: string, _script: string, _css: string) => { - // Keep track of the current listener. It listens to messages through the vscode api - this.webPanelListener = listener; - - // Send messages that were already posted but were missed. - // During normal operation, the react control will not be created before - // the webPanelListener - if (this.missedMessages.length && this.webPanelListener) { - this.missedMessages.forEach(m => this.webPanelListener ? this.webPanelListener.onMessage(m.type, m.payload) : noop()); - - // Note, you might think we should clean up the messages. However since the mount only occurs once, we might - // create multiple webpanels with the same mount. We need to resend these messages to - // other webpanels that get created with the same mount. - } + // Keep track of the current listener. It listens to messages through the vscode api + this.webPanelListener = listener; + + // Send messages that were already posted but were missed. + // During normal operation, the react control will not be created before + // the webPanelListener + if (this.missedMessages.length && this.webPanelListener) { + this.missedMessages.forEach(m => this.webPanelListener ? this.webPanelListener.onMessage(m.type, m.payload) : noop()); + + // Note, you might think we should clean up the messages. However since the mount only occurs once, we might + // create multiple webpanels with the same mount. We need to resend these messages to + // other webpanels that get created with the same mount. + } - // Return our dummy web panel - return webPanel.object; - }); + // Return our dummy web panel + return webPanel.object; + }); webPanel.setup(p => p.postMessage(TypeMoq.It.isAny())).callback((m: WebPanelMessage) => { const message = createMessageEvent(m); if (this.postMessage) { @@ -605,7 +612,7 @@ export class DataScienceIocContainer extends UnitTestIocContainer { this.pythonSettings.pythonPath = newPath; this.pythonSettings.fireChangeEvent(); this.configChangeEvent.fire({ - affectsConfiguration(_s: string, _r?: Uri) : boolean { + affectsConfiguration(_s: string, _r?: Uri): boolean { return true; } }); @@ -615,7 +622,7 @@ export class DataScienceIocContainer extends UnitTestIocContainer { return this.jupyterMock; } - public get(serviceIdentifier: interfaces.ServiceIdentifier, name?: string | number | symbol) : T { + public get(serviceIdentifier: interfaces.ServiceIdentifier, name?: string | number | symbol): T { return this.serviceManager.get(serviceIdentifier, name); } diff --git a/src/test/datascience/notebook.functional.test.ts b/src/test/datascience/notebook.functional.test.ts index 28529927640e..1a0a93ed3c29 100644 --- a/src/test/datascience/notebook.functional.test.ts +++ b/src/test/datascience/notebook.functional.test.ts @@ -1028,9 +1028,9 @@ plt.show()`, assert.ok(server, 'Server not created in logging case'); await server!.execute(`a=1${os.EOL}a`, path.join(srcDirectory(), 'foo.py'), 2, uuid()); assert.equal(cellInputs.length, 3, 'Not enough cell inputs'); - assert.equal(outputs.length, 3, 'Not enough cell inputs'); + assert.ok(outputs.length >= 1, 'Not enough cell outputs'); assert.equal(cellInputs[2], 'a=1\na', 'Cell inputs not captured'); - assert.equal(outputs[2], '1', 'Cell outputs not captured'); + assert.equal(outputs[outputs.length - 1], '1', 'Cell outputs not captured'); }); });