Skip to content

Commit

Permalink
[artemiscloud#348] add broken test that shows the need for some conve…
Browse files Browse the repository at this point in the history
…rsion
  • Loading branch information
gtully committed Oct 19, 2022
1 parent 1878b21 commit 5584337
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions controllers/activemqartemis_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"strings"

brokerv2alpha4 "github.com/artemiscloud/activemq-artemis-operator/api/v2alpha4"
"github.com/artemiscloud/activemq-artemis-operator/api/v2alpha5"
"github.com/artemiscloud/activemq-artemis-operator/pkg/resources/environments"
"github.com/artemiscloud/activemq-artemis-operator/pkg/resources/secrets"
ss "github.com/artemiscloud/activemq-artemis-operator/pkg/resources/statefulsets"
Expand Down Expand Up @@ -229,6 +230,46 @@ var _ = Describe("artemis controller", func() {
})
})

Context("CrVersionConversionTest", func() {
It("can reconcile different version", func() {

var float32Var = float32(2.3)
var ma = "all"
toCreate := v2alpha5.ActiveMQArtemis{
TypeMeta: metav1.TypeMeta{
Kind: "ActiveMQArtemis",
APIVersion: v2alpha5.GroupVersion.Identifier(),
},
ObjectMeta: metav1.ObjectMeta{
Name: nameFromTest(),
Namespace: defaultNamespace,
},
Spec: v2alpha5.ActiveMQArtemisSpec{
AddressSettings: v2alpha5.AddressSettingsType{
ApplyRule: &ma,
AddressSetting: []v2alpha5.AddressSettingType{
{
Match: "#",
RedeliveryCollisionAvoidanceFactor: &float32Var,
},
},
},
},
}

By("deploying v2lpha5 with float32")

Expect(k8sClient.Create(context.TODO(), &toCreate)).Should(Succeed())

key := types.NamespacedName{Name: namer.CrToSS(toCreate.Name), Namespace: defaultNamespace}
createdSs := &appsv1.StatefulSet{}
Eventually(func(g Gomega) {
g.Expect(k8sClient.Get(ctx, key, createdSs)).Should(Succeed())
}, timeout, interval).Should(Succeed())

})
})

Context("Console config test", func() {
It("Exposing secured console", Label("console-expose-ssl"), func() {
//we need to use existing cluster to differentiate testing
Expand Down

0 comments on commit 5584337

Please sign in to comment.