wmedvede commented on code in PR #3433:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3433#discussion_r2832845252


##########
packages/sonataflow-operator/test/e2e/platform_test.go:
##########
@@ -468,4 +468,77 @@ var _ = Describe("Platform Use Cases :: ", 
Label("platform"), Ordered, func() {
                Entry("and with broker and platform in the same namespace", 
test.GetPathFromE2EDirectory("platform", "services", "gitops", "knative", 
"platform-level-broker"), false),
                Entry("and with broker and platform in a separate namespace", 
test.GetPathFromE2EDirectory("platform", "services", "gitops", "knative", 
"platform-level-broker"), true),
        )
+
+       DescribeTable("when deploying a SonataFlowPlatform combined with HPA 
for the Data Index", func(testcaseDir string, dataIndexHPAPath string, 
createHPABeforePlatform bool) {
+               if createHPABeforePlatform {
+                       By("Create the data index HPA before the platform")
+                       EventuallyWithOffset(1, func() error {
+                               return 
kubectlApplyFileOnCluster(dataIndexHPAPath, targetNamespace)
+                       }, 3*time.Minute, time.Second).Should(Succeed())
+               }
+
+               By("Deploy the platform and database CRs")
+               EventuallyWithOffset(1, func() error {
+                       return kubectlApplyKustomizeOnCluster(testcaseDir, 
targetNamespace)
+               }, 2*time.Minute, time.Second).Should(Succeed())
+
+               By("Wait for SonataFlowPlatform CR to complete deployments")
+               EventuallyWithOffset(1, func() error {
+                       return 
verifyDataIndexAndJobsServiceAreReady(targetNamespace, "5s")
+               }, 10*time.Minute, 5).Should(Succeed())
+
+               By("Evaluate status of all service's health endpoint")
+               verifyDataIndexAndJobsServiceAreHealthy(targetNamespace)
+
+               if createHPABeforePlatform {
+                       By("Check that the Data Index deployment has 3 replicas 
since the HPA was already created")
+                       EventuallyWithOffset(3, func() bool {
+                               return 
verifyDeploymentReplicas("sonataflow-platform-data-index-service", 
targetNamespace, int32(3))
+                       }, 3*time.Minute, 30*time.Second).Should(BeTrue())
+               } else {
+                       By("Check that the Data Index deployment has 1 replica 
before creating the HPA")
+                       EventuallyWithOffset(1, func() bool {
+                               return 
verifyDeploymentReplicas("sonataflow-platform-data-index-service", 
targetNamespace, int32(1))
+                       }, 3*time.Minute, 30*time.Second).Should(BeTrue())
+
+                       By("Create the data index HPA after the platform")
+                       EventuallyWithOffset(1, func() error {
+                               return 
kubectlApplyFileOnCluster(dataIndexHPAPath, targetNamespace)
+                       }, 3*time.Minute, time.Second).Should(Succeed())
+
+                       By("Check that the data index has 3 replicas after 
creating the HPA")
+                       EventuallyWithOffset(1, func() bool {
+                               return 
verifyDeploymentReplicas("sonataflow-platform-data-index-service", 
targetNamespace, int32(3))
+                       }, 3*time.Minute, 30*time.Second).Should(BeTrue())
+               }
+
+               By("Delete the data index HPA")
+               EventuallyWithOffset(1, func() error {
+                       return kubectlDeleteFileOnCluster(dataIndexHPAPath, 
targetNamespace)
+               }, 3*time.Minute, 30*time.Second).Should(Succeed())
+
+               By("Check that the data index has 1 replica after deleting the 
HPA")
+               EventuallyWithOffset(1, func() bool {
+                       return 
verifyDeploymentReplicas("sonataflow-platform-data-index-service", 
targetNamespace, int32(3))

Review Comment:
   good catch



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to