fix: Fix failure rate in public API
Purpose/Motivation
What is the feature? Why is this being done? Apparently, failure_rate was removed in a recent migration. This PR fetches the correct failure rate for users by dividing the number of failed runs by the total number of test runs.
Links to relevant tickets
https://github.com/codecov/engineering-team/issues/3582
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
:rotating_light: Sentry detected 5 potential issues in your recent changes :rotating_light:
Lower risk findings
-
Line 56, api/public/v2/tests/test_test_results_view.py
- The failure_rate is hardcoded to 1.0, which might not always be the case.
-
Line 68, api/public/v2/tests/test_test_results_view.py
- The failure_rate is hardcoded to 1.0, which might not always be the case.
-
Line 100, api/public/v2/tests/test_test_results_view.py
- The failure_rate is hardcoded to 1.0, which might not always be the case.
-
Line 131, api/public/v2/tests/test_test_results_view.py
- The failure_rate is hardcoded to 1.0, which might not always be the case.
-
Line 24, api/public/v2/test_results/serializers.py:
Function is missing a type annotation- Add type annotation for
objparameter inget_failure_ratemethod.
- Add type annotation for
Did you find this useful? React with a :+1: or :-1:
Codecov Report
Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
:white_check_mark: All tests successful. No failed tests found.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| api/public/v2/test_results/serializers.py | 87.50% | 1 Missing :warning: |
:loudspeaker: Thoughts on this report? Let us know!
Codecov Report
Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
Project coverage is 96.43%. Comparing base (
bd7909a) to head (de2a6e7).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| api/public/v2/test_results/serializers.py | 87.50% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main codecov/codecov-api#1302 +/- ##
==========================================
- Coverage 96.43% 96.43% -0.01%
==========================================
Files 488 488
Lines 16975 16982 +7
==========================================
+ Hits 16370 16376 +6
- Misses 605 606 +1
| Flag | Coverage Δ | |
|---|---|---|
| unit | 96.43% <87.50%> (-0.01%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.