Giter VIP home page Giter VIP logo

Comments (6)

nudles avatar nudles commented on June 25, 2024 1

Seems it does not provide the suggestions on how to improve the code coverage.
for example, #797

from singa.

chrishkchris avatar chrishkchris commented on June 25, 2024

@moazreyad It is very strange that the test analyzes the coverage on tensor.h in this PR which is totally unrelated

from singa.

moazreyad avatar moazreyad commented on June 25, 2024

There is a problem in this PR because it installs singa in python 3.6 and executes the test cases from python3.7/site-packages folder which does not work. Please fix this different python versions problem.

Note also that the project coverage threshold can be set in .codecov.yml like this:

coverage:
  status:
    project:
      default:
        # basic
        target: auto
        threshold: 5%

The value of threshold can be chosen by the development team based on the quality needs. In the best case, every PR should not reduce the coverage because this means it either added code without test case or it removed (or disabled) the test cases for existing code. However, if the team think this is too strict requirement, we may choose the threshold to 5% or even more. But this means that a PR can be allowed to pass even if it reduces the code coverage too much.

The PR #795 reduces the coverage by 4.97%, so setting the threshold to 5% should make it pass. But this is not recommended solution. We can use it only if the team thinks it is too strict to keep the coverage change always zero or positive. In this case, we may allow threshold of 1% or 2% to pass. But 5% seems high to me and it means there is a lot of code that was not tested and there is a problem. And thanks to the strict code coverage, we found the different python versions problem. Without the strict coverage check, may be this problem will be hidden and will cause other problems later.

from singa.

nudles avatar nudles commented on June 25, 2024

After fixing the python version issue, code coverage fails again..
I didn't change the source code in this PR #795

from singa.

moazreyad avatar moazreyad commented on June 25, 2024

After fixing the python version issue, code coverage fails again..

The coverage is now decreased by 0.01% instead of 4.97%. It still fails because we did not specify a threshold, so any decrease any in the coverage will make test fails. To solve this problem, either add a small threshold like 0.1 % to allow small drops in coverage generally in all PRs, or leave the threshold decision to each pull request reviewer to decide if the decrease in the specific PR is fine and it can be merged or it is not fine and must be fixed.

Seems it does not provide the suggestions on how to improve the code coverage.

Yes, it just reports the coverage results without suggestions on how to fix. This is similar to all the test cases which report the error but of course they do not usually suggest how to fix it.

To improve the coverage, the developer needs to investigate more how to create the suitable test cases to cover his new code, or how not to prevent current test cases from running (like the problem that we had in #795).

from singa.

nudles avatar nudles commented on June 25, 2024

Thanks for the explanation.
I think we can let the reviewer to determine if the newly added code should be covered by unit tests.

from singa.

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.