@@ -598,64 +598,36 @@ def test_desc_failure_rate_ordering_on_test_results_with_after(self) -> None:
598598 pass_count = 2 ,
599599 fail_count = 3 ,
600600 )
601- res = self .fetch_test_analytics (
602- repo .name ,
603- """testResults(ordering: { parameter: FAILURE_RATE, direction: DESC }, first: 1) { edges { node { name failureRate } }, pageInfo { hasNextPage, hasPreviousPage, startCursor, endCursor }, totalCount }""" ,
604- )
605-
606- assert res ["testResults" ] == {
607- "edges" : [
608- {"node" : {"name" : test_2 .name , "failureRate" : 0.6 }},
609- ],
610- "pageInfo" : {
611- "endCursor" : base64_encode_string (f"0.6|{ test_2 .name } " ),
612- "hasNextPage" : True ,
613- "hasPreviousPage" : False ,
614- "startCursor" : base64_encode_string (f"0.6|{ test_2 .name } " ),
615- },
616- "totalCount" : 2 ,
617- }
618601
619- res = self .fetch_test_analytics (
620- repo .name ,
621- """testResults(ordering: { parameter: FAILURE_RATE, direction: DESC }, first: 1, after: "%s") { edges { node { name failureRate } }, pageInfo { hasNextPage, hasPreviousPage, startCursor, endCursor }, totalCount }"""
622- % res ["testResults" ]["pageInfo" ]["endCursor" ],
602+ test_3 = TestFactory (repository = repo )
603+ _ = DailyTestRollupFactory (
604+ test = test_3 ,
605+ date = datetime .date .today (),
606+ repoid = repo .repoid ,
607+ pass_count = 1 ,
608+ fail_count = 4 ,
623609 )
624-
625- assert res ["testResults" ] == {
626- "edges" : [
627- {"node" : {"name" : test .name , "failureRate" : 0.2 }},
628- ],
629- "pageInfo" : {
630- "endCursor" : base64_encode_string (f"0.2|{ test .name } " ),
631- "hasNextPage" : False ,
632- "hasPreviousPage" : False ,
633- "startCursor" : base64_encode_string (f"0.2|{ test .name } " ),
634- },
635- "totalCount" : 2 ,
636- }
637-
638610 res = self .fetch_test_analytics (
639611 repo .name ,
640- """testResults(ordering: { parameter: FAILURE_RATE, direction: ASC }, first: 1) { edges { node { name failureRate } }, pageInfo { hasNextPage, hasPreviousPage, startCursor, endCursor }, totalCount }""" ,
612+ """testResults(ordering: { parameter: FAILURE_RATE, direction: DESC }, first: 1) { edges { node { name failureRate } }, pageInfo { hasNextPage, hasPreviousPage, startCursor, endCursor }, totalCount }""" ,
641613 )
642614
643615 assert res ["testResults" ] == {
644616 "edges" : [
645- {"node" : {"name" : test .name , "failureRate" : 0.2 }},
617+ {"node" : {"name" : test_3 .name , "failureRate" : 0.8 }},
646618 ],
647619 "pageInfo" : {
648- "endCursor" : base64_encode_string (f"0.2| { test .name } " ),
620+ "endCursor" : base64_encode_string (f"0.8| { test_3 .name } " ),
649621 "hasNextPage" : True ,
650622 "hasPreviousPage" : False ,
651- "startCursor" : base64_encode_string (f"0.2| { test .name } " ),
623+ "startCursor" : base64_encode_string (f"0.8| { test_3 .name } " ),
652624 },
653- "totalCount" : 2 ,
625+ "totalCount" : 3 ,
654626 }
655627
656628 res = self .fetch_test_analytics (
657629 repo .name ,
658- """testResults(ordering: { parameter: FAILURE_RATE, direction: ASC }, first: 1, after: "%s") { edges { node { name failureRate } }, pageInfo { hasNextPage, hasPreviousPage, startCursor, endCursor }, totalCount }"""
630+ """testResults(ordering: { parameter: FAILURE_RATE, direction: DESC }, first: 1, after: "%s") { edges { node { name failureRate } }, pageInfo { hasNextPage, hasPreviousPage, startCursor, endCursor }, totalCount }"""
659631 % res ["testResults" ]["pageInfo" ]["endCursor" ],
660632 )
661633
@@ -665,48 +637,30 @@ def test_desc_failure_rate_ordering_on_test_results_with_after(self) -> None:
665637 ],
666638 "pageInfo" : {
667639 "endCursor" : base64_encode_string (f"0.6|{ test_2 .name } " ),
668- "hasNextPage" : False ,
640+ "hasNextPage" : True ,
669641 "hasPreviousPage" : False ,
670642 "startCursor" : base64_encode_string (f"0.6|{ test_2 .name } " ),
671643 },
672- "totalCount" : 2 ,
644+ "totalCount" : 3 ,
673645 }
674646
675647 res = self .fetch_test_analytics (
676648 repo .name ,
677- """testResults(ordering: { parameter: FAILURE_RATE, direction: ASC }, last: 2) { edges { node { name failureRate } }, pageInfo { hasNextPage, hasPreviousPage, startCursor, endCursor }, totalCount }""" ,
649+ """testResults(ordering: { parameter: FAILURE_RATE, direction: DESC }, first: 1, after: "%s") { edges { node { name failureRate } }, pageInfo { hasNextPage, hasPreviousPage, startCursor, endCursor }, totalCount }"""
650+ % res ["testResults" ]["pageInfo" ]["endCursor" ],
678651 )
679652
680653 assert res ["testResults" ] == {
681654 "edges" : [
682- {"node" : {"name" : test_2 .name , "failureRate" : 0.6 }},
683655 {"node" : {"name" : test .name , "failureRate" : 0.2 }},
684656 ],
685657 "pageInfo" : {
686658 "endCursor" : base64_encode_string (f"0.2|{ test .name } " ),
687659 "hasNextPage" : False ,
688660 "hasPreviousPage" : False ,
689- "startCursor" : base64_encode_string (f"0.6|{ test_2 .name } " ),
690- },
691- "totalCount" : 2 ,
692- }
693-
694- res = self .fetch_test_analytics (
695- repo .name ,
696- """testResults(ordering: { parameter: FAILURE_RATE, direction: ASC }, last: 1) { edges { node { name failureRate } }, pageInfo { hasNextPage, hasPreviousPage, startCursor, endCursor }, totalCount }""" ,
697- )
698-
699- assert res ["testResults" ] == {
700- "edges" : [
701- {"node" : {"name" : test_2 .name , "failureRate" : 0.6 }},
702- ],
703- "pageInfo" : {
704- "endCursor" : base64_encode_string (f"0.6|{ test_2 .name } " ),
705- "hasNextPage" : False ,
706- "hasPreviousPage" : True ,
707- "startCursor" : base64_encode_string (f"0.6|{ test_2 .name } " ),
661+ "startCursor" : base64_encode_string (f"0.2|{ test .name } " ),
708662 },
709- "totalCount" : 2 ,
663+ "totalCount" : 3 ,
710664 }
711665
712666 def test_flake_rate_filtering_on_test_results (self ) -> None :
0 commit comments