timurstrekalov / saga

Better code coverage tool for JavaScript.
http://timurstrekalov.github.com/saga/
Other
87 stars 25 forks source link

Can you fail build based on configurable coverage number #97

Open JonCook opened 11 years ago

JonCook commented 11 years ago

For example could I configure my build to fail if coverage isn't 80% or configurable number?

Thanks

cameroncan commented 10 years ago

+1 I'd like to see this as well

simoami commented 10 years ago

I'd want to see a more concrete use case. Are you talking about overall coverage or per test? i.e. every new test requires at least 80% coverage. If it's overall coverage, with big projects, it might take long before one reaches that number, which makes it difficult to enforce this rule from the get go.

I'd suggest looking into incorporating Sonar as part of your CI setup, as it specializes in code quality metrics and has a maven build breaker plugin that can be set to fail your builds based on specific rules.

This way saga can specialize in reporting coverage and sonar or other tools can collect code coverage and decide what to do with it.

JonCook commented 10 years ago

It would be nice to put into the mvn configuration a value representing overall coverage which causes mvn to fail your build if it is not satisfied, that way it would plug straight into tools like jenkins and you wouldn't need to worry about looking at heavy weight tools like sonar for this simple use case.