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
@@ -122,7 +126,9 @@ func filterByPlatform(specs et.ExtensionTestSpecs) {
122126 selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
123127 }
124128
125- specs .SelectAny (selectFunctions ).Exclude (et .PlatformEquals (platform ))
129+ specs .SelectAny (selectFunctions ).
130+ Exclude (et .PlatformEquals (platform )).
131+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , platform ))
126132 }
127133}
128134
@@ -164,7 +170,9 @@ func filterByExternalConnectivity(specs et.ExtensionTestSpecs) {
164170 selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
165171 }
166172
167- specs .SelectAny (selectFunctions ).Exclude (et .ExternalConnectivityEquals (externalConnectivity ))
173+ specs .SelectAny (selectFunctions ).
174+ Exclude (et .ExternalConnectivityEquals (externalConnectivity )).
175+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , externalConnectivity ))
168176 }
169177}
170178
@@ -193,7 +201,9 @@ func filterByTopology(specs et.ExtensionTestSpecs) {
193201 selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
194202 }
195203
196- specs .SelectAny (selectFunctions ).Exclude (et .TopologyEquals (topology ))
204+ specs .SelectAny (selectFunctions ).
205+ Exclude (et .TopologyEquals (topology )).
206+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , topology ))
197207 }
198208}
199209
@@ -212,7 +222,9 @@ func filterByNoOptionalCapabilities(specs et.ExtensionTestSpecs) {
212222 for _ , exclusion := range exclusions {
213223 selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
214224 }
215- specs .SelectAny (selectFunctions ).Exclude (et .NoOptionalCapabilitiesExist ())
225+ specs .SelectAny (selectFunctions ).
226+ Exclude (et .NoOptionalCapabilitiesExist ()).
227+ AddLabel ("[Skipped:NoOptionalCapabilities]" )
216228}
217229
218230// filterByNetwork is a helper function to do, simple, "NameContains" filtering on tests by network
@@ -225,6 +237,8 @@ func filterByNetwork(specs et.ExtensionTestSpecs) {
225237 selectFunctions = append (selectFunctions , et .NameContains (exclusion ))
226238 }
227239
228- specs .SelectAny (selectFunctions ).Exclude (et .NetworkEquals (network ))
240+ specs .SelectAny (selectFunctions ).
241+ Exclude (et .NetworkEquals (network )).
242+ AddLabel (fmt .Sprintf ("[Skipped:%s]" , network ))
229243 }
230244}
0 commit comments