Skip to content

Commit

Permalink
[sonataflow-images] [kogito-images] Fix #2817 - Disable debug on e2e …
Browse files Browse the repository at this point in the history
…tests

Signed-off-by: Ricardo Zanini <[email protected]>
  • Loading branch information
ricardozanini committed Dec 16, 2024
1 parent c28f619 commit da8b7c0
Show file tree
Hide file tree
Showing 21 changed files with 85 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ source "${KOGITO_HOME}"/launch/configure.sh
DYNAMIC_RESOURCES_OPTS="$(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/java-default-options) $(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/debug-options)"

# shellcheck disable=SC2086
exec java ${SHOW_JVM_SETTINGS} ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_DATA_INDEX_PROPS} ${CUSTOM_TRUSTSTORE_ARGS} \
-Djava.library.path="${KOGITO_HOME}"/lib \
-Dquarkus.http.host=0.0.0.0 \
-Dquarkus.http.port=8080 \
-jar "${KOGITO_HOME}"/bin/quarkus-app/quarkus-run.jar
CMD="exec java ${SHOW_JVM_SETTINGS} ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_DATA_INDEX_PROPS} ${CUSTOM_TRUSTSTORE_ARGS} \
-Djava.library.path=\"${KOGITO_HOME}/lib\" \
-Dquarkus.http.host=0.0.0.0 \
-Dquarkus.http.port=8080 \
-jar \"${KOGITO_HOME}/bin/quarkus-app/quarkus-run.jar\""

log_info "Running application start mvn command"
echo "$CMD"
eval "$CMD"

Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ Feature: Kogito-data-index common feature.
Scenario: Verify if the debug is correctly enabled and test default http port
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
Then container log should contain -Djava.library.path=/home/kogito/lib -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080

Scenario: check if a provided data index quarkus profile is correctly set on data index
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
| KOGITO_DATA_INDEX_QUARKUS_PROFILE | http-events-support |
Then container log should contain -Dquarkus.profile=http-events-support
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ Feature: Kogito-data-index ephemeral postgresql feature.
Scenario: verify if of kogito-data-index-ephemeral container is correctly started
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
Then container log should contain -Djava.library.path=/home/kogito/lib -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar /home/kogito/bin/quarkus-app/quarkus-run.jar
And container log should contain Embedded Postgres started at port
And container log should not contain Application failed to start

Scenario: check if the default quarkus profile is correctly set on data index
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
Then available container log should contain -Dquarkus.profile=http-events-support
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ source "${KOGITO_HOME}"/launch/configure.sh
DYNAMIC_RESOURCES_OPTS="$(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/java-default-options) $(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/debug-options)"

# shellcheck disable=SC2086
exec java ${SHOW_JVM_SETTINGS} ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_DATA_INDEX_PROPS} ${CUSTOM_TRUSTSTORE_ARGS} \
-Djava.library.path="${KOGITO_HOME}"/lib \
-Dquarkus.http.host=0.0.0.0 \
-Dquarkus.http.port=8080 \
-jar "${KOGITO_HOME}"/bin/quarkus-app/quarkus-run.jar
CMD="exec java ${SHOW_JVM_SETTINGS} ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_DATA_INDEX_PROPS} ${CUSTOM_TRUSTSTORE_ARGS} \
-Djava.library.path=\"${KOGITO_HOME}/lib\" \
-Dquarkus.http.host=0.0.0.0 \
-Dquarkus.http.port=8080 \
-jar \"${KOGITO_HOME}/bin/quarkus-app/quarkus-run.jar\""

log_info "Running application start mvn command"
echo "$CMD"
eval "$CMD"
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Feature: Kogito-data-index postgresql feature.
Scenario: verify if of container is correctly started with postgresql parameters
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
| QUARKUS_DATASOURCE_JDBC_URL | jdbc:postgresql://localhost:5432/quarkus |
| QUARKUS_DATASOURCE_USERNAME | kogito |
| QUARKUS_DATASOURCE_PASSWORD | s3cr3t |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ Feature: Kogito-data-index common feature.
Scenario: Verify if the debug is correctly enabled and test default http port
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
Then container log should contain -Djava.library.path=/home/kogito/lib -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080

Scenario: check if a provided data index quarkus profile is correctly set on data index
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
| KOGITO_DATA_INDEX_QUARKUS_PROFILE | http-events-support |
Then container log should contain -Dquarkus.profile=http-events-support
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Feature: Kogito-data-index postgresql feature.
Scenario: check if the default quarkus profile is correctly set on data index
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
Then container log should contain -Dquarkus.profile=kafka-events-support
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ source "${KOGITO_HOME}"/launch/configure.sh
DYNAMIC_RESOURCES_OPTS="$(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/java-default-options) $(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/debug-options)"

