diff --git a/build/azure-pipelines/linux/sql-product-build-linux.yml b/build/azure-pipelines/linux/sql-product-build-linux.yml index e7c42ff0f2..a02c2978b8 100644 --- a/build/azure-pipelines/linux/sql-product-build-linux.yml +++ b/build/azure-pipelines/linux/sql-product-build-linux.yml @@ -1,3 +1,6 @@ +parameters: + extensionsToUnitTest: [] + steps: - script: | mkdir -p .build @@ -126,14 +129,15 @@ steps: displayName: Run integration tests (Electron) condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true')) - - script: | - set -e - APP_ROOT=$(agent.builddirectory)/azuredatastudio-linux-x64 - APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName") - INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \ - DISPLAY=:10 ./scripts/test-extensions-unit.sh - displayName: 'Run Stable Extension Unit Tests' - condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true')) + - ${{each extension in parameters.extensionsToUnitTest}}: + - script: | + set -e + APP_ROOT=$(agent.builddirectory)/azuredatastudio-linux-x64 + APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName") + INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \ + DISPLAY=:10 node ./scripts/test-extensions-unit.js ${{ extension }} + displayName: 'Run ${{ extension }} Stable Extension Unit Tests' + condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true')) - script: | set -e diff --git a/build/azure-pipelines/sql-product-build.yml b/build/azure-pipelines/sql-product-build.yml index f86af93e93..53fd68247f 100644 --- a/build/azure-pipelines/sql-product-build.yml +++ b/build/azure-pipelines/sql-product-build.yml @@ -45,6 +45,8 @@ jobs: - Compile steps: - template: linux/sql-product-build-linux.yml + parameters: + extensionsToUnitTest: ["admin-tool-ext-win", "agent", "azurecore", "cms", "dacpac", "import", "schema-compare", "notebook", "resource-deployment", "machine-learning", "sql-database-projects"] timeoutInMinutes: 70 - job: LinuxWeb diff --git a/scripts/test-extensions-unit.js b/scripts/test-extensions-unit.js index 38f3835ea1..de32ca621a 100644 --- a/scripts/test-extensions-unit.js +++ b/scripts/test-extensions-unit.js @@ -20,7 +20,7 @@ const extensionList = [ //'mssql', 'notebook', 'resource-deployment', - 'machine-learning-services', + 'machine-learning', 'sql-database-projects']; let argv = require('yargs') @@ -63,11 +63,12 @@ for (const ext of argv.extensions) { console.log(`*** starting ${ext} tests ***`); console.log('*'.repeat(ext.length + 23)); - const command = `${process.env.INTEGRATION_TEST_ELECTRON_PATH} --extensionDevelopmentPath=${path.join(__dirname, '..', 'extensions', ext)} --extensionTestsPath=${path.join(__dirname, '..', 'extensions', ext, 'out', 'test')} --user-data-dir=${VSCODEUSERDATADIR} --extensions-dir=${VSCODEEXTENSIONSDIR} --remote-debugging-port=9222 --disable-telemetry --disable-crash-reporter --disable-updates --nogpu`; - console.log(execSync(command, {stdio: 'inherit'})); + const command = `${process.env.INTEGRATION_TEST_ELECTRON_PATH} --no-sandbox --extensionDevelopmentPath=${path.join(__dirname, '..', 'extensions', ext)} --extensionTestsPath=${path.join(__dirname, '..', 'extensions', ext, 'out', 'test')} --user-data-dir=${VSCODEUSERDATADIR} --extensions-dir=${VSCODEEXTENSIONSDIR} --remote-debugging-port=9222 --disable-telemetry --disable-crash-reporter --disable-updates --nogpu`; + console.log(`Command used: ${command}`); + console.log(execSync(command, { stdio: 'inherit' })); } // clean up -fs.remove(VSCODEUSERDATADIR, { recursive: true }); -fs.remove(VSCODEEXTENSIONSDIR, { recursive: true }); +fs.remove(VSCODEUSERDATADIR, { recursive: true }).catch(console.error); +fs.remove(VSCODEEXTENSIONSDIR, { recursive: true }).catch(console.error);