Coder Social home page Coder Social logo

Comments (12)

wnr avatar wnr commented on September 1, 2024

@karma-runner will you have a look at this?

from karma-sauce-launcher.

rkistner avatar rkistner commented on September 1, 2024

In my project I simply define multiple grunt tasks, and run them sequentially:

karma: {
        sauce1: {
            configFile: 'karma-sauce.conf.js',
            browsers: ['SL_IE_9', 'SL_IE_10']
        },
        sauce2: {
            configFile: 'karma-sauce.conf.js',
            browsers: ['SL_Chrome', 'SL_Safari']
        }
}

I also use a solution similar to this answer to always run the tests in all browsers, even if tests in the first one fail.

Of course, this only works when using singleRun: true.

My full config: Gruntfile.js and karma.conf.js.

from karma-sauce-launcher.

wnr avatar wnr commented on September 1, 2024

@rkistner thanks alot! That should solve my problems. Smart to use multiple grunt tasks, didn't think of that :)

from karma-sauce-launcher.

wnr avatar wnr commented on September 1, 2024

@rkistner do you also have a solution to mark browser runs passed/failed perhaps?

from karma-sauce-launcher.

rkistner avatar rkistner commented on September 1, 2024

@wnr Unfotunately I don't. I'll log it as a separate issue.

from karma-sauce-launcher.

wnr avatar wnr commented on September 1, 2024

@rkistner okay cool :)

from karma-sauce-launcher.

rkistner avatar rkistner commented on September 1, 2024

This was fixed by karma-runner/karma#57, which was released in karma 0.11.0 (npm install karma@canary).

No need to specify the concurrency limit - the first browsers start running the tests immediately, and the next batch are queued and run as soon as the first ones have finished.

from karma-sauce-launcher.

wnr avatar wnr commented on September 1, 2024

Oh okay, cool :) Thanks a bunch

from karma-sauce-launcher.

kimmobrunfeldt avatar kimmobrunfeldt commented on September 1, 2024

Thanks @rkistner for sharing your setup! I ended up doing the same thing but also in a way that separate karma tasks are created dynamically of given sauce lab browser setup: karma.conf.js, saucelabs-browsers.js, Gruntfile.js check also sauce task.

from karma-sauce-launcher.

sgarbesi avatar sgarbesi commented on September 1, 2024

@rkistner Expansion using caolan's async library.

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

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

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

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

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

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

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

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

from karma-sauce-launcher.

sgarbesi avatar sgarbesi commented on September 1, 2024

@kimmobrunfeldt This doesn't actually flag the browser as having failed in saucelabs. Did you manage to do anything further to get that to work?

from karma-sauce-launcher.

joscha avatar joscha commented on September 1, 2024

see #40 and karma-runner/karma#1646.

from karma-sauce-launcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.