Skip to content

Commit

Permalink
fix: address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-sentry committed Sep 23, 2024
1 parent 6d8e6c4 commit 38e3927
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tasks/process_flakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ def update_passed_flakes(

def upsert_failed_flake(
test_instance: TestInstance,
repo_id: int,
flake: Flake | None,
repo_id: int,
) -> Flake:
if flake is None:
flake = Flake(
Expand Down
11 changes: 10 additions & 1 deletion tasks/test_results_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ def _bulk_write_tests_to_db(

def update_daily_total():
daily_totals[test_id]["last_duration_seconds"] = duration_seconds

Check warning on line 168 in tasks/test_results_processor.py

View check run for this annotation

Codecov Notifications / codecov/patch

tasks/test_results_processor.py#L167-L168

Added lines #L167 - L168 were not covered by tests

# logic below is a little complicated but we're basically doing:

# (old_avg * num of values used to compute old avg) + new value
# -------------------------------------------------------------
# num of values used to compute old avg + 1
daily_totals[test_id]["avg_duration_seconds"] = (

Check warning on line 175 in tasks/test_results_processor.py

View check run for this annotation

Codecov Notifications / codecov/patch

tasks/test_results_processor.py#L175

Added line #L175 was not covered by tests
daily_totals[test_id]["avg_duration_seconds"]
* (
Expand Down Expand Up @@ -198,7 +204,10 @@ def create_daily_total():
else 0,
"skip_count": 1 if outcome == str(Outcome.Skip) else 0,
"flaky_fail_count": 1
if test_id in flaky_test_set and outcome == str(Outcome.Failure)
if test_id in flaky_test_set
and (
outcome == str(Outcome.Failure) or outcome == str(Outcome.Error)
)
else 0,
"branch": branch,
"date": date.today(),
Expand Down

0 comments on commit 38e3927

Please sign in to comment.