@@ -1046,7 +1046,7 @@ async fn test_build_results() {
1046
1046
. project ( TEST_PROJECT . to_owned ( ) )
1047
1047
. package ( TEST_PACKAGE_2 . to_owned ( ) ) ;
1048
1048
1049
- let results = project. result ( ) . await . unwrap ( ) ;
1049
+ let results = project. result ( Default :: default ( ) ) . await . unwrap ( ) ;
1050
1050
let ( arch1_repo, arch2_repo) = get_results_by_arch ( results) ;
1051
1051
1052
1052
assert_eq ! ( arch1_repo. project, TEST_PROJECT ) ;
@@ -1070,7 +1070,23 @@ async fn test_build_results() {
1070
1070
assert_eq ! ( package2_status. details. as_ref( ) . unwrap( ) , details) ;
1071
1071
assert ! ( package2_status. dirty) ;
1072
1072
1073
- let results = package_2. result ( ) . await . unwrap ( ) ;
1073
+ // Test project filter
1074
+ let results = project
1075
+ . result ( BuildTargerSpec {
1076
+ repository : Some ( TEST_REPO . to_owned ( ) ) ,
1077
+ arch : Some ( TEST_ARCH_1 . to_owned ( ) ) ,
1078
+ } )
1079
+ . await
1080
+ . unwrap ( ) ;
1081
+
1082
+ let arch1_repo = & results. results [ 0 ] ;
1083
+ assert_eq ! ( arch1_repo. project, TEST_PROJECT ) ;
1084
+ assert_eq ! ( arch1_repo. repository, TEST_REPO ) ;
1085
+ assert_eq ! ( arch1_repo. arch, TEST_ARCH_1 ) ;
1086
+ assert_eq ! ( arch1_repo. code, RepositoryCode :: Building ) ;
1087
+ assert_eq ! ( results. results. len( ) , 1 ) ;
1088
+
1089
+ let results = package_2. result ( Default :: default ( ) ) . await . unwrap ( ) ;
1074
1090
let ( arch1_repo, arch2_repo) = get_results_by_arch ( results) ;
1075
1091
1076
1092
assert_eq ! ( arch1_repo. statuses. len( ) , 0 ) ;
@@ -1089,7 +1105,7 @@ async fn test_build_results() {
1089
1105
MockBuildStatus :: new ( MockPackageCode :: Broken ) ,
1090
1106
) ;
1091
1107
1092
- let results = project. result ( ) . await . unwrap ( ) ;
1108
+ let results = project. result ( Default :: default ( ) ) . await . unwrap ( ) ;
1093
1109
let ( arch1_repo, _) = get_results_by_arch ( results) ;
1094
1110
1095
1111
let package2_arch2 = arch1_repo
@@ -1100,14 +1116,30 @@ async fn test_build_results() {
1100
1116
assert_eq ! ( package2_arch2. package, TEST_PACKAGE_2 ) ;
1101
1117
assert_eq ! ( package2_arch2. code, PackageCode :: Broken ) ;
1102
1118
1103
- let results = package_2. result ( ) . await . unwrap ( ) ;
1119
+ let results = package_2. result ( Default :: default ( ) ) . await . unwrap ( ) ;
1104
1120
let ( arch1_repo, arch2_repo) = get_results_by_arch ( results) ;
1105
1121
1106
1122
assert_eq ! ( arch1_repo. statuses. len( ) , 1 ) ;
1107
1123
assert_eq ! ( arch2_repo. statuses. len( ) , 1 ) ;
1108
1124
1109
1125
assert_eq ! ( arch1_repo. statuses[ 0 ] . package, TEST_PACKAGE_2 ) ;
1110
1126
assert_eq ! ( arch2_repo. statuses[ 0 ] . package, TEST_PACKAGE_2 ) ;
1127
+
1128
+ // Test package filter
1129
+ let results = package_2
1130
+ . result ( BuildTargerSpec {
1131
+ repository : Some ( TEST_REPO . to_owned ( ) ) ,
1132
+ arch : Some ( TEST_ARCH_2 . to_owned ( ) ) ,
1133
+ } )
1134
+ . await
1135
+ . unwrap ( ) ;
1136
+
1137
+ let arch2_repo = & results. results [ 0 ] ;
1138
+ assert_eq ! ( arch2_repo. project, TEST_PROJECT ) ;
1139
+ assert_eq ! ( arch2_repo. repository, TEST_REPO ) ;
1140
+ assert_eq ! ( arch2_repo. code, RepositoryCode :: Broken ) ;
1141
+ assert_eq ! ( arch2_repo. statuses. len( ) , 1 ) ;
1142
+ assert_eq ! ( results. results. len( ) , 1 ) ;
1111
1143
}
1112
1144
1113
1145
#[ tokio:: test]
0 commit comments