Skip to content

Commit

Permalink
Use a test constant instead of importing
Browse files Browse the repository at this point in the history
Because importing an internal library into the tests guarantees that the
test will always pass; this weakens the test slightly, as we want this
test to become red if we change the resource name because it would be a
user facing change i.e. a change in the expectation of what our product
creates.
  • Loading branch information
Zerpet committed Sep 15, 2020
1 parent 5b9ae5b commit f29f6bb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions system_tests/system_tests.go
Expand Up @@ -17,13 +17,15 @@ import (
"gopkg.in/ini.v1"

rabbitmqv1beta1 "github.com/rabbitmq/cluster-operator/api/v1beta1"
"github.com/rabbitmq/cluster-operator/internal/resource"
corev1 "k8s.io/api/core/v1"
k8sresource "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const statefulSetSuffix = "server"
const (
statefulSetSuffix = "server"
pluginsConfig = "plugins-conf"
)

var _ = Describe("Operator", func() {
var (
Expand Down Expand Up @@ -139,7 +141,7 @@ var _ = Describe("Operator", func() {
})).To(Succeed())

getConfigMapAnnotations := func() map[string]string {
configMapName := cluster.ChildResourceName(resource.PluginsConfig)
configMapName := cluster.ChildResourceName(pluginsConfig)
configMap, err := clientSet.CoreV1().ConfigMaps(cluster.Namespace).Get(ctx, configMapName, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
return configMap.Annotations
Expand Down

0 comments on commit f29f6bb

Please sign in to comment.