# shellcheck disable=SC2086
exec java ${SHOW_JVM_SETTINGS} ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${CUSTOM_TRUSTSTORE_ARGS} \
-Djava.library.path="${KOGITO_HOME}"/lib \
-Dquarkus.http.host=0.0.0.0 \
-Dquarkus.http.port=8080 \
-jar "${KOGITO_HOME}"/bin/quarkus-app/quarkus-run.jar
CMD="exec java ${SHOW_JVM_SETTINGS} ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${CUSTOM_TRUSTSTORE_ARGS} \
-Djava.library.path=\"${KOGITO_HOME}/lib\" \
-Dquarkus.http.host=0.0.0.0 \
-Dquarkus.http.port=8080 \
-jar \"${KOGITO_HOME}/bin/quarkus-app/quarkus-run.jar\""

log_info "Running application start mvn command"
echo "$CMD"
eval "$CMD"
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ Feature: Kogito-jit-runner feature.
Scenario: Verify if the debug is correctly enabled and test default http port
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
Then container log should contain -Djava.library.path=/home/kogito/lib -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar /home/kogito/bin/quarkus-app/quarkus-run.jar

Scenario: Verify that jit runner can evaluate a DMN model with a context
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
Then check that page is served
| property | value |
| port | 8080 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ source "${KOGITO_HOME}"/launch/configure.sh
DYNAMIC_RESOURCES_OPTS="$(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/java-default-options) $(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/debug-options)"

# shellcheck disable=SC2086
exec java ${SHOW_JVM_SETTINGS} ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_JOBS_PROPS} ${CUSTOM_TRUSTSTORE_ARGS} \
-Dquarkus.http.host=0.0.0.0 \
-Dquarkus.http.port=8080 \
-jar "${KOGITO_HOME}"/bin/${jobs_service_flavor}/quarkus-app/quarkus-run.jar
CMD="exec java ${SHOW_JVM_SETTINGS} ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_JOBS_PROPS} ${CUSTOM_TRUSTSTORE_ARGS} \
-Dquarkus.http.host=0.0.0.0 \
-Dquarkus.http.port=8080 \
-jar \"${KOGITO_HOME}/bin/${jobs_service_flavor}/quarkus-app/quarkus-run.jar\""

log_info "Running application start mvn command"
echo "$CMD"
eval "$CMD"
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@ Feature: Kogito-jobs-service-all-in-one feature.
Scenario: Verify if the debug is correctly enabled with the ephemeral jar
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
Then container log should contain -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar /home/kogito/bin/ephemeral/quarkus-app/quarkus-run.jar
And container log should contain started in
And container log should not contain Application failed to start

Scenario: verify if the container is started with invalid jobs-service flavor
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
| JOBS_SERVICE_PERSISTENCE | something |
Then container log should contain -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar /home/kogito/bin/ephemeral/quarkus-app/quarkus-run.jar
And container log should contain something is not supported, the allowed flavors are [ephemeral postgresql], defaulting to ephemeral

Scenario: verify if container starts as expected
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
| QUARKUS_LOG_LEVEL | DEBUG |
| JOBS_SERVICE_PERSISTENCE | postgresql |
| QUARKUS_DATASOURCE_DB_KIND | postgresql |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: Kogito-jobs-service common feature.
Scenario: verify if the events is correctly enabled
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
| ENABLE_EVENTS | true |
| KOGITO_JOBS_PROPS | -Dkafka.bootstrap.servers=localhost:11111 |
Then container log should contain -Dkafka.bootstrap.servers=localhost:11111 -Dquarkus.profile=events-support -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ source "${KOGITO_HOME}"/launch/configure.sh
DYNAMIC_RESOURCES_OPTS="$(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/java-default-options) $(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/debug-options)"

# shellcheck disable=SC2086
exec java ${SHOW_JVM_SETTINGS} ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_JOBS_PROPS} ${CUSTOM_TRUSTSTORE_ARGS} \
-Dquarkus.http.host=0.0.0.0 \
-Dquarkus.http.port=8080 \
-jar "${KOGITO_HOME}"/bin/quarkus-app/quarkus-run.jar
CMD="exec java ${SHOW_JVM_SETTINGS} ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_JOBS_PROPS} ${CUSTOM_TRUSTSTORE_ARGS} \
-Dquarkus.http.host=0.0.0.0 \
-Dquarkus.http.port=8080 \
-jar \"${KOGITO_HOME}/bin/quarkus-app/quarkus-run.jar\""

