@@ -1163,6 +1163,34 @@ def test_test_suites(self) -> None:
11631163 )
11641164 assert res ["testSuites" ] == ["hello_world" ]
11651165
1166+ def test_test_suites_no_term (self ) -> None :
1167+ repo = RepositoryFactory (author = self .owner , active = True , private = True )
1168+ test = TestFactory (repository = repo , testsuite = "hello_world" )
1169+ test2 = TestFactory (repository = repo , testsuite = "goodbye_world" )
1170+
1171+ repo_flag = RepositoryFlagFactory (repository = repo , flag_name = "hello_world" )
1172+
1173+ _ = TestFlagBridgeFactory (flag = repo_flag , test = test )
1174+ _ = DailyTestRollupFactory (
1175+ test = test ,
1176+ created_at = datetime .datetime .now (),
1177+ repoid = repo .repoid ,
1178+ branch = "main" ,
1179+ avg_duration_seconds = 0.1 ,
1180+ )
1181+ _ = DailyTestRollupFactory (
1182+ test = test2 ,
1183+ created_at = datetime .datetime .now (),
1184+ repoid = repo .repoid ,
1185+ branch = "main" ,
1186+ avg_duration_seconds = 20.0 ,
1187+ )
1188+ res = self .fetch_test_analytics (
1189+ repo .name ,
1190+ """testSuites""" ,
1191+ )
1192+ assert sorted (res ["testSuites" ]) == ["goodbye_world" , "hello_world" ]
1193+
11661194 def test_flags (self ) -> None :
11671195 repo = RepositoryFactory (author = self .owner , active = True , private = True )
11681196 test = TestFactory (repository = repo )
@@ -1179,3 +1207,20 @@ def test_flags(self) -> None:
11791207 """flags(term: "hello")""" ,
11801208 )
11811209 assert res ["flags" ] == ["hello_world" ]
1210+
1211+ def test_flags_no_term (self ) -> None :
1212+ repo = RepositoryFactory (author = self .owner , active = True , private = True )
1213+ test = TestFactory (repository = repo )
1214+ test2 = TestFactory (repository = repo )
1215+
1216+ repo_flag = RepositoryFlagFactory (repository = repo , flag_name = "hello_world" )
1217+ repo_flag2 = RepositoryFlagFactory (repository = repo , flag_name = "goodbye_world" )
1218+
1219+ _ = TestFlagBridgeFactory (flag = repo_flag , test = test )
1220+ _ = TestFlagBridgeFactory (flag = repo_flag2 , test = test2 )
1221+
1222+ res = self .fetch_test_analytics (
1223+ repo .name ,
1224+ """flags""" ,
1225+ )
1226+ assert sorted (res ["flags" ]) == ["goodbye_world" , "hello_world" ]
0 commit comments