Giter Site home page Giter Site logo

thesharpieone / karma-bamboo-reporter Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 7.0 9 KB

A quick an dirty karma reporter that integrates with bamboo via https://marketplace.atlassian.com/plugins/com.atlassian.bamboo.plugins.bamboo-nodejs-plugin

License: MIT License

JavaScript 100.00%
bamboo javascript karma-reporter karma-plugin

karma-bamboo-reporter's Introduction

karma-bamboo-reporter's People

Contributors

mattfysh avatar realityking avatar thesharpieone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

karma-bamboo-reporter's Issues

New release

Please release the project, so that we can use the directory creation done as part of de7db72

Doesn't create output file when multiple instance of Karma servers are run

Hi,

When I run multiple karma servers to test different projects, reporter is not generating output file as expected. I have three projects, To test all projects at once, I have one gulp task which launches three karma servers with its own settings.

Here is very simple setup to reproduce the problem:

Simple spec files in project specific directories. Here is one sample:

describe('Simple Test Suite', function() {
    it('Simple Spec', function() {
        expect(true).toBe(true);
    });
});

My karma.conf.js (without comments, self-explanatory):

module.exports = function(config) {
  config.set({

    basePath: __dirname,

    frameworks: ['jasmine'],

    files: [],

    exclude: [],

    preprocessors: {},

    reporters: ['progress', 'bamboo'],

    port: 9876,

    colors: true,

    logLevel: config.LOG_INFO,

    autoWatch: true,

    browsers: ['Chrome'],

    singleRun: false
  })
}

gulpfile.js

var gulp = require('gulp');
var Server = require('karma').Server;
var fs = require('fs');

function startServer(testport, sourcefiles, outputfilename, done) {

    // Create output directory
    fs.mkdir('./output', function(err) {
        if (err) {
            if (err.code === 'EEXIST') {}
        }
    });

    var options = {
        // karma configuration file
        configFile: __dirname + '/karma.conf.js',

        bambooReporter:{
            filename: './output/' + outputfilename
        },

        port: testport,

        files: [
            sourcefiles
        ],

        singleRun: true
    };

    var server = new Server(options, done);
    server.start();
}

gulp.task('project1', function (done) {
    var testPort = 9876;
    var sourcefiles = __dirname + '/src/project1/**/*.spec.js';
    var outputfilename = 'project1_test_results.json';

    startServer(testPort, sourcefiles, outputfilename, done);
});

gulp.task('project2', function (done) {
    var testPort = 9877;
    var sourcefiles = __dirname + '/src/project2/**/*.spec.js';
    var outputfilename = 'project2_test_results.json';

    startServer(testPort, sourcefiles, outputfilename, done);
});

gulp.task('project3', function (done) {
    var testPort = 9878;
    var sourcefiles = __dirname + '/src/project3/**/*.spec.js';
    var outputfilename = 'project3_test_results.json';

    startServer(testPort, sourcefiles, outputfilename, done);
});

gulp.task('default', ['project1', 'project2', 'project3']);

When I run 'gulp project1', it creates output file './output/project1_test_results.json'. Same is true for 'gulp project2' and 'gulp project3' commands.

Running just 'gulp' starts default task which in turn starts dependent test tasks. At the end, it should create following three files in './output' directory:

project1_test_results.json
project2_test_results.json
project3_test_results.json

except it doesn't. It creates only one file which is random. I'm using latest version of karma (v0.13.9).

Fails to run

Hey there!

Would love to use this little plugin but its failing on me...

27-Aug-2015 18:55:47 Error occurred while running Task 'Read Tests(7)' of type com.atlassian.bamboo.plugins.bamboo-nodejs-plugin:task.reporter.mocha.
27-Aug-2015 18:55:47 java.lang.NoSuchMethodError: com.atlassian.bamboo.util.BambooFileUtils.calculateRelativePath(Ljava/io/File;Ljava/io/File;)Ljava/lang/String;
27-Aug-2015 18:55:47 at com.atlassian.bamboo.plugins.nodejs.tasks.mocha.parser.MochaParserTaskType.calculateEffectiveFilePattern(MochaParserTaskType.java:54)
27-Aug-2015 18:55:47 at com.atlassian.bamboo.plugins.nodejs.tasks.mocha.parser.MochaParserTaskType.execute(MochaParserTaskType.java:26)
27-Aug-2015 18:55:47 at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:216)
27-Aug-2015 18:55:47 at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:98)
27-Aug-2015 18:55:47 at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:75)
27-Aug-2015 18:55:47 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:181)
27-Aug-2015 18:55:47 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:101)
27-Aug-2015 18:55:47 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:108)
27-Aug-2015 18:55:47 at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49)
27-Aug-2015 18:55:47 at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
27-Aug-2015 18:55:47 at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
27-Aug-2015 18:55:47 at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
27-Aug-2015 18:55:47 at java.lang.Thread.run(Thread.java:744)

Publish to NPM?

Do you plan on publishing this to NPM? It was exactly what I needed.

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.