mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
Adjusted tests to new behaviour on init and promotion
Signed-off-by: Iaroslav Vorozhko <iaroslav.vorozhko@mcmakler.de>
This commit is contained in:
@@ -42,13 +42,15 @@ func TestIngressRouter_Reconcile(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
canaryAn := "custom.ingress.kubernetes.io/canary"
|
||||
canaryWeightAn := "custom.ingress.kubernetes.io/canary-weight"
|
||||
|
||||
canaryName := fmt.Sprintf("%s-canary", mocks.ingressCanary.Spec.IngressRef.Name)
|
||||
inCanary, err := router.kubeClient.NetworkingV1beta1().Ingresses("default").Get(context.TODO(), canaryName, metav1.GetOptions{})
|
||||
require.NoError(t, err)
|
||||
|
||||
// test initialisation
|
||||
assert.Equal(t, "false", inCanary.Annotations[canaryAn])
|
||||
assert.Equal(t, "true", inCanary.Annotations[canaryAn])
|
||||
assert.Equal(t, "0", inCanary.Annotations[canaryWeightAn])
|
||||
}
|
||||
|
||||
func TestIngressRouter_GetSetRoutes(t *testing.T) {
|
||||
@@ -94,7 +96,8 @@ func TestIngressRouter_GetSetRoutes(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
// test promotion
|
||||
assert.Equal(t, "false", inCanary.Annotations[canaryAn])
|
||||
assert.Equal(t, "true", inCanary.Annotations[canaryAn])
|
||||
assert.Equal(t, "0", inCanary.Annotations[canaryWeightAn])
|
||||
}
|
||||
|
||||
func TestIngressRouter_ABTest(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user