Skip to content

Commit

Permalink
add example and e2e-test for serviceType
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Schneider <github@simon-schneider.eu>
  • Loading branch information
sschne committed Nov 5, 2020
1 parent 79b9d82 commit 0867f39
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
9 changes: 9 additions & 0 deletions examples/service-types.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: service-types
spec:
query:
serviceType: LoadBalancer
collector:
serviceType: LoadBalancer
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,7 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
Expand Down Expand Up @@ -1582,4 +1583,4 @@ sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
sourcegraph.com/sqs/pbtypes v1.0.0/go.mod h1:3AciMUv4qUuRHRHhOG4TZOB+72GdPVz5k+c648qsFS4=
sourcegraph.com/sqs/pbtypes v1.0.0/go.mod h1:3AciMUv4qUuRHRHhOG4TZOB+72GdPVz5k+c648qsFS4=
22 changes: 22 additions & 0 deletions test/e2e/examples2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
package e2e

import (
"context"
"fmt"
"testing"

"github.com/sirupsen/logrus"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

framework "github.com/operator-framework/operator-sdk/pkg/test"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -63,6 +66,25 @@ func (suite *ExamplesTestSuite2) TestWithBadgerAndVolumeExample() {
smokeTestAllInOneExample("with-badger-and-volume", "../../examples/with-badger-and-volume.yaml")
}

func (suite *ExamplesTestSuite2) TestServiceTypesExample() {
yamlFileName := "../../examples/service-types.yaml"
name := "service-types"
jaegerInstance := createJaegerInstanceFromFile(name, yamlFileName)
defer undeployJaegerInstance(jaegerInstance)

err := WaitForDeployment(t, fw.KubeClient, namespace, name, 1, retryInterval, timeout)
require.NoErrorf(t, err, "Error waiting for %s to deploy", name)

AllInOneSmokeTest(name)

collectorService, err := fw.KubeClient.CoreV1().Services(namespace).Get(context.Background(), fmt.Sprintf("%s-collector", name), v1.GetOptions{})
require.NoError(t, err)
require.Equal(t, "LoadBalancer", string(collectorService.Spec.Type))
queryService, err := fw.KubeClient.CoreV1().Services(namespace).Get(context.Background(), fmt.Sprintf("%s-query", name), v1.GetOptions{})
require.NoError(t, err)
require.Equal(t, "LoadBalancer", string(queryService.Spec.Type))
}

func (suite *ExamplesTestSuite2) TestSimpleProdWithVolumes() {
yamlFileName := "../../examples/simple-prod-with-volumes.yaml"
smokeTestProductionExample("simple-prod", yamlFileName)
Expand Down

0 comments on commit 0867f39

Please sign in to comment.