Skip to content

Commit

Permalink
wip: build show integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Jun 11, 2018
1 parent 33d8825 commit 4eceb88
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ out-vscode-min/
build/node_modules
coverage/
test_data/
test-results/
yarn-error.log
19 changes: 15 additions & 4 deletions extensions/markdown-language-features/src/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
15 changes: 13 additions & 2 deletions extensions/vscode-api-tests/src/singlefolder-tests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
19 changes: 15 additions & 4 deletions extensions/vscode-api-tests/src/workspace-tests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
19 changes: 15 additions & 4 deletions extensions/vscode-colorize-tests/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
1 change: 1 addition & 0 deletions scripts/test-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down

0 comments on commit 4eceb88

Please sign in to comment.