@@ -61,7 +61,7 @@ var _ = BeforeEach(func() {
6161 getClients ()
6262})
6363
64- var _ = Describe ("Helm chart:" , func () {
64+ var _ = Describe ("Helm chart:" , Ordered , func () {
6565 BeforeEach (func () {
6666 if only != "" && only != suitePi {
6767 Skip ("Skipping podinfo" )
@@ -89,9 +89,9 @@ var _ = Describe("Helm chart:", func() {
8989 It ("keda-otel-scaler should be possible to install" , func () {
9090 pwd , err := os .Getwd ()
9191 Expect (err ).NotTo (HaveOccurred ())
92- _ , err = execCmdOE (" helm dependency build" , pwd + "/../helmchart/otel-add-on" )
92+ _ , err = execCmdOE (ctx . helm + " dependency build" , pwd + "/../helmchart/otel-add-on" )
9393 Expect (err ).NotTo (HaveOccurred ())
94- cmd := " helm upgrade -i keda-otel-scaler ../helmchart/otel-add-on --namespace keda --create-namespace -f ./testdata/scaler-values.yaml"
94+ cmd := ctx . helm + " upgrade -i keda-otel-scaler ../helmchart/otel-add-on --namespace keda --create-namespace -f ./testdata/scaler-values.yaml"
9595 if len (otelScalerVersion ) > 0 {
9696 cmd += fmt .Sprintf (" --set image.tag=%s" , otelScalerVersion )
9797 }
@@ -119,8 +119,8 @@ var _ = Describe("Helm chart:", func() {
119119 waitForDeployment ("keda-otel-scaler" , "keda" , defaultTimeoutSec )
120120 })
121121 })
122- Context ("Scaled Object" , func () {
123- When ("is created" , func () {
122+ Context ("Scaled Object" , Ordered , func () {
123+ When ("is created" , Ordered , func () {
124124 It ("should not fail" , func () {
125125 _ , err := kapply ("./testdata/podinfo-so.yaml" )
126126 Expect (err ).NotTo (HaveOccurred ())
@@ -137,30 +137,31 @@ var _ = Describe("Helm chart:", func() {
137137 for {
138138 select {
139139 case <- cancelHey :
140+ //Expect(execCmdE("pkill hey")).NotTo(HaveOccurred())
140141 return
141142 default :
142- hey ("-z 60s http://localhost:8181/delay/1 " )
143+ hey ("-z 40s http://localhost:8181" )
143144 }
144145 }
145146 }()
146147 time .Sleep (1 * time .Second )
147148 ctx .t .Logf (" ->>> Waiting for KEDA to scale the podinfo deployement <<<-\n \n " )
148- ctx1min , _ := context .WithTimeout (context .TODO (), time .Minute )
149+ ctx2min , _ := context .WithTimeout (context .TODO (), 2 * time .Minute )
149150 Eventually (func (g Gomega ) {
150151 out , err := kubectl ("get hpa keda-hpa-podinfo-pull-example -ojsonpath='{.status.desiredReplicas}'" )
151152 g .Expect (err ).Should (Not (HaveOccurred ()))
152- desiredReplicas , err := strconv .Atoi (strings .Trim (out , "'" ))
153+ currentReplicas , err := strconv .Atoi (strings .Trim (out , "'" ))
153154 g .Expect (err ).Should (Not (HaveOccurred ()))
154- g .Expect (desiredReplicas ).Should (And (BeNumerically (">" , minReplicas ), BeNumerically ("<=" , maxReplicas )))
155- ctx .t .Logf ("\n ->>> Pod info successfully scaled to %d <<<-\n \n " , desiredReplicas )
155+ g .Expect (currentReplicas ).Should (And (BeNumerically (">" , minReplicas ), BeNumerically ("<=" , maxReplicas )), fmt . Sprintf ( "# of replicas for podinfo (%d) should be > %d and <= %d" , currentReplicas , minReplicas , maxReplicas ))
156+ ctx .t .Logf ("\n ->>> Pod info successfully scaled to %d <<<-\n \n " , currentReplicas )
156157 GinkgoWriter .Println (" ->>> Pod info successfully scaled to" )
157158 cancelHey <- true
158159 }).WithPolling (3 * time .Second ).
159- WithContext (ctx1min ).
160+ WithContext (ctx2min ).
160161 Should (Succeed ())
161162 })
162163 time .Sleep (10 * time .Second )
163- ctx10min , _ := context .WithTimeout (context .TODO (), 10 * time .Minute )
164+ ctx15min , _ := context .WithTimeout (context .TODO (), 15 * time .Minute )
164165 It ("should eventually scale the podinfo back from N -> 1" , func () {
165166 Eventually (func (g Gomega ) {
166167 out , err := kubectl ("get hpa keda-hpa-podinfo-pull-example -ojsonpath='{.status.desiredReplicas}'" )
@@ -169,7 +170,7 @@ var _ = Describe("Helm chart:", func() {
169170 g .Expect (err ).Should (Not (HaveOccurred ()))
170171 g .Expect (desiredReplicas ).Should (Equal (minReplicas ))
171172 ctx .t .Logf ("\n ->>> Pod info successfuly scaled back to %d <<<-\n \n " , desiredReplicas )
172- }).WithPolling (5 * time .Second ).WithTimeout (10 * time .Minute ).WithContext (ctx10min ).Should (Succeed ())
173+ }).WithPolling (5 * time .Second ).WithTimeout (10 * time .Minute ).WithContext (ctx15min ).Should (Succeed ())
173174 })
174175 })
175176 })
@@ -192,9 +193,10 @@ var _ = ReportAfterSuite("ReportAfterSuite", func(report Report) {
192193
193194func PrintLogs () {
194195 if printLogs == "true" {
195- wrapInSection ("HPA" , "get hpa keda-hpa-podinfo-pull-example -oyaml" )
196- wrapInSection ("SO" , "get so podinfo-pull-example -oyaml" )
197- wrapInSection ("PODS" , "get pods -A" )
196+ wrapInSection ("HPA brief" , "get hpa -A" )
197+ wrapInSection ("HPA full" , "get hpa -A -oyaml" )
198+ wrapInSection ("SO brief" , "get so -A" )
199+ wrapInSection ("SO full" , "get so -A -oyaml" )
198200 for _ , nameAndNs := range []string {"podinfo -ndefault" ,
199201 "keda-operator -nkeda" ,
200202 "otelCollector -nkeda" ,
0 commit comments