11package main
22
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+ )
48
59// addEnvironmentSelectors adds the environmentSelector field to appropriate specs to facilitate including or excluding
610// them based on attributes of the cluster they are running on
@@ -16,11 +20,11 @@ func addEnvironmentSelectors(specs et.ExtensionTestSpecs) {
1620 specs .SelectAny ([]et.SelectFunction { // Since these must use "NameContainsAll" they cannot be included in filterByPlatform
1721 et .NameContainsAll ("[sig-network] LoadBalancers [Feature:LoadBalancer]" , "UDP" ),
1822 et .NameContainsAll ("[sig-network] LoadBalancers [Feature:LoadBalancer]" , "session affinity" ),
19- }).Exclude (et .PlatformEquals ("aws" ))
23+ }).Exclude (et .PlatformEquals ("aws" )). AddLabel ( "[Skipped:aws]" )
2024
2125 specs .SelectAny ([]et.SelectFunction { // Since these must use "NameContainsAll" they cannot be included in filterByNetwork
2226 et .NameContainsAll ("NetworkPolicy" , "named port" ),
23- }).Exclude (et .NetworkEquals ("OVNKubernetes" ))
27+ }).Exclude (et .NetworkEquals ("OVNKubernetes" )). AddLabel ( "[Skipped:Network/OVNKubernetes]" )
2428}
2529
2630// filterByPlatform is a helper function to do, simple, "NameContains" filtering on tests by platform
@@ -127,7 +131,9 @@ func filterByPlatform(specs et.ExtensionTestSpecs) {
127131 selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
128132 }
129133
130- specs .SelectAny (selectFunctions ).Exclude (et .PlatformEquals (platform ))
134+ specs .SelectAny (selectFunctions ).
135+ Exclude (et .PlatformEquals (platform )).
136+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , platform ))
131137 }
132138}
133139
@@ -169,7 +175,9 @@ func filterByExternalConnectivity(specs et.ExtensionTestSpecs) {
169175 selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
170176 }
171177
172- specs .SelectAny (selectFunctions ).Exclude (et .ExternalConnectivityEquals (externalConnectivity ))
178+ specs .SelectAny (selectFunctions ).
179+ Exclude (et .ExternalConnectivityEquals (externalConnectivity )).
180+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , externalConnectivity ))
173181 }
174182}
175183
@@ -198,7 +206,9 @@ func filterByTopology(specs et.ExtensionTestSpecs) {
198206 selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
199207 }
200208
201- specs .SelectAny (selectFunctions ).Exclude (et .TopologyEquals (topology ))
209+ specs .SelectAny (selectFunctions ).
210+ Exclude (et .TopologyEquals (topology )).
211+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , topology ))
202212 }
203213}
204214
@@ -217,7 +227,9 @@ func filterByNoOptionalCapabilities(specs et.ExtensionTestSpecs) {
217227 for _ , exclusion := range exclusions {
218228 selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
219229 }
220- specs .SelectAny (selectFunctions ).Exclude (et .NoOptionalCapabilitiesExist ())
230+ specs .SelectAny (selectFunctions ).
231+ Exclude (et .NoOptionalCapabilitiesExist ()).
232+ AddLabel ("[Skipped:NoOptionalCapabilities]" )
221233}
222234
223235// filterByNetwork is a helper function to do, simple, "NameContains" filtering on tests by network
@@ -230,6 +242,8 @@ func filterByNetwork(specs et.ExtensionTestSpecs) {
230242 selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
231243 }
232244
233- specs .SelectAny (selectFunctions ).Exclude (et .NetworkEquals (network ))
245+ specs .SelectAny (selectFunctions ).
246+ Exclude (et .NetworkEquals (network )).
247+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , network ))
234248 }
235249}
0 commit comments