log_info "Running application start mvn command"
echo "$CMD"
eval "$CMD"
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: Kogito-jobs-service common feature.
Scenario: verify if the events is correctly enabled
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
| ENABLE_EVENTS | true |
| KOGITO_JOBS_PROPS | -Dkafka.bootstrap.servers=localhost:11111 |
Then container log should contain -Dkafka.bootstrap.servers=localhost:11111 -Dquarkus.profile=events-support -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Feature: Kogito-jobs-service-ephemeral feature.
Scenario: Verify if the debug is correctly enabled with the ephemeral jar
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
Then container log should contain -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar /home/kogito/bin/quarkus-app/quarkus-run.jar
And container log should contain started in
And container log should not contain Application failed to start
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ source "${KOGITO_HOME}"/launch/configure.sh
DYNAMIC_RESOURCES_OPTS="$(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/java-default-options) $(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/debug-options)"

# shellcheck disable=SC2086
exec java ${SHOW_JVM_SETTINGS} ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_JOBS_PROPS} ${CUSTOM_TRUSTSTORE_ARGS} \
-Dquarkus.http.host=0.0.0.0 \
-Dquarkus.http.port=8080 \
-jar "${KOGITO_HOME}"/bin/quarkus-app/quarkus-run.jar
CMD="exec java ${SHOW_JVM_SETTINGS} ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_JOBS_PROPS} ${CUSTOM_TRUSTSTORE_ARGS} \
-Dquarkus.http.host=0.0.0.0 \
-Dquarkus.http.port=8080 \
-jar \"${KOGITO_HOME}/bin/quarkus-app/quarkus-run.jar\""

log_info "Running application start mvn command"
echo "$CMD"
eval "$CMD"
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: Kogito-jobs-service common feature.
Scenario: verify if the events is correctly enabled
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
| ENABLE_EVENTS | true |
| KOGITO_JOBS_PROPS | -Dkafka.bootstrap.servers=localhost:11111 |
Then container log should contain -Dkafka.bootstrap.servers=localhost:11111 -Dquarkus.profile=events-support -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Feature: Kogito-jobs-service-postgresql feature.
Scenario: verify if container starts as expected
When container is started with env
| variable | value |
| SCRIPT_DEBUG | true |
| SCRIPT_DEBUG | false |
| QUARKUS_LOG_LEVEL | DEBUG |
| QUARKUS_DATASOURCE_DB_KIND | postgresql |
| QUARKUS_DATASOURCE_USERNAME | test |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Feature: Serverless Workflow builder images
Scenario: Verify that the application is built and started correctly
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 | true |
| SCRIPT_DEBUG | false |
Then check that page is served
| property | value |
| port | 8080 |
Expand All @@ -20,7 +20,7 @@ Feature: Serverless Workflow builder images
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 | true |
| SCRIPT_DEBUG | false |
| QUARKUS_EXTENSIONS | io.quarkus:quarkus-elytron-security-jdbc |
Then check that page is served
| property | value |
Expand All @@ -29,8 +29,7 @@ Feature: Serverless Workflow builder images
| wait | 480 |
| request_method | GET |
| expected_status_code | 200 |
And container log should contain -Duser.home=/home/kogito
And container log should contain Extension io.quarkus:quarkus-elytron-security-jdbc has been installed
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,16 @@ if [ ! -z "${QUARKUS_EXTENSIONS}" ]; then
offline_param=""
fi

"${MAVEN_HOME}"/bin/mvn -B ${MAVEN_ARGS_APPEND} \
CMD="\"${MAVEN_HOME}\"/bin/mvn -B ${MAVEN_ARGS_APPEND} \
${offline_param} \
-s "${MAVEN_SETTINGS_PATH}" \
-s \"${MAVEN_SETTINGS_PATH}\" \
-DskipTests \
-Dquarkus.http.host=0.0.0.0 \
-Dquarkus.test.continuous-testing=${QUARKUS_CONTINUOUS_TESTING:-disabled} \
-Dquarkus.analytics.disabled=${QUARKUS_ANALYTICS_DISABLED:true} \
clean compile quarkus:dev
-Dquarkus.analytics.disabled=${QUARKUS_ANALYTICS_DISABLED:-true} \
clean compile quarkus:dev"

# Prints the command before executing for troubleshooting purposes
log_info "Running application start mvn command"
echo "$CMD"
eval "$CMD"
Loading

0 comments on commit da8b7c0

Please sign in to comment.