1
1
package main
2
2
3
- import et "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"
3
+ import (
4
+ "fmt"
5
+
6
+ et "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"
7
+ )
4
8
5
9
// addEnvironmentSelectors adds the environmentSelector field to appropriate specs to facilitate including or excluding
6
10
// them based on attributes of the cluster they are running on
@@ -16,11 +20,11 @@ func addEnvironmentSelectors(specs et.ExtensionTestSpecs) {
16
20
specs .SelectAny ([]et.SelectFunction { // Since these must use "NameContainsAll" they cannot be included in filterByPlatform
17
21
et .NameContainsAll ("[sig-network] LoadBalancers [Feature:LoadBalancer]" , "UDP" ),
18
22
et .NameContainsAll ("[sig-network] LoadBalancers [Feature:LoadBalancer]" , "session affinity" ),
19
- }).Exclude (et .PlatformEquals ("aws" ))
23
+ }).Exclude (et .PlatformEquals ("aws" )). AddLabel ( "[Skipped:aws]" )
20
24
21
25
specs .SelectAny ([]et.SelectFunction { // Since these must use "NameContainsAll" they cannot be included in filterByNetwork
22
26
et .NameContainsAll ("NetworkPolicy" , "named port" ),
23
- }).Exclude (et .NetworkEquals ("OVNKubernetes" ))
27
+ }).Exclude (et .NetworkEquals ("OVNKubernetes" )). AddLabel ( "[Skipped:Network/OVNKubernetes]" )
24
28
}
25
29
26
30
// filterByPlatform is a helper function to do, simple, "NameContains" filtering on tests by platform
@@ -127,7 +131,9 @@ func filterByPlatform(specs et.ExtensionTestSpecs) {
127
131
selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
128
132
}
129
133
130
- specs .SelectAny (selectFunctions ).Exclude (et .PlatformEquals (platform ))
134
+ specs .SelectAny (selectFunctions ).
135
+ Exclude (et .PlatformEquals (platform )).
136
+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , platform ))
131
137
}
132
138
}
133
139
@@ -169,7 +175,9 @@ func filterByExternalConnectivity(specs et.ExtensionTestSpecs) {
169
175
selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
170
176
}
171
177
172
- specs .SelectAny (selectFunctions ).Exclude (et .ExternalConnectivityEquals (externalConnectivity ))
178
+ specs .SelectAny (selectFunctions ).
179
+ Exclude (et .ExternalConnectivityEquals (externalConnectivity )).
180
+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , externalConnectivity ))
173
181
}
174
182
}
175
183
@@ -198,7 +206,9 @@ func filterByTopology(specs et.ExtensionTestSpecs) {
198
206
selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
199
207
}
200
208
201
- specs .SelectAny (selectFunctions ).Exclude (et .TopologyEquals (topology ))
209
+ specs .SelectAny (selectFunctions ).
210
+ Exclude (et .TopologyEquals (topology )).
211
+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , topology ))
202
212
}
203
213
}
204
214
@@ -217,7 +227,9 @@ func filterByNoOptionalCapabilities(specs et.ExtensionTestSpecs) {
217
227
for _ , exclusion := range exclusions {
218
228
selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
219
229
}
220
- specs .SelectAny (selectFunctions ).Exclude (et .NoOptionalCapabilitiesExist ())
230
+ specs .SelectAny (selectFunctions ).
231
+ Exclude (et .NoOptionalCapabilitiesExist ()).
232
+ AddLabel ("[Skipped:NoOptionalCapabilities]" )
221
233
}
222
234
223
235
// filterByNetwork is a helper function to do, simple, "NameContains" filtering on tests by network
@@ -230,6 +242,8 @@ func filterByNetwork(specs et.ExtensionTestSpecs) {
230
242
selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
231
243
}
232
244
233
- specs .SelectAny (selectFunctions ).Exclude (et .NetworkEquals (network ))
245
+ specs .SelectAny (selectFunctions ).
246
+ Exclude (et .NetworkEquals (network )).
247
+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , network ))
234
248
}
235
249
}
0 commit comments