This repository was archived by the owner on Jun 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
types/test_results_aggregates Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -137,3 +137,30 @@ def test_fetch_test_result_skipped_tests(self) -> None:
137137 ]
138138 == 29
139139 )
140+
141+ def test_fetch_test_result_slow_tests (self ) -> None :
142+ query = """
143+ query {
144+ owner(username: "%s") {
145+ repository(name: "%s") {
146+ ... on Repository {
147+ testAnalytics {
148+ testResultsAggregates {
149+ totalSlowTests
150+ }
151+ }
152+ }
153+ }
154+ }
155+ }
156+ """ % (self .owner .username , self .repository .name )
157+
158+ result = self .gql_request (query , owner = self .owner )
159+
160+ assert "errors" not in result
161+ assert (
162+ result ["owner" ]["repository" ]["testAnalytics" ]["testResultsAggregates" ][
163+ "totalSlowTests"
164+ ]
165+ == 1
166+ )
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ class TestResultsAggregates(TypedDict):
1111 total_duration_percent_change : float | None
1212 slowest_tests_duration : float
1313 slowest_tests_duration_percent_change : float | None
14+ total_slow_tests : int
15+ total_slow_tests_percent_change : float | None
1416 fails : int
1517 fails_percent_change : float | None
1618 skips : int
@@ -43,6 +45,18 @@ def resolve_slowest_tests_duration_percent_change(
4345 return obj .get ("slowest_tests_duration_percent_change" )
4446
4547
48+ @test_results_aggregates_bindable .field ("totalSlowTests" )
49+ def resolve_total_slow_tests (obj : TestResultsAggregates , _ : GraphQLResolveInfo ) -> int :
50+ return obj ["total_slow_tests" ]
51+
52+
53+ @test_results_aggregates_bindable .field ("totalSlowTestsPercentChange" )
54+ def resolve_total_slow_tests_percent_change (
55+ obj : TestResultsAggregates , _ : GraphQLResolveInfo
56+ ) -> float | None :
57+ return obj .get ("total_slow_tests_percent_change" )
58+
59+
4660@test_results_aggregates_bindable .field ("totalFails" )
4761def resolve_total_fails (obj : TestResultsAggregates , _ : GraphQLResolveInfo ) -> int :
4862 return obj ["fails" ]
You can’t perform that action at this time.
0 commit comments