Skip to content

Commit f29f6bb

Browse files
committed
Use a test constant instead of importing
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.
1 parent 5b9ae5b commit f29f6bb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

system_tests/system_tests.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ import (
1717
"gopkg.in/ini.v1"
1818

1919
rabbitmqv1beta1 "github.com/rabbitmq/cluster-operator/api/v1beta1"
20-
"github.com/rabbitmq/cluster-operator/internal/resource"
2120
corev1 "k8s.io/api/core/v1"
2221
k8sresource "k8s.io/apimachinery/pkg/api/resource"
2322
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2423
)
2524

26-
const statefulSetSuffix = "server"
25+
const (
26+
statefulSetSuffix = "server"
27+
pluginsConfig = "plugins-conf"
28+
)
2729

2830
var _ = Describe("Operator", func() {
2931
var (
@@ -139,7 +141,7 @@ var _ = Describe("Operator", func() {
139141
})).To(Succeed())
140142

141143
getConfigMapAnnotations := func() map[string]string {
142-
configMapName := cluster.ChildResourceName(resource.PluginsConfig)
144+
configMapName := cluster.ChildResourceName(pluginsConfig)
143145
configMap, err := clientSet.CoreV1().ConfigMaps(cluster.Namespace).Get(ctx, configMapName, metav1.GetOptions{})
144146
Expect(err).ToNot(HaveOccurred())
145147
return configMap.Annotations

0 commit comments

Comments
 (0)