fantonangeli commented on code in PR #3225:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3225#discussion_r2276548158


##########
packages/sonataflow-management-console-image/test-resources/tests/features/sonataflow-management-console.feature:
##########
@@ -21,15 +15,6 @@ Feature: Serverless Workflow Management Console images
   Scenario: verify that the data-index is available from the container
     When container is started with env
       | variable                    | value                                    
             |
-      | SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT | 
http://${DOCKER_HOST}:4000/graphql |
+      | SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT | 
http://host.docker.internal:4000/graphql |

Review Comment:
   @ricardozanini in order to simplify the test and avoid the "host IP" issue, 
can be an option to avoid using a real graphql this way?
   - 
`SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT=http://none.localhost:4000/graphql`
   - `curl http://localhost:8080/graphql`
   - then check if the container logs contains:
   ```
   HTTP: failed to make connection to backend: none.localhost
   ```
   



##########
packages/sonataflow-management-console-image/test-resources/tests/features/sonataflow-management-console.feature:
##########
@@ -23,13 +17,4 @@ Feature: Serverless Workflow Management Console images
       | variable                    | value                                    
             |
       | SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT | 
http://${DOCKER_HOST}:4000/graphql |
     Then container log should contain httpd -D FOREGROUND
-    Then check that page is served
-      | property             | value                                    |
-      | port                 | 8080                                     |
-      | path                 | /graphql                                 |
-      | request_method       | POST                                     |
-      | request_body         | { "query": "{ProcessInstances{ id } }" } |
-      | content_type         | application/json                         |
-      | wait                 | 480                                        |
-      | expected_status_code | 200                                      |
-      | expected_phrase      | "data":{"ProcessInstances                |
+    And run curl -X POST -sS -H Content-Type:application/json --data-binary 
'{"query":"{ProcessInstances{id}}"}' http://127.0.0.1:8080/graphql in container 
and check its output contains "data":{"ProcessInstances"

Review Comment:
   As in my previous comment I would evaluate modifying the test this way to 
allow MacOS users to run tests and avoid DOCKER_HOST settings issues. WDYT?
   
   ```suggestion
         | SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT | 
http://none.localhost:4000/graphql |
       Then container log should contain httpd -D FOREGROUND
       Then container log should not contain HTTP: failed to make connection to 
backend: none.localhost
       And run curl -X POST -sS -H Content-Type:application/json --data-binary 
'{"query":"{ProcessInstances{id}}"}' http://127.0.0.1:8080/graphql in container 
and check its output contains 503 Service Unavailable
       Then container log should contain HTTP: failed to make connection to 
backend: none.localhost
   ```



##########
packages/sonataflow-builder-image/test-resources/tests/features/sonataflow-builder.feature:
##########
@@ -22,31 +22,16 @@ Feature: SonataFlow Builder Image Sanity Checks
     When container is started with command bash -c 
'/home/kogito/launch/build-app.sh && java -jar 
target/quarkus-app/quarkus-run.jar'
       | variable     | value |
       | SCRIPT_DEBUG | false  |
-    Then check that page is served
-      | property             | value             |
-      | port                 | 8080              |
-      | path                 | /q/health/ready   |
-      | wait                 | 480               |
-      | request_method       | GET               |
-      | expected_status_code | 200               |
-    And container log should match regex Installed 
features:.*kogito-serverless-workflow
+    Then container log should match regex Installed 
features:.*kogito-serverless-workflow
     And container log should match regex Installed 
features:.*kie-addon-knative-eventing-extension
     And container log should match regex Installed features:.*smallrye-health
+    And container log should match regex Listening on: http://0\.0\.0\.0:8080
+    And run curl -fsS -o /dev/null -w %{http_code} 
http://127.0.0.1:8080/q/health/ready in container and immediately check its 
output contains 200
 
   Scenario: Verify that the application is built and started correctly when 
QUARKUS_EXTENSIONS env is used
     When container is started with command bash -c 
'/home/kogito/launch/build-app.sh && java -jar 
target/quarkus-app/quarkus-run.jar'
       | variable            | value                                    |
       | SCRIPT_DEBUG        | false                                     |
       | QUARKUS_EXTENSIONS  | io.quarkus:quarkus-elytron-security-jdbc |
-    Then check that page is served
-      | property             | value             |
-      | port                 | 8080              |
-      | path                 | /q/health/ready   |
-      | wait                 | 480               |
-      | request_method       | GET               |
-      | expected_status_code | 200               |
-    And container log should match regex Extension 
io\.quarkus:quarkus-elytron-security-jdbc.* has been installed
-    And container log should match regex Installed 
features:.*kogito-serverless-workflow
-    And container log should match regex Installed 
features:.*kie-addon-knative-eventing-extension
-    And container log should match regex Installed features:.*smallrye-health
-    And container log should match regex Installed features:.*security-jdbc
\ No newline at end of file
+    Then container log should match regex Extension 
io\.quarkus:quarkus-elytron-security-jdbc.* has been installed
+    And container log should match regex Installed features:.*security-jdbc

Review Comment:
   Do we miss the curl command here to verify the page is served?



-- 
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