Skip to content

Shard gl jasmine tests #2933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 21, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
"karma": "^3.0.0",
"karma-browserify": "^5.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-fail-fast-reporter": "^1.0.5",
"karma-firefox-launcher": "^1.0.1",
"karma-jasmine": "^1.1.2",
"karma-jasmine-spec-tags": "^1.0.1",
Expand Down
19 changes: 11 additions & 8 deletions test/jasmine/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ var constants = require('../../tasks/util/constants');
var isCI = !!process.env.CIRCLECI;
var argv = minimist(process.argv.slice(4), {
string: ['bundleTest', 'width', 'height'],
'boolean': ['info', 'nowatch', 'verbose', 'Chrome', 'Firefox'],
'boolean': ['info', 'nowatch', 'failFast', 'verbose', 'Chrome', 'Firefox'],
alias: {
'Chrome': 'chrome',
'Firefox': ['firefox', 'FF'],
'bundleTest': ['bundletest', 'bundle_test'],
'nowatch': 'no-watch'
'nowatch': 'no-watch',
'failFast': 'fail-fast'
},
'default': {
info: false,
nowatch: isCI,
failFast: false,
verbose: false,
width: '1035',
height: '617'
Expand Down Expand Up @@ -105,6 +107,10 @@ var pathToJQuery = path.join(__dirname, 'assets', 'jquery-1.8.3.min.js');
var pathToIE9mock = path.join(__dirname, 'assets', 'ie9_mock.js');
var pathToCustomMatchers = path.join(__dirname, 'assets', 'custom_matchers.js');

var reporters = (isFullSuite && !argv.tags) ? ['dots', 'spec'] : ['progress'];
if(argv.failFast) reporters.push('fail-fast');
if(argv.verbose) reporters.push('verbose');

function func(config) {
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
Expand Down Expand Up @@ -154,7 +160,7 @@ func.defaultConfig = {
// See note in CONTRIBUTING.md about more verbose reporting via karma-verbose-reporter:
// https://www.npmjs.com/package/karma-verbose-reporter ('verbose')
//
reporters: (isFullSuite && !argv.tags) ? ['dots', 'spec'] : ['progress'],
reporters: reporters,

// web server port
port: 9876,
Expand Down Expand Up @@ -235,6 +241,8 @@ func.defaultConfig = {
suppressPassed: true,
suppressSkipped: false,
showSpecTiming: false,
// use 'karma-fail-fast-reporter' to fail fast w/o conflicting
// with other karma plugins
failFast: false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this failFast shouldn't ever be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting it to true won't break anything, but it won't actually fail fast.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More on this topic: to make karma-spec-reporter fail fast, one needs to add it to the plugins list: https://github.com/mlex/karma-spec-reporter#configuration

When doing so, it conflicts with karma-browserify.

There might be a way, to list them (order dependent?) so that they don't conflict, but using karma-fail-fast-reporter was easy enough.

},

Expand Down Expand Up @@ -294,9 +302,4 @@ if(argv.Chrome) browsers.push('_Chrome');
if(argv.Firefox) browsers.push('_Firefox');
if(browsers.length === 0) browsers.push('_Chrome');

// add verbose reporter if specified
if(argv.verbose) {
func.defaultConfig.reporters.push('verbose');
}

module.exports = func;