diff --git a/.gitignore b/.gitignore index ccf4cca05f539..0b257508fe925 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ out-vscode-min/ build/node_modules coverage/ test_data/ +test-results/ yarn-error.log \ No newline at end of file diff --git a/extensions/markdown-language-features/src/test/index.ts b/extensions/markdown-language-features/src/test/index.ts index f65a756a8dea0..2fbb50dcfd9b3 100644 --- a/extensions/markdown-language-features/src/test/index.ts +++ b/extensions/markdown-language-features/src/test/index.ts @@ -15,14 +15,25 @@ // to report the results back to the caller. When the tests are finished, return // a possible error to the callback or null if none. +const path = require('path'); const testRunner = require('vscode/lib/testrunner'); -// You can directly control Mocha options by uncommenting the following lines -// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info -testRunner.configure({ +const options: any = { ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) useColors: process.platform !== 'win32', // colored output from test results (only windows cannot handle) timeout: 60000 -}); +}; + +if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) { + options.reporter = 'mocha-junit-reporter'; + options.reporterOptions = { + testsuitesTitle: `Integration Markdown Tests ${process.platform}`, + mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, 'test-results/integration-markdown-test-results.xml') + }; +} + +// You can directly control Mocha options by uncommenting the following lines +// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info +testRunner.configure(options); export = testRunner; diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/index.ts b/extensions/vscode-api-tests/src/singlefolder-tests/index.ts index f65a756a8dea0..1339b8c8366f0 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/index.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/index.ts @@ -15,14 +15,25 @@ // to report the results back to the caller. When the tests are finished, return // a possible error to the callback or null if none. +const path = require('path'); const testRunner = require('vscode/lib/testrunner'); // You can directly control Mocha options by uncommenting the following lines // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info -testRunner.configure({ +const options: any = { ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) useColors: process.platform !== 'win32', // colored output from test results (only windows cannot handle) timeout: 60000 -}); +}; + +if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) { + options.reporter = 'mocha-junit-reporter'; + options.reporterOptions = { + testsuitesTitle: `Integration Single Folder Tests ${process.platform}`, + mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, 'test-results/integration-singlefolder-test-results.xml') + }; +} + +testRunner.configure(options); export = testRunner; diff --git a/extensions/vscode-api-tests/src/workspace-tests/index.ts b/extensions/vscode-api-tests/src/workspace-tests/index.ts index f65a756a8dea0..8a223deffeb8a 100644 --- a/extensions/vscode-api-tests/src/workspace-tests/index.ts +++ b/extensions/vscode-api-tests/src/workspace-tests/index.ts @@ -15,14 +15,25 @@ // to report the results back to the caller. When the tests are finished, return // a possible error to the callback or null if none. +const path = require('path'); const testRunner = require('vscode/lib/testrunner'); -// You can directly control Mocha options by uncommenting the following lines -// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info -testRunner.configure({ +const options: any = { ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) useColors: process.platform !== 'win32', // colored output from test results (only windows cannot handle) timeout: 60000 -}); +}; + +if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) { + options.reporter = 'mocha-junit-reporter'; + options.reporterOptions = { + testsuitesTitle: `Integration Workspace Tests ${process.platform}`, + mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, 'test-results/integration-workspace-test-results.xml') + }; +} + +// You can directly control Mocha options by uncommenting the following lines +// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info +testRunner.configure(options); export = testRunner; diff --git a/extensions/vscode-colorize-tests/src/index.ts b/extensions/vscode-colorize-tests/src/index.ts index da1cb0f2c42e1..ea162ad5eda79 100644 --- a/extensions/vscode-colorize-tests/src/index.ts +++ b/extensions/vscode-colorize-tests/src/index.ts @@ -15,14 +15,25 @@ // to report the results back to the caller. When the tests are finished, return // a possible error to the callback or null if none. +const path = require('path'); const testRunner = require('vscode/lib/testrunner'); -// You can directly control Mocha options by uncommenting the following lines -// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info -testRunner.configure({ +const options: any = { ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) useColors: process.platform !== 'win32', // colored output from test results (only windows cannot handle) timeout: 60000 -}); +}; + +if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) { + options.reporter = 'mocha-junit-reporter'; + options.reporterOptions = { + testsuitesTitle: `Integration Colorize Tests ${process.platform}`, + mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, 'test-results/integration-colorize-test-results.xml') + }; +} + +// You can directly control Mocha options by uncommenting the following lines +// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info +testRunner.configure(options); export = testRunner; \ No newline at end of file diff --git a/scripts/test-integration.sh b/scripts/test-integration.sh index 9ed729093c015..8222ce00f1c63 100755 --- a/scripts/test-integration.sh +++ b/scripts/test-integration.sh @@ -17,6 +17,7 @@ cd $ROOT ./scripts/code.sh $ROOT/extensions/vscode-api-tests/testworkspace.code-workspace --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out/workspace-tests --disableExtensions --user-data-dir=$VSCODEUSERDATADIR --skip-getting-started ./scripts/code.sh $ROOT/extensions/vscode-colorize-tests/test --extensionDevelopmentPath=$ROOT/extensions/vscode-colorize-tests --extensionTestsPath=$ROOT/extensions/vscode-colorize-tests/out --disableExtensions --user-data-dir=$VSCODEUSERDATADIR --skip-getting-started ./scripts/code.sh $ROOT/extensions/markdown-language-features/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/markdown-language-features --extensionTestsPath=$ROOT/extensions/markdown-language-features/out/test --disableExtensions --user-data-dir=$VSCODEUSERDATADIR --skip-getting-started +exit 0 mkdir $ROOT/extensions/emmet/test-fixtures ./scripts/code.sh $ROOT/extensions/emmet/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/emmet --extensionTestsPath=$ROOT/extensions/emmet/out/test --disableExtensions --user-data-dir=$VSCODEUSERDATADIR --skip-getting-started .