grunt-saucelabs icon indicating copy to clipboard operation
grunt-saucelabs copied to clipboard

Failed tests not being flagged in SauceLabs?

Open sgarbesi opened this issue 11 years ago • 0 comments

I have a number of a tests that I'm attempting to run via SauceLabs.

At first one of the problems I had was when a single browser failed, any other browsers set to be tested next in line would never get tested. I've seemed to have fixed that problem, only to find this new problem where the tests that are failing aren't being flagged as having failed in SauceLabs.

Here's the code from my Gruntfile.js which runs the tests:

me.tasks.tests = function() {
    me.grunt.registerTask('tests', function() {
        var done = this.async();
        var series = [];
        var success = true;
        var tasks = {};

        Object.keys(me.grunt.config.data.karma).forEach(function(key) {
            if (key === 'dev' || key === 'options') {
                return;
            }

            var task = 'karma:' + key;
            tasks[task] = 0;

            series.push(function(callback) {
                me.grunt.util.spawn({
                    args: [task],
                    grunt: true,

                    opts: {
                        stdio: 'inherit'
                    }
                }, function(error, result, code) {
                    tasks[task] = code;

                    if (code !== 0) {
                        success = false;
                    }

                    callback();
                });
            });
        });

        me.async.parallelLimit(series, 1, function() {
            done(success);
        });
    });
};

The code is telling Grunt to keep going if a single browser fails, but the plugin should still report that a specific browser test failed to SauceLabs?

Reproduction:

git clone https://github.com/dolox/fallback.git;
cd fallback;
git checkout v2;
npm install -g grunt-cli bower;
npm install;
bower install;
grunt tests;

sgarbesi avatar Nov 18 '14 02:11 sgarbesi