From 17f2a16e008ac43d021cee6726eaac4b962f0ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Han=C3=A1k?= Date: Tue, 28 May 2024 10:48:23 +0200 Subject: [PATCH] [9.100.x-prod] BAQE-2901: Fix CR jobs of kogito-images (#46) * [9.100.x-prod] BAQE-2901: Fix CR jobs of kogito-images Add back removed bit in upstream Add annotations * BAQE-2901: Add jobs-service and data-index to OSL testing * Remove tech-preview from image name tags --- .../features/common-custom-truststore.feature | 4 +++ .../features/common-dynamic-resources.feature | 4 +++ tests/features/common.feature | 5 ++++ .../kogito-data-index-common.feature | 2 ++ .../kogito-data-index-ephemeral.feature | 1 + .../kogito-data-index-postgresql.feature | 1 + .../kogito-jobs-service-common.feature | 2 ++ .../kogito-jobs-service-ephemeral.feature | 1 + .../kogito-jobs-service-postgresql.feature | 1 + .../kogito-common-postresql-services.feature | 1 + tests/features/kogito-swf-builder.feature | 1 + tests/features/kogito-swf-common.feature | 2 ++ tests/features/kogito-swf-devmode.feature | 1 + .../logic-data-index-ephemeral.feature | 25 ++++++++++++++++ .../logic-data-index-postgresql.feature | 16 ++++++++++ .../logic-jobs-service-postgresql.feature | 30 +++++++++++++++++++ .../logic-jobs-service.ephemeral.feature | 23 ++++++++++++++ .../logic-swf-builder.feature | 11 +++++++ .../logic-swf-devmode.feature | 11 +++++++ .../supporting-services-common.feature | 2 ++ 20 files changed, 144 insertions(+) create mode 100644 tests/features/openshift-serverless-logic/logic-data-index-ephemeral.feature create mode 100644 tests/features/openshift-serverless-logic/logic-data-index-postgresql.feature create mode 100644 tests/features/openshift-serverless-logic/logic-jobs-service-postgresql.feature create mode 100644 tests/features/openshift-serverless-logic/logic-jobs-service.ephemeral.feature create mode 100644 tests/features/openshift-serverless-logic/logic-swf-builder.feature create mode 100644 tests/features/openshift-serverless-logic/logic-swf-devmode.feature diff --git a/tests/features/common-custom-truststore.feature b/tests/features/common-custom-truststore.feature index 55b2ffa98..26c7e49f5 100644 --- a/tests/features/common-custom-truststore.feature +++ b/tests/features/common-custom-truststore.feature @@ -3,6 +3,10 @@ @quay.io/kiegroup/kogito-jit-runner @quay.io/kiegroup/kogito-jobs-service-ephemeral @quay.io/kiegroup/kogito-jobs-service-postgresql +@openshift-serverless-1/logic-data-index-ephemeral-rhel8 +@openshift-serverless-1/logic-jobs-service-ephemeral-rhel8 +@openshift-serverless-1/logic-data-index-postgresql-rhel8 +@openshift-serverless-1/logic-jobs-service-postgresql-rhel8 Feature: Common tests for Custom TrustStore configuration # This test sets an invalid certificate to the container, it fails to start, and if timing is bad cekit hangs on 'Running command ps -C java in container' # See https://github.com/apache/incubator-kie-kogito-images/issues/1722 diff --git a/tests/features/common-dynamic-resources.feature b/tests/features/common-dynamic-resources.feature index b08a26599..72fe2dbe0 100644 --- a/tests/features/common-dynamic-resources.feature +++ b/tests/features/common-dynamic-resources.feature @@ -5,6 +5,10 @@ #@quay.io/kiegroup/kogito-jit-runner @quay.io/kiegroup/kogito-jobs-service-ephemeral #@quay.io/kiegroup/kogito-jobs-service-postgresql +@openshift-serverless-1/logic-data-index-ephemeral-rhel8 +@openshift-serverless-1/logic-jobs-service-ephemeral-rhel8 +#@openshift-serverless-1/logic-data-index-postgresql-rhel8 +#@openshift-serverless-1/logic-jobs-service-postgresql-rhel8 Feature: Common tests for Kogito images Scenario: Verify if the properties were correctly set using DEFAULT MEM RATIO diff --git a/tests/features/common.feature b/tests/features/common.feature index c3188be36..b3fdb1eb3 100644 --- a/tests/features/common.feature +++ b/tests/features/common.feature @@ -5,6 +5,11 @@ @quay.io/kiegroup/kogito-jobs-service-postgresql @quay.io/kiegroup/kogito-swf-builder @quay.io/kiegroup/kogito-base-builder +@openshift-serverless-1/logic-swf-builder-rhel8 +@openshift-serverless-1/logic-data-index-ephemeral-rhel8 +@openshift-serverless-1/logic-jobs-service-ephemeral-rhel8 +@openshift-serverless-1/logic-data-index-postgresql-rhel8 +@openshift-serverless-1/logic-jobs-service-postgresql-rhel8 Feature: Common tests for Kogito images Scenario: Verify if Kogito user is correctly configured diff --git a/tests/features/data-index/kogito-data-index-common.feature b/tests/features/data-index/kogito-data-index-common.feature index a4de284fb..ea6fca599 100644 --- a/tests/features/data-index/kogito-data-index-common.feature +++ b/tests/features/data-index/kogito-data-index-common.feature @@ -1,5 +1,7 @@ @quay.io/kiegroup/kogito-data-index-ephemeral @quay.io/kiegroup/kogito-data-index-postgresql +@openshift-serverless-1/logic-data-index-ephemeral-rhel8 +@openshift-serverless-1/logic-data-index-postgresql-rhel8 Feature: Kogito-data-index common feature. Scenario: Verify if the debug is correctly enabled and test default http port diff --git a/tests/features/data-index/kogito-data-index-ephemeral.feature b/tests/features/data-index/kogito-data-index-ephemeral.feature index 3b47d7fc8..b30fb0b7d 100644 --- a/tests/features/data-index/kogito-data-index-ephemeral.feature +++ b/tests/features/data-index/kogito-data-index-ephemeral.feature @@ -1,4 +1,5 @@ @quay.io/kiegroup/kogito-data-index-ephemeral +@openshift-serverless-1/logic-data-index-ephemeral-rhel8 Feature: Kogito-data-index ephemeral postgresql feature. Scenario: verify if all labels are correctly set on kogito-data-index-ephemeral image diff --git a/tests/features/data-index/kogito-data-index-postgresql.feature b/tests/features/data-index/kogito-data-index-postgresql.feature index b41859699..5d9f06620 100644 --- a/tests/features/data-index/kogito-data-index-postgresql.feature +++ b/tests/features/data-index/kogito-data-index-postgresql.feature @@ -1,4 +1,5 @@ @quay.io/kiegroup/kogito-data-index-postgresql +@openshift-serverless-1/logic-data-index-postgresql-rhel8 Feature: Kogito-data-index postgresql feature. Scenario: verify if all labels are correctly set on kogito-data-index-postgresql image diff --git a/tests/features/jobs-service/kogito-jobs-service-common.feature b/tests/features/jobs-service/kogito-jobs-service-common.feature index 34e21b0a3..8db561f74 100644 --- a/tests/features/jobs-service/kogito-jobs-service-common.feature +++ b/tests/features/jobs-service/kogito-jobs-service-common.feature @@ -1,6 +1,8 @@ @quay.io/kiegroup/kogito-jobs-service-ephemeral @quay.io/kiegroup/kogito-jobs-service-postgresql @quay.io/kiegroup/kogito-jobs-service-allinone +@openshift-serverless-1/logic-jobs-service-ephemeral-rhel8 +@openshift-serverless-1/logic-jobs-service-postgresql-rhel8 Feature: Kogito-jobs-service common feature. Scenario: verify if the events is correctly enabled diff --git a/tests/features/jobs-service/kogito-jobs-service-ephemeral.feature b/tests/features/jobs-service/kogito-jobs-service-ephemeral.feature index ea14dd6d2..7f6b11153 100644 --- a/tests/features/jobs-service/kogito-jobs-service-ephemeral.feature +++ b/tests/features/jobs-service/kogito-jobs-service-ephemeral.feature @@ -1,4 +1,5 @@ @quay.io/kiegroup/kogito-jobs-service-ephemeral +@openshift-serverless-1/logic-jobs-service-ephemeral-rhel8 Feature: Kogito-jobs-service-ephemeral feature. Scenario: verify if all labels are correctly set kogito-jobs-service image image diff --git a/tests/features/jobs-service/kogito-jobs-service-postgresql.feature b/tests/features/jobs-service/kogito-jobs-service-postgresql.feature index c4460973a..a6238bb03 100644 --- a/tests/features/jobs-service/kogito-jobs-service-postgresql.feature +++ b/tests/features/jobs-service/kogito-jobs-service-postgresql.feature @@ -1,4 +1,5 @@ @quay.io/kiegroup/kogito-jobs-service-postgresql +@openshift-serverless-1/logic-jobs-service-postgresql-rhel8 Feature: Kogito-jobs-service-postgresql feature. Scenario: verify if all labels are correctly set kogito-jobs-service image image diff --git a/tests/features/kogito-common-postresql-services.feature b/tests/features/kogito-common-postresql-services.feature index cf77b26fd..8aab7c101 100644 --- a/tests/features/kogito-common-postresql-services.feature +++ b/tests/features/kogito-common-postresql-services.feature @@ -1,4 +1,5 @@ @quay.io/kiegroup/kogito-data-index-postgresql +@openshift-serverless-1/logic-data-index-postgresql-rhel8 Feature: Kogito-data-index postgresql feature. Scenario: verify if of container is correctly started with postgresql parameters diff --git a/tests/features/kogito-swf-builder.feature b/tests/features/kogito-swf-builder.feature index acae47c9c..3630016ca 100644 --- a/tests/features/kogito-swf-builder.feature +++ b/tests/features/kogito-swf-builder.feature @@ -1,4 +1,5 @@ @quay.io/kiegroup/kogito-swf-builder +@openshift-serverless-1/logic-swf-builder-rhel8 Feature: Serverless Workflow builder images Scenario: Verify that the application is built and started correctly diff --git a/tests/features/kogito-swf-common.feature b/tests/features/kogito-swf-common.feature index 652d63480..d22803ac3 100644 --- a/tests/features/kogito-swf-common.feature +++ b/tests/features/kogito-swf-common.feature @@ -1,5 +1,7 @@ @quay.io/kiegroup/kogito-swf-builder @quay.io/kiegroup/kogito-swf-devmode +@openshift-serverless-1/logic-swf-builder-rhel8 +@openshift-serverless-1/logic-swf-devmode-rhel8 Feature: Serverless Workflow images common Scenario: Verify if the swf and quarkus files are under /home/kogito/.m2/repository diff --git a/tests/features/kogito-swf-devmode.feature b/tests/features/kogito-swf-devmode.feature index b9417cea2..cec0cdac0 100644 --- a/tests/features/kogito-swf-devmode.feature +++ b/tests/features/kogito-swf-devmode.feature @@ -1,4 +1,5 @@ @quay.io/kiegroup/kogito-swf-devmode +@openshift-serverless-1/logic-swf-devmode-rhel8 Feature: Serverless Workflow devmode images Scenario: Verify if container starts in devmode by default diff --git a/tests/features/openshift-serverless-logic/logic-data-index-ephemeral.feature b/tests/features/openshift-serverless-logic/logic-data-index-ephemeral.feature new file mode 100644 index 000000000..0ad677cbd --- /dev/null +++ b/tests/features/openshift-serverless-logic/logic-data-index-ephemeral.feature @@ -0,0 +1,25 @@ +@openshift-serverless-1/logic-data-index-ephemeral-rhel8 +Feature: logic-data-index-ephemeral-rhel8 feature + + Scenario: verify if all labels are correctly set on logic-data-index-ephemeral-rhel8 image + Given image is built + Then the image should contain label io.openshift.expose-services with value 8080:http + And the image should contain label maintainer with value serverless-logic + And the image should contain label io.k8s.description with value Red Hat build of Runtime image for Kogito Data Index Service for ephemeral PostgreSQL persistence provider + And the image should contain label io.k8s.display-name with value Red Hat build of Kogito Data Index Service - ephemeral PostgreSQL + And the image should contain label io.openshift.tags with value logic-data-index,kogito,data-index,data-index-ephemeral + And the image should contain label com.redhat.component with value openshift-serverless-1-logic-data-index-ephemeral-rhel8-container + + Scenario: verify if of logic-data-index-ephemeral-rhel8 container is correctly started + When container is started with env + | variable | value | + | SCRIPT_DEBUG | true | + 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 | + Then container log should contain -Dquarkus.profile=http-events-support \ No newline at end of file diff --git a/tests/features/openshift-serverless-logic/logic-data-index-postgresql.feature b/tests/features/openshift-serverless-logic/logic-data-index-postgresql.feature new file mode 100644 index 000000000..0b0bafeb4 --- /dev/null +++ b/tests/features/openshift-serverless-logic/logic-data-index-postgresql.feature @@ -0,0 +1,16 @@ +@openshift-serverless-1/logic-data-index-postgresql-rhel8 +Feature: logic-data-index-postgresql postgresql feature. + + Scenario: verify if all labels are correctly set on logic-data-index-postgresql image + Given image is built + Then the image should contain label maintainer with value serverless-logic + And the image should contain label io.openshift.expose-services with value 8080:http + And the image should contain label io.k8s.description with value Red Hat build of Runtime image for Kogito Data Index Service for PostgreSQL persistence provider + And the image should contain label io.k8s.display-name with value Red Hat build of Kogito Data Index Service - PostgreSQL + And the image should contain label io.openshift.tags with value logic-data-index,kogito,data-index,data-index-postgresql + + Scenario: check if the default quarkus profile is correctly set on data index + When container is started with env + | variable | value | + | SCRIPT_DEBUG | true | + Then container log should contain -Dquarkus.profile=kafka-events-support \ No newline at end of file diff --git a/tests/features/openshift-serverless-logic/logic-jobs-service-postgresql.feature b/tests/features/openshift-serverless-logic/logic-jobs-service-postgresql.feature new file mode 100644 index 000000000..52b9664a9 --- /dev/null +++ b/tests/features/openshift-serverless-logic/logic-jobs-service-postgresql.feature @@ -0,0 +1,30 @@ +@openshift-serverless-1/logic-jobs-service-postgresql-rhel8 +Feature: logic-jobs-service-postgresql feature. + + Scenario: verify if all labels are correctly set kogito-jobs-service image image + Given image is built + Then the image should contain label maintainer with value serverless-logic + And the image should contain label io.openshift.expose-services with value 8080:http + And the image should contain label io.k8s.description with value Red Hat build of Runtime image for Kogito Jobs Service based on Postgresql + And the image should contain label io.k8s.display-name with value Red Hat build of Kogito Jobs Service based on Postgresql + And the image should contain label io.openshift.tags with value logic-jobs-service,kogito,jobs-service-postgresql + + Scenario: Verify if the application jar exists + When container is started with command bash + Then run sh -c 'ls /home/kogito/bin/postgresql/quarkus-app/quarkus-run.jar' in container and immediately check its output for /home/kogito/bin/postgresql/quarkus-app/quarkus-run.jar + + Scenario: verify if container starts as expected + When container is started with env + | variable | value | + | SCRIPT_DEBUG | true | + | QUARKUS_LOG_LEVEL | DEBUG | + | QUARKUS_DATASOURCE_DB_KIND | postgresql | + | QUARKUS_DATASOURCE_USERNAME | test | + | QUARKUS_DATASOURCE_PASSWORD | 123456 | + | QUARKUS_DATASOURCE_JDBC_URL | jdbc:postgresql://10.11.12.13:5432/hibernate_orm_test | + Then container log should contain -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar /home/kogito/bin/postgresql/quarkus-app/quarkus-run.jar + And container log should contain QUARKUS_DATASOURCE_DB_KIND=postgresql + And container log should contain QUARKUS_DATASOURCE_USERNAME=test + And container log should contain QUARKUS_DATASOURCE_PASSWORD=123456 + And container log should contain QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://10.11.12.13:5432/hibernate_orm_test + And container log should contain Trying to establish a protocol version 3 connection to 10.11.12.13:5432 diff --git a/tests/features/openshift-serverless-logic/logic-jobs-service.ephemeral.feature b/tests/features/openshift-serverless-logic/logic-jobs-service.ephemeral.feature new file mode 100644 index 000000000..bba5026df --- /dev/null +++ b/tests/features/openshift-serverless-logic/logic-jobs-service.ephemeral.feature @@ -0,0 +1,23 @@ +@openshift-serverless-1/logic-jobs-service-ephemeral-rhel8 +Feature: logic-jobs-service-ephemeral feature. + + Scenario: verify if all labels are correctly set logic-jobs-service-ephemeral image + Given image is built + Then the image should contain label maintainer with value serverless-logic + And the image should contain label io.openshift.expose-services with value 8080:http + And the image should contain label io.k8s.description with value Red Hat build of Runtime image for Kogito in memory Jobs Service + And the image should contain label io.k8s.display-name with value Red Hat build of Kogito in memory Jobs Service + And the image should contain label io.openshift.tags with value logic-jobs-service,kogito,jobs-service-ephemeral + + Scenario: Verify if the application jar exists + When container is started with command bash + Then run sh -c 'ls /home/kogito/bin/ephemeral/quarkus-app/quarkus-run.jar' in container and immediately check its output for /home/kogito/bin/ephemeral/quarkus-app/quarkus-run.jar + + Scenario: Verify if the debug is correctly enabled with the ephemeral jar + When container is started with env + | variable | value | + | SCRIPT_DEBUG | true | + 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 + diff --git a/tests/features/openshift-serverless-logic/logic-swf-builder.feature b/tests/features/openshift-serverless-logic/logic-swf-builder.feature new file mode 100644 index 000000000..eb16f40c6 --- /dev/null +++ b/tests/features/openshift-serverless-logic/logic-swf-builder.feature @@ -0,0 +1,11 @@ +@openshift-serverless-1/logic-swf-builder-rhel8 +Feature: logic-swf-builder-rhel8 feature + + Scenario: verify if all labels are correctly set on logic-swf-builder-rhel8 image + Given image is built + Then the image should contain label io.openshift.expose-services with value 8080:http + And the image should contain label maintainer with value serverless-logic + And the image should contain label io.k8s.description with value Red Hat build of Runtime image for Kogito Serverless Workflow builder with Quarkus extensions libraries preinstalled + And the image should contain label io.k8s.display-name with value Red Hat OpenShift Serverless Logic Builder image + And the image should contain label io.openshift.tags with value logic-swf-builder,kogito,swf-builder + And the image should contain label com.redhat.component with value openshift-serverless-1-logic-swf-builder-rhel8-container \ No newline at end of file diff --git a/tests/features/openshift-serverless-logic/logic-swf-devmode.feature b/tests/features/openshift-serverless-logic/logic-swf-devmode.feature new file mode 100644 index 000000000..73e2f36c0 --- /dev/null +++ b/tests/features/openshift-serverless-logic/logic-swf-devmode.feature @@ -0,0 +1,11 @@ +@openshift-serverless-1/logic-swf-devmode-rhel8 +Feature: logic-swf-devmode-rhel8 feature + + Scenario: verify if all labels are correctly set on logic-swf-devmode-rhel8 image + Given image is built + Then the image should contain label io.openshift.expose-services with value 8080:http,5005:http + And the image should contain label maintainer with value serverless-logic + And the image should contain label io.k8s.description with value Red Hat build of Kogito Serverless Workflow development mode image with Quarkus extensions libraries preinstalled. + And the image should contain label io.k8s.display-name with value Red Hat OpenShift Serverless Logic SWF Devmode + And the image should contain label io.openshift.tags with value logic,devmode,kogito,kogito,development,serverless,workflow + And the image should contain label com.redhat.component with value openshift-serverless-1-logic-swf-devmode-rhel8-container \ No newline at end of file diff --git a/tests/features/supporting-services-common.feature b/tests/features/supporting-services-common.feature index b2a39ec30..d629217cc 100644 --- a/tests/features/supporting-services-common.feature +++ b/tests/features/supporting-services-common.feature @@ -1,6 +1,8 @@ @quay.io/kiegroup/kogito-data-index-ephemeral @quay.io/kiegroup/kogito-data-index-postgresql @quay.io/kiegroup/kogito-jit-runner +@openshift-serverless-1/logic-data-index-ephemeral-rhel8 +@openshift-serverless-1/logic-data-index-postgresql-rhel8 Feature: kogito supporting services common feature Scenario: Verify if the application jar exists