From 7a03da42ec7c97f72c28cfb719ad9bd8781af689 Mon Sep 17 00:00:00 2001 From: Cory Rivera Date: Mon, 20 May 2019 15:44:14 -0700 Subject: [PATCH] Revert user settings changes after running Existing Python Install integration test. (#5551) --- .../integrationTest/notebookIntegration.test.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/extensions/notebook/src/integrationTest/notebookIntegration.test.ts b/extensions/notebook/src/integrationTest/notebookIntegration.test.ts index 64d4d60fa2..1c8f605674 100644 --- a/extensions/notebook/src/integrationTest/notebookIntegration.test.ts +++ b/extensions/notebook/src/integrationTest/notebookIntegration.test.ts @@ -45,9 +45,13 @@ describe('Notebook Extension Python Installation', function () { it('Verify Python Installation', async function () { should(installComplete).be.true('Python setup did not complete.'); - let jupyterPath = JupyterServerInstallation.getPythonInstallPath(jupyterController.jupyterInstallation.apiWrapper); + let apiWrapper = jupyterController.jupyterInstallation.apiWrapper; + let jupyterPath = JupyterServerInstallation.getPythonInstallPath(apiWrapper); + console.log(`Expected python path: '${pythonInstallDir}'; actual: '${jupyterPath}'`); should(jupyterPath).be.equal(pythonInstallDir); + should(JupyterServerInstallation.isPythonInstalled(apiWrapper)).be.true(); + should(JupyterServerInstallation.getExistingPythonSetting(apiWrapper)).be.false(); }); it('Use Existing Python Installation', async function () { @@ -63,6 +67,17 @@ describe('Notebook Extension Python Installation', function () { console.log('Start Existing Python Installation'); let existingPythonPath = path.join(pythonInstallDir, pythonBundleVersion); await install.startInstallProcess(false, { installPath: existingPythonPath, existingPython: true }); + let apiWrapper = install.apiWrapper; + should(JupyterServerInstallation.isPythonInstalled(apiWrapper)).be.true(); + should(JupyterServerInstallation.getPythonInstallPath(apiWrapper)).be.equal(existingPythonPath); + should(JupyterServerInstallation.getExistingPythonSetting(apiWrapper)).be.true(); + + // Redo "new" install to restore original settings. + // The actual install should get skipped since it already exists. + await install.startInstallProcess(false, { installPath: pythonInstallDir, existingPython: false }); + should(JupyterServerInstallation.isPythonInstalled(apiWrapper)).be.true(); + should(JupyterServerInstallation.getPythonInstallPath(apiWrapper)).be.equal(pythonInstallDir); + should(JupyterServerInstallation.getExistingPythonSetting(apiWrapper)).be.false(); console.log('Existing Python Installation is done'); }); });