From 910e4815fa8354dafb11dcd802ed6322f6a6f322 Mon Sep 17 00:00:00 2001 From: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Date: Wed, 17 Apr 2019 16:46:10 -0700 Subject: [PATCH] Enable Python Integration Tests For Notebooks (#5090) * Enable python notebook tests * change run_python3_test to be string * Add explicit pyspark check --- extensions/integration-tests/setEnvironmentVariables.js | 4 ++++ extensions/integration-tests/src/notebook.test.ts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/integration-tests/setEnvironmentVariables.js b/extensions/integration-tests/setEnvironmentVariables.js index 96473aaf2a..213f21989e 100644 --- a/extensions/integration-tests/setEnvironmentVariables.js +++ b/extensions/integration-tests/setEnvironmentVariables.js @@ -104,6 +104,8 @@ const ENVAR_STANDALONE_SERVER = 'STANDALONE_SQL'; const ENVAR_STANDALONE_SERVER_USERNAME = 'STANDALONE_SQL_USERNAME'; const ENVAR_STANDALONE_SERVER_PASSWORD = 'STANDALONE_SQL_PWD'; const ENVAR_PYTHON_INSTALL_PATH = 'PYTHON_TEST_PATH'; +const ENVAR_RUN_PYTHON3_TEST = 'RUN_PYTHON3_TEST'; +const ENVAR_RUN_PYSPARK_TEST = 'RUN_PYSPARK_TEST'; // Mapping between AKV secret and the environment variable names const SecretEnVarMapping = []; @@ -119,6 +121,8 @@ SecretEnVarMapping.push([SECRET_STANDALONE_SERVER_USERNAME, ENVAR_STANDALONE_SER // Set the values that are not stored in AKV here process.env[ENVAR_PYTHON_INSTALL_PATH] = NOTEBOOK_PYTHON_INSTALL_PATH; +process.env[ENVAR_RUN_PYTHON3_TEST] = '1'; +process.env[ENVAR_RUN_PYSPARK_TEST] = '0'; const promises = []; diff --git a/extensions/integration-tests/src/notebook.test.ts b/extensions/integration-tests/src/notebook.test.ts index 9a5224616d..f98af6a1bf 100644 --- a/extensions/integration-tests/src/notebook.test.ts +++ b/extensions/integration-tests/src/notebook.test.ts @@ -71,7 +71,7 @@ if (context.RunTest) { await verifyClearAllOutputs(notebook); }); - if (process.env.RUN_PYTHON3_TEST === '1') { + if (process.env['RUN_PYTHON3_TEST'] === '1') { test('Python3 notebook test', async function () { let notebook = await openNotebook(pySparkNotebookContent, pythonKernelMetadata, this.test.title); let cellOutputs = notebook.document.cells[0].contents.outputs; @@ -86,7 +86,7 @@ if (context.RunTest) { }); } - if (process.env.RUN_PYSPARK_TEST === '1') { + if (process.env['RUN_PYSPARK_TEST'] === '1') { test('PySpark3 notebook test', async function () { let notebook = await openNotebook(pySparkNotebookContent, pySpark3KernelMetadata, this.test.title); let cellOutputs = notebook.document.cells[0].contents.outputs;