Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add TestResultsHeaders GQL model #816

Merged
merged 2 commits into from
Oct 3, 2024
Merged

Conversation

joseph-sentry
Copy link
Contributor

  • TestResultsHeaders represents the information displayed in the Test
    Analytics UI that is related to test results, total duration of tests,
    accumulated duration of the 5% slowest tests, total number of failures,
    and total number of skips

  • a field of type TestResultsHeaders was added to the Repository model

depends on: #813

Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 94.02985% with 4 lines in your changes missing coverage. Please review.

Project coverage is 96.25%. Comparing base (5b59699) to head (023d1fb).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
utils/test_results.py 78.94% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #816      +/-   ##
==========================================
- Coverage   96.26%   96.25%   -0.02%     
==========================================
  Files         814      816       +2     
  Lines       18689    18741      +52     
==========================================
+ Hits        17991    18039      +48     
- Misses        698      702       +4     
Flag Coverage Δ
unit 92.52% <94.02%> (-0.01%) ⬇️
unit-latest-uploader 92.52% <94.02%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -26,5 +26,10 @@ def resolve_failure_rate(test, info) -> float | None:


@test_result_bindable.field("avgDuration")
def resolve_last_duration(test, info) -> float | None:
def resolve_avg_duration(test, info) -> float | None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we type these?

@@ -0,0 +1,11 @@
from shared.license import get_current_license
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this license stuff? think I wrote this on your other PR but lets clean it up here



@test_results_headers_bindable.field("totalRunTime")
def resolve_name(obj, _) -> float:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we type these?

Copy link
Contributor

@ajay-sentry ajay-sentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! Nice work

@joseph-sentry joseph-sentry force-pushed the joseph/test-results-headers branch from 91d88da to 73ff989 Compare October 2, 2024 19:42
@codecov-notifications
Copy link

codecov-notifications bot commented Oct 2, 2024

Codecov Report

Attention: Patch coverage is 94.02985% with 4 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
utils/test_results.py 78.94% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@joseph-sentry joseph-sentry marked this pull request as ready for review October 2, 2024 20:52
@joseph-sentry joseph-sentry requested a review from a team as a code owner October 2, 2024 20:52
- TestResultsHeaders represents the information displayed in the Test
Analytics UI that is related to test results, total duration of tests,
accumulated duration of the 5% slowest tests, total number of failures,
and total number of skips

- a field of type TestResultsHeaders was added to the Repository model
@joseph-sentry joseph-sentry force-pushed the joseph/test-results-headers branch from 73ff989 to 023d1fb Compare October 3, 2024 13:06
@codecov-qa
Copy link

codecov-qa bot commented Oct 3, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2328 1 2327 6
View the top 1 failed tests by shortest run time
api.internal.tests.test_charts.TestChartQueryRunnerQuery test_query_aggregates_multiple_repository_totals
Stack Traces | 0.065s run time
self = &lt;tests.test_charts.TestChartQueryRunnerQuery testMethod=test_query_aggregates_multiple_repository_totals&gt;

    @override_settings(GITHUB_CLIENT_ID="3d44be0e772666136a13")
    def test_query_aggregates_multiple_repository_totals(self):
        query_runner = ChartQueryRunner(
            user=self.user,
            request_params={
                "owner_username": self.org.username,
                "service": self.org.service,
                "end_date": str(timezone.now()),
                "grouping_unit": "day",
            },
        )
    
        results = query_runner.run_query()
    
        assert len(results) == 1
&gt;       assert results[0]["total_hits"] == 114
E       AssertionError: assert Decimal('100') == 114

.../internal/tests/test_charts.py:564: AssertionError

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

Copy link

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

❌ Failed Test Results:

Completed 2334 tests with 1 failed, 2327 passed and 6 skipped.

View the full list of failed tests

pytest

  • Class name: api.internal.tests.test_charts.TestChartQueryRunnerQuery
    Test name: test_query_aggregates_multiple_repository_totals

    self = <tests.test_charts.TestChartQueryRunnerQuery testMethod=test_query_aggregates_multiple_repository_totals>

    @override_settings(GITHUB_CLIENT_ID="3d44be0e772666136a13")
    def test_query_aggregates_multiple_repository_totals(self):
    query_runner = ChartQueryRunner(
    user=self.user,
    request_params={
    "owner_username": self.org.username,
    "service": self.org.service,
    "end_date": str(timezone.now()),
    "grouping_unit": "day",
    },
    )

    results = query_runner.run_query()

    assert len(results) == 1
    > assert results[0]["total_hits"] == 114
    E AssertionError: assert Decimal('100') == 114

    .../internal/tests/test_charts.py:564: AssertionError

@joseph-sentry joseph-sentry added this pull request to the merge queue Oct 3, 2024
Merged via the queue into main with commit e7aa89a Oct 3, 2024
17 of 20 checks passed
@joseph-sentry joseph-sentry deleted the joseph/test-results-headers branch October 3, 2024 13:58
@joseph-sentry joseph-sentry restored the joseph/test-results-headers branch October 4, 2024 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants