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
@@ -122,7 +126,9 @@ func filterByPlatform(specs et.ExtensionTestSpecs) {
122
126
selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
123
127
}
124
128
125
- specs .SelectAny (selectFunctions ).Exclude (et .PlatformEquals (platform ))
129
+ specs .SelectAny (selectFunctions ).
130
+ Exclude (et .PlatformEquals (platform )).
131
+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , platform ))
126
132
}
127
133
}
128
134
@@ -164,7 +170,9 @@ func filterByExternalConnectivity(specs et.ExtensionTestSpecs) {
164
170
selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
165
171
}
166
172
167
- specs .SelectAny (selectFunctions ).Exclude (et .ExternalConnectivityEquals (externalConnectivity ))
173
+ specs .SelectAny (selectFunctions ).
174
+ Exclude (et .ExternalConnectivityEquals (externalConnectivity )).
175
+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , externalConnectivity ))
168
176
}
169
177
}
170
178
@@ -193,7 +201,9 @@ func filterByTopology(specs et.ExtensionTestSpecs) {
193
201
selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
194
202
}
195
203
196
- specs .SelectAny (selectFunctions ).Exclude (et .TopologyEquals (topology ))
204
+ specs .SelectAny (selectFunctions ).
205
+ Exclude (et .TopologyEquals (topology )).
206
+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , topology ))
197
207
}
198
208
}
199
209
@@ -212,7 +222,9 @@ func filterByNoOptionalCapabilities(specs et.ExtensionTestSpecs) {
212
222
for _ , exclusion := range exclusions {
213
223
selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
214
224
}
215
- specs .SelectAny (selectFunctions ).Exclude (et .NoOptionalCapabilitiesExist ())
225
+ specs .SelectAny (selectFunctions ).
226
+ Exclude (et .NoOptionalCapabilitiesExist ()).
227
+ AddLabel ("[Skipped:NoOptionalCapabilities]" )
216
228
}
217
229
218
230
// filterByNetwork is a helper function to do, simple, "NameContains" filtering on tests by network
@@ -225,6 +237,8 @@ func filterByNetwork(specs et.ExtensionTestSpecs) {
225
237
selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
226
238
}
227
239
228
- specs .SelectAny (selectFunctions ).Exclude (et .NetworkEquals (network ))
240
+ specs .SelectAny (selectFunctions ).
241
+ Exclude (et .NetworkEquals (network )).
242
+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , network ))
229
243
}
230
244
}
0 commit comments