Coverage/Coveralls issue

In one of my PR the coverage check has failed(Coverage decreased (-0.006%) to 59.566%). I am not really sure what that implies and would like to get some help in solving it. Thank you :slight_smile:

1 Like

Code coverage doesn’t tell you anything about the quality of your tests. It only counts what lines of code are executed during tests and what aren’t. when you do not write code in a ‘testable’ way, you cannot write unit tests for your code, which means, you cannot have 100% coverage.

1 Like

My PR was related to fixing a randomly failing test so i altered the corresponding function where the error was happening . So how far is it accepted to have slightly reduced coverage in this scenario?

Coverage is generated automatically after making the PR.

Did you create a test to confirm that your change fixes the reported problem?

The issue was to fix an existing test. I ran the test several times but the issue never occurred and so thought the issue to be fixed

@dkayiwa sir, I wanted to generate Lucene index for person class, for that, I added @Indexed annotation to Person class. This is my PR:

PR showing coverage failed (Coverage decreased (-0.02%) to 59.838%), what should I do to solve this problem?

It means the pull request you made, you added some code without any unit test. Adding a unit test can help to increase test coverage.

@jwnasambu, I just add @Indexed annotation in Person and Patient class, which lead to the gerneration of Lucene indexes of the Person class. What kind of unit test I can add here?

Thanks, @jwnasambu, I did some research and create unit tests, which help me to solve coverage issue.:grinning:

1 Like

I’m encountering coveralls failure on this PR although I have added tests for the newly written code. Any help is appreciated. Thank you :slight_smile:

Adding more unit tests causes Coveralls coverage to decrease too this link has more explanation.

Thank you @jwnasambu :smiley: This solved my problem