scrapinghub / spidermon

Scrapy Extension for monitoring spiders execution.
https://spidermon.readthedocs.io
BSD 3-Clause "New" or "Revised" License
526 stars 94 forks source link

round the actual coverage to 2 decimal pieces #400

Open HassanQamar07 opened 1 year ago

HassanQamar07 commented 1 year ago

Sometimes the monitor raises issues if the coverage is slightly less than the desired which if rounded to 2 decimal places makes it fine. This PR fixes that issue

Example

dict/booking_link (expected 0.08, got 0.07997638758000722)
dict/domain (expected 0.62, got 0.5835189512442064)
dict/hotel_details (expected 0.01, got 0.007963674008471044)
dict/location_summary (expected 0.01, got 0.009283902565485929)
dict/opening_hours (expected 0.6, got 0.5595103926177906)
dict/phone (expected 0.84, got 0.8263806609375602)
dict/review_count_by_star (expected 0.99, got 0.6119096457086003)
dict/website (expected 0.62, got 0.5835189512442064)

the validation for dict/booking_link, dict/hotel_details, dict/location_summary and dict/opening_hours could be skipped as the expected is slightly less than the actual which if rounded should not raise the error.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (44d5316) 76.54% compared to head (f5dff16) 76.54%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #400 +/- ## ======================================= Coverage 76.54% 76.54% ======================================= Files 76 76 Lines 3214 3214 Branches 384 384 ======================================= Hits 2460 2460 Misses 683 683 Partials 71 71 ``` | [Impacted Files](https://app.codecov.io/gh/scrapinghub/spidermon/pull/400?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub) | Coverage Δ | | |---|---|---| | [spidermon/contrib/scrapy/monitors/monitors.py](https://app.codecov.io/gh/scrapinghub/spidermon/pull/400?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub#diff-c3BpZGVybW9uL2NvbnRyaWIvc2NyYXB5L21vbml0b3JzL21vbml0b3JzLnB5) | `97.89% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.