Skip to content

Commit e1a2a5b

Browse files
committed
Fixsed tests
1 parent 1bd96e5 commit e1a2a5b

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

pkg/alb/rs/rule_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@ func TestRuleReconcile(t *testing.T) {
354354
}
355355

356356
func genTG(arn, svcname string) *tg.TargetGroup {
357+
albelbv2.ELBV2svc = mockedELBV2{}
358+
357359
t, _ := tg.NewCurrentTargetGroup(&tg.NewCurrentTargetGroupOptions{
358360
ALBNamePrefix: "pfx",
359361
LoadBalancerID: "nnnnn",
@@ -755,3 +757,7 @@ func (m mockedELBV2) ModifyRule(input *elbv2.ModifyRuleInput) (*elbv2.ModifyRule
755757
func (m mockedELBV2) DeleteRule(input *elbv2.DeleteRuleInput) (*elbv2.DeleteRuleOutput, error) {
756758
return &m.DeleteRuleOutput, m.DeleteRuleError
757759
}
760+
761+
func (m mockedELBV2) DescribeTargetGroupAttributesFiltered(s *string) (albelbv2.TargetGroupAttributes, error) {
762+
return nil, nil
763+
}

pkg/annotations/annotations_test.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -184,21 +184,6 @@ func TestHealthcheckSecondsValidation(t *testing.T) {
184184
}
185185
}
186186

187-
// Should fail when idle timeout is not in range 1-3600. Should succeed otherwise.
188-
func TestConnectionIdleTimeoutValidation(t *testing.T) {
189-
a := &Annotations{}
190-
191-
err := a.setConnectionIdleTimeout(map[string]string{connectionIdleTimeoutKey: "15"})
192-
if err != nil || a.ConnectionIdleTimeout == aws.Int64(0) {
193-
t.Error("Failed to set connection idle timeout when value was correct.")
194-
}
195-
196-
err = a.setConnectionIdleTimeout(map[string]string{connectionIdleTimeoutKey: "3700"})
197-
if err == nil {
198-
t.Error("Succeeded setting connection idle timeout when value was incorrect")
199-
}
200-
}
201-
202187
func TestSetLoadBalancerAttributes(t *testing.T) {
203188
var tests = []struct {
204189
annotations map[string]string
@@ -299,7 +284,7 @@ func TestSetTargetGroupAttributes(t *testing.T) {
299284
annotations := &Annotations{}
300285
attributes := map[string]string{targetGroupAttributesKey: "deregistration_delay.timeout_seconds=60,stickiness.enabled=true"}
301286
err := annotations.setTargetGroupAttributes(attributes)
302-
if err != nil || len(annotations.TargetGroupAttributes) != 5 {
287+
if err != nil || len(annotations.TargetGroupAttributes) != 2 {
303288
t.Errorf("setTargetGroupAttributes - number of attributes incorrect")
304289
}
305290

0 commit comments

Comments
 (0)