Giter Club home page Giter Club logo

grunt-coveralls's Introduction

Grunt-Coveralls

Grunt task to load coverage results and submit them to Coveralls.io

Build Status Coverage Status Dependency status Dev Dependency Status

Getting Started

This plugin requires Grunt >=0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-coveralls --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-coveralls');

The "coveralls" task

Grunt-coveralls takes one or more lcov files, and uploads them to coveralls.io.

Everything more specific than that is handled internally by node-coveralls, and the Coveralls service itself.

Usage

The only required option is a 'src' parameter, which accepts all the standard grunt src formats (plain path, glob, array of paths) and attempts to parse the matched lcov files and upload them.

This grunt task will pass as long as at least one file is matched, and all matched files are uploaded successfully.

grunt.initConfig({
  coveralls: {
    // Options relevant to all targets
    options: {
      // When true, grunt-coveralls will only print a warning rather than
      // an error, to prevent CI builds from failing unnecessarily (e.g. if
      // coveralls.io is down). Optional, defaults to false.
      force: false
    },

    your_target: {
      // LCOV coverage file (can be string, glob or array)
      src: 'coverage-results/extra-results-*.info',
      options: {
        // Any options for just this target
      }
    },
  },
});

This can then be run with grunt coveralls or grunt coveralls:your_target. The outcome will be printed to the console. For a practical example, look at this project, which uses itself to track its own coverage.

Note if you are new to grunt: You need to specify at least one target. Just specifying the options won't work.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. To ensure your code runs correctly, run npm test.

grunt-coveralls's People

Contributors

analog-nico avatar bitdeli-chef avatar leobalter avatar paroga avatar pimterry avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

grunt-coveralls's Issues

Security issue: Prototype pollution attack(Introduced by the [email protected] => [email protected] => [email protected] => [email protected])

The latest version [email protected] uses coveralls@^2.11.1. However, coveralls@^2.11.1 has a vulnerability which is introduced by [email protected]. More information is here:

https://nodesecurity.io/advisories/566
https://snyk.io/vuln/npm:hoek:20180212

Could you please update coveralls to the latest version to solve the vulnerability? Thank you so much.

unable to install

Hi,
I just followed your instruction but it fails for a couple of problems but it fails:
it doesn't like lodash, and components ask for different grunt version. ANy idea? TIA

~/testProject$ sudo npm install lodash@'~2.4.1' -g
[email protected] /usr/local/lib/node_modules/lodash
~/testProject$ sudo npm install grunt-coveralls --save-dev
npm WARN unmet dependency /home/pdipietro/testProject/node_modules/sails-disk/node_modules/waterline-cursor requires lodash@'~2.4.1' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm ERR! peerinvalid The package grunt does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.1
npm ERR! peerinvalid Peer [email protected] wants grunt@^0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.5

npm ERR! System Linux 3.13.0-39-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "grunt-coveralls" "--save-dev"
npm ERR! cwd /home/pdipietro/testProject
npm ERR! node -v v0.13.0-pre
npm ERR! npm -v 1.4.28
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pdipietro/testProject/npm-debug.log
npm ERR! not ok code 0

add support for grunt 1.0.0

since the peer dependency is of >=0.4.0, new grunt version (1.x.x) is not supported.
Can you please update the needed?

Fix node-coveralls to make it better usable as a library

Currently we have to override coveralls.getOptions to ensure it doesn't try and read from process.argv, because that's what it does by default.

That's not a good default; node-coveralls should probably be updated to provide a library API that doesn't make these assumptions, and a simple command-line wrapper that does, so we can use the library API directly and safely here.

"done without erros" message

Hello, I'm trying to setup my project to work with trevor ci + coveralls.

When I try to execute grunt coveralls here is the output:
screen shot 2015-06-28 at 07 47 39

But nothing happens on coveralls website.

Never says "success", but always sends lcov data

Hey,
I've been trying grunt-coveralls for a few days and It's been a great task!
I've set up grunt coveralls to run on after_success.
However, it's always failing, for apparently no reason:

[warn] "2014-06-19T16:29:29.704Z"  'Repo token could not be determined.  Continuing without it.'
[warn] "2014-06-19T16:29:29.720Z"  'Repo token could not be determined.  Continuing without it.'
[warn] "2014-06-19T16:29:29.733Z"  'Repo token could not be determined.  Continuing without it.'
>> Failed to submit coverage results to coveralls

However, when I look into the coveralls page, the builds are there.

Any suspects? I thought of adding a .coveralls.yml file, but that doesn't seem to be the case, as it never really failed.
Also, I'm sending 3 lcov files, one for each browser I'm testing. Could this be related?

Does not support provide base dir

coverall.js support pass a base if sources are not linked correctly

cat ./coverage/coverage.lcov | ./node_modules/coveralls/bin/coveralls.js src

Bad example in README

Look at the README - Usage

coveralls: {
    options: {
      // LCOV coverage file relevant to every target
      src: 'coverage-results/lcov.info',

      // When true, grunt-coveralls will only print a warning rather than
      // an error, to prevent CI builds from failing unnecessarily (e.g. if
      // coveralls.io is down). Optional, defaults to false.
      force: false
 }
}

I think it should be

coveralls: {
     // LCOV coverage file relevant to every target
    src: 'coverage-results/lcov.info',
    options: {
      // When true, grunt-coveralls will only print a warning rather than
      // an error, to prevent CI builds from failing unnecessarily (e.g. if
      // coveralls.io is down). Optional, defaults to false.
      force: false
    }
}

Publish latest package

I see some warnings with Node.js 0.10 as follows.

$ npm install --save-dev grunt-coveralls                                                                                         
npm WARN engine [email protected]: wanted: {"node":">=0.8.6","npm":"1.1.65"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.10.29","npm":"1.4.21"})
[email protected] node_modules/grunt-coveralls
└── [email protected] ([email protected], [email protected], [email protected], [email protected])

Could you publish the latest package into npmjs.org?

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.