Coder Social home page Coder Social logo

simonecorsi / lcov-total Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 2.0 2.63 MB

⚙️ Parse LCOV output and return the average value, easily fail CI with a threshold

Home Page: https://www.npmjs.com/package/lcov-total

License: MIT License

JavaScript 97.65% Shell 2.35%
node lcov npm coverage test parser average tdd ci cli

lcov-total's Introduction

Hi there, I am Simone!

discord

Just a sunny Italian guy with a deep passion for technology, skateboarding, punk music, and photography. I consider myself a language-agnostic and battle-tested engineer, with a particular focus on the whole web stack, especially backends.

  • Tech Leader: at Immobiliare.it, Italy's #1 Real Estate Portal. Within the Developer Experience and Technological Advancement team, I contribute as a Senior Software Engineer and Solution Architect. I take pride in collaborating with my team to develop robust B2B/B2C solutions, including APIs, databases, and system integrations.

  • Open Source Advocate: In addition to my responsibilities at Immobiliare.it, I am also one of the founding members of the internal open source committee. By actively fostering collaboration and knowledge sharing, I strive to create a culture of innovation and continuous improvement within the organization.

  • Consulting Background: With a long experience in consulting, I bring a diverse range of knowledge and expertise to my work. Throughout my career, I have had the privilege of leading and contributing to the development of complete solutions for various businesses. This includes frontend and backend development, API design, database management, and system integrations. I have been fortunate to work across industries such as retail, oil, sports, banking, and events.


🧰 Toolbox


Node.js LogoJavaScript LogoTypeScript LogoGO Golang LogoPython LogoPHP LogoBash Logo MongoDB Logo MySQL Logo PostgreSQL Logo RabbitMQ LogoRedis Logo RabbitMQ Logo Kubernetes K8s LogoLaravel LogoApache LogoNGINX Logo AWS LogoDigitalOcean LogoHeroku Logo


📚 Feed


You can find a curated list of all the projects I've starred over the last decade on GitHub at simonecorsi/awesome. It's presented in an easy-to-read format, allowing you to explore my interests and the projects I find valuable.

Would you like to have your own personalized feed? Give my Github Action a try! It generates a feed based on your starred projects, providing a convenient way to showcase your preferences and engage with the community

lcov-total's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar gohar94 avatar semantic-release-bot avatar simonecorsi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

lcov-total's Issues

Issue with --gte=100 returning exit code 1

Currently as per documentation:

If you pass the --gte=value flag you will get an exitCode 0 or 1 based on resulting coverage >= value expression

However the current code is > and not >=

process.exitCode = result > min ? 0 : 1;

Current issue: Passing --gte=100 will return 1 even if lcov-total returns 100%.

Should be:
process.exitCode = result >= min ? 0 : 1;

The automated release is failing 🚨

🚨 The automated release from the main branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


No npm token specified.

An npm token must be created and set in the NPM_TOKEN environment variable on your CI environment.

Please make sure to create an npm token and to set it in the NPM_TOKEN environment variable on your CI environment. The token must allow to publish to the registry https://registry.npmjs.org/.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Different types of coverages

This is more of a question about the reasoning about the different types of coverages and total coverage.

In parser.js, line, function, and branch coverages are counted, but then only lines results are taken into account when counting the total coverage.

Why is branch and function coverage dropped? If only line coverage should be taken into account, why parse lines related to branch and function coverage in the parser? It's extra work that's dropped a few moments down the line.
Can the total() function return 3 numbers (lines, branch, function total coverages), instead of one?

Include option to force thresholds?

Hey Simone,

Thanks for this plugin.
I could see it useful for me in another project if it could not only read the coverage data (lcov-total lcov.info) but also allow to enforce it. Jest for example provide the thresholds rules like this:

{
  "jest": {
    "coverageThreshold": {
      "global": {
        "branches": 80,
        "functions": 80,
        "lines": 80,
        "statements": -10
      }
    }
  }
}

Since lcov-total can already read the data, it could be used in CI to fail/pass according to the thresholds set.

Add flag for CLI comparison

Since CLI outputs only the raw number I wan't to add a way to make asserts to use into a CI, eg:

lcov-total --gte 90
# exit with 0 or 1

The automated release is failing 🚨

🚨 The automated release from the main branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


No npm token specified.

An npm token must be created and set in the NPM_TOKEN environment variable on your CI environment.

Please make sure to create an npm token and to set it in the NPM_TOKEN environment variable on your CI environment. The token must allow to publish to the registry https://registry.npmjs.org/.


Good luck with your project ✨

Your semantic-release bot 📦🚀

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.