Skip to content

Commit

Permalink
Vary when tests are run
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanrolds committed Jan 25, 2025
1 parent 7e334a3 commit 50f8ecc
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion test/kubernetes/e2e/features/tracing/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/solo-io/gloo/test/gomega/matchers"
"github.com/solo-io/gloo/test/kubernetes/e2e"
testdefaults "github.com/solo-io/gloo/test/kubernetes/e2e/defaults"
"github.com/solo-io/gloo/test/kubernetes/testutils/gloogateway"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
"github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
Expand Down Expand Up @@ -155,6 +156,10 @@ func (s *testingSuite) AfterTest(string, string) {

// BeforeGlooGatewayTest sets up the Gloo Gateway resources
func (s *testingSuite) BeforeGlooGatewayTest() {
if !HasEdgeGateway(s.testInstallation.Metadata) {
s.T().Skip("Installation of Gloo Gateway does not have Edge Gateway enabled, skipping test as there is nothing to test")
}

err := s.testInstallation.Actions.Kubectl().ApplyFile(s.ctx, gatewayConfigManifest,
"-n", s.testInstallation.Metadata.InstallNamespace)
s.NoError(err, "can create gateway and service")
Expand All @@ -178,7 +183,7 @@ func (s *testingSuite) AfterGlooGatewayTest() {

// BeforeK8sGatewayTest sets up the K8s Gateway resources
func (s *testingSuite) BeforeK8sGatewayTest(hloManifest string) {
if !s.testInstallation.Metadata.K8sGatewayEnabled {
if !HasK8sGateway(s.testInstallation.Metadata) {
s.T().Skip("Installation of Gloo Gateway does not have K8s Gateway enabled, skipping test as there is nothing to test")
}

Expand Down Expand Up @@ -392,3 +397,15 @@ func (s *testingSuite) TestK8sGatewayWithOtelTracingGrpcAuthority() {
assert.Regexp(c, `-> authority: Str\(test-authority\)`, logs)
}, time.Second*30, time.Second*3, "otelcol logs contain authority set in gateway")
}

// HasEdgeGateway returns true if the installation has the Edge Gateway enabled
func HasEdgeGateway(c *gloogateway.Context) bool {
return c.ProfileValuesManifestFile == e2e.EdgeGatewayProfilePath ||
c.ProfileValuesManifestFile == e2e.FullGatewayProfilePath
}

// HasK8sGateway returns true if the installation has the K8s Gateway enabled
func HasK8sGateway(c *gloogateway.Context) bool {
return c.ProfileValuesManifestFile == e2e.KubernetesGatewayProfilePath ||
c.K8sGatewayEnabled
}

0 comments on commit 50f8ecc

Please sign in to comment.