Skip to content

Commit

Permalink
fix: truncate floats in test results comment (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-sentry authored Sep 4, 2024
1 parent 9424c8b commit d6ca3e5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion services/test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def messagify_flake(
test_name = wrap_in_code(flaky_failure.testname.replace("\x1f", " "))
formatted_duration = display_duration(flaky_failure.duration_seconds)
flake_rate = flake_info.failed / flake_info.count * 100
flake_rate_section = f"**Flake rate in main:** {flake_rate}% (Passed {flake_info.count - flake_info.failed} times, Failed {flake_info.failed} times)"
flake_rate_section = f"**Flake rate in main:** {flake_rate:.2f}% (Passed {flake_info.count - flake_info.failed} times, Failed {flake_info.failed} times)"
stack_trace_summary = f"Stack Traces | {formatted_duration}s run time"
stack_trace = wrap_in_details(
stack_trace_summary,
Expand Down
2 changes: 1 addition & 1 deletion services/tests/test_test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def test_build_message_with_flake():
> testname
> ```
>
> **Flake rate in main:** 33.33333333333333% (Passed 2 times, Failed 1 times)
> **Flake rate in main:** 33.33% (Passed 2 times, Failed 1 times)
> <details><summary>Stack Traces | 1s run time</summary>
>
> >
Expand Down
2 changes: 1 addition & 1 deletion tasks/tests/unit/test_test_results_finisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ def test_upload_finisher_task_call_with_flaky(
> Other Class Name test_name2
> ```
>
> **Flake rate in main:** 40.0% (Passed 3 times, Failed 2 times)
> **Flake rate in main:** 40.00% (Passed 3 times, Failed 2 times)
> <details><summary>Stack Traces | 3s run time</summary>
>
> > `````````
Expand Down

0 comments on commit d6ca3e5

Please sign in to comment.