diff --git a/.gitignore b/.gitignore index b424604e9..a4cd45c69 100755 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,6 @@ bats/* *.db *.tlog +# python +scripts/__pycache__ + diff --git a/Makefile b/Makefile index 5d6efaa58..bb8cdf8d1 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ endif .PHONY: list list: - @python3 scripts/list-images.py + @python3 scripts/list-images.py $(arg) # Build all images .PHONY: build @@ -22,6 +22,7 @@ build: clone-repos _build _build: @for f in $(shell make list); do make build-image image_name=$${f}; done + .PHONY: build-image image_name= build-image: @@ -36,6 +37,26 @@ ifneq ($(findstring rc,$(IMAGE_VERSION)),rc) ${BUILD_ENGINE} tag quay.io/kiegroup/${image_name}:${IMAGE_VERSION} quay.io/kiegroup/${image_name}:${SHORTENED_LATEST_VERSION} endif + +# Build all images +.PHONY: build-prod +# start to build the images +build-prod: clone-repos + @for iname in $(shell make list arg=--prod); do make build-prod-image image_name=$${iname} ; done + + +.PHONY: build-prod-image +image_name= +build-prod-image: +ifneq ($(ignore_build),true) + scripts/build-product-image.sh "build" $(image_name) ${BUILD_ENGINE} +endif +# if ignore_test is set to true, ignore the tests +ifneq ($(ignore_test),true) + scripts/build-product-image.sh "test" $(image_name) +endif + + # push images to quay.io, this requires permissions under kiegroup organization .PHONY: push push: build _push diff --git a/container.yaml b/container.yaml new file mode 100644 index 000000000..2c58dce28 --- /dev/null +++ b/container.yaml @@ -0,0 +1,6 @@ +--- +platforms: + only: + - x86_64 +compose: + pulp_repos: true diff --git a/content_sets.yaml b/content_sets.yaml new file mode 100644 index 000000000..7a619279b --- /dev/null +++ b/content_sets.yaml @@ -0,0 +1,16 @@ +# This is a file defining which content sets (yum repositories) are needed to +# update content in this image. Data provided here helps determine which images +# are vulnerable to specific CVEs. Generally you should only need to update this +# file when: +# 1. You start depending on a new product +# 2. You are preparing new product release and your content sets will change +# +# See https://mojo.redhat.com/docs/DOC-1023066 for more information on +# maintaining this file and the format and examples +# +# You should have one top level item for each architecture being built. Most +# likely this will be x86_64 and ppc64le initially. +--- +x86_64: + - rhel-8-for-x86_64-baseos-rpms + - rhel-8-for-x86_64-appstream-rpms diff --git a/kogito-runtime-jvm-overrides.yaml b/kogito-runtime-jvm-overrides.yaml index 0c79489a4..0b207c70c 100644 --- a/kogito-runtime-jvm-overrides.yaml +++ b/kogito-runtime-jvm-overrides.yaml @@ -9,7 +9,7 @@ labels: - name: "io.k8s.display-name" value: "Kogito based on Quarkus or Spring Boot JVM image" - name: "io.openshift.tags" - value: "builder,runtime,kogito,quarkus,springboot,jvm" + value: "runtime,kogito,quarkus,springboot,jvm" - name: "io.openshift.s2i.assemble-input-files" value: "/home/kogito/bin" @@ -38,7 +38,6 @@ modules: - name: org.kie.kogito.s2i.core - name: org.kie.kogito.runtime.jvm - ## s2i build . quay.io/kiegroup/kogito-builder:latest kogitotest:10.0 --runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest ## where "." is the sources dir, ie: /data/dev/sources/kogito-examples/rules-quarkus-helloworld run: diff --git a/osbs-extra/rhpam-kogito-builder-rhel8/gating.yaml b/osbs-extra/rhpam-kogito-builder-rhel8/gating.yaml new file mode 100644 index 000000000..236bfdfb6 --- /dev/null +++ b/osbs-extra/rhpam-kogito-builder-rhel8/gating.yaml @@ -0,0 +1,7 @@ +--- !Policy +id: "cvp-rhpam-kogito-builder" +product_versions: + - cvp +decision_context: cvp_default +rules: + - !PassingTestCaseRule {test_case_name: rhpam-kogito-builder.openshift.external} \ No newline at end of file diff --git a/osbs-extra/rhpam-kogito-runtime-jvm-rhel8/gating.yaml b/osbs-extra/rhpam-kogito-runtime-jvm-rhel8/gating.yaml new file mode 100644 index 000000000..7f79b5ffb --- /dev/null +++ b/osbs-extra/rhpam-kogito-runtime-jvm-rhel8/gating.yaml @@ -0,0 +1,7 @@ +--- !Policy +id: "cvp-rhpam-kogito-runtime-jvm" +product_versions: + - cvp +decision_context: cvp_default +rules: + - !PassingTestCaseRule {test_case_name: rhpam-kieserver-kogito-runtime-jvm.openshift.external} \ No newline at end of file diff --git a/rhpam-kogito-builder-rhel8-overrides.yaml b/rhpam-kogito-builder-rhel8-overrides.yaml new file mode 100644 index 000000000..42f11f3af --- /dev/null +++ b/rhpam-kogito-builder-rhel8-overrides.yaml @@ -0,0 +1,25 @@ +schema_version: 1 + +name: "rhpam-7/rhpam-kogito-builder-rhel8" +version: "7.11.0" +from: "registry.redhat.io/ubi8/ubi-minimal:latest" +description: "RHPAM Platform for building Kogito based on Quarkus or SpringBoot" + +labels: + - name: "com.redhat.component" + value: "rhpam-7-kogito-runtime-jvm-rhel8-container" + - name: "io.k8s.display-name" + value: "Red Hat build of Kogito based on Quarkus or SpringBoot" + - name: "io.openshift.tags" + value: "rhpam-kogito,builder,kogito,quarkus,springboot" + +packages: + content_sets_file: content_sets.yaml + +osbs: + configuration: + container_file: container.yaml + extra_dir: osbs-extra/rhpam-kogito-builder-rhel8 + repository: + name: containers/rhpam-7-kogito-builder + branch: rhba-7-rhel-8 diff --git a/rhpam-kogito-imagestream.yaml b/rhpam-kogito-imagestream.yaml new file mode 100644 index 000000000..1ce2e4b2e --- /dev/null +++ b/rhpam-kogito-imagestream.yaml @@ -0,0 +1,50 @@ +kind: ImageStreamList +apiVersion: v1 +metadata: + name: rhpam-kogito-image-streams + annotations: + description: ImageStream definitions for Red Hat build of Kogito images + openshift.io/provider-display-name: Kie Group. +items: + - kind: ImageStream + apiVersion: v1 + metadata: + name: rhpam-kogito-runtime-jvm-rhel8 + annotations: + openshift.io/display-name: Runtime image for Kogito based on Quarkus or SpringBoot JVM image + openshift.io/provider-display-name: Kie Group. + spec: + tags: + - name: '7.11.0' + annotations: + description: Runtime image for Kogito based on Quarkus or SpringBoot JVM image + iconClass: icon-jbpm + tags: rhpam-kogito,runtime,kogito,quarkus,springboot,jvm + supports: quarkus + version: '7.11.0' + referencePolicy: + type: Local + from: + kind: DockerImage + name: registry.redhat.io/rhpam-7/rhpam-kogito-runtime-jvm-rhel8:7.11.0 + - kind: ImageStream + apiVersion: v1 + metadata: + name: rhpam-kogito-builder-rhel8 + annotations: + openshift.io/display-name: Platform for building Kogito based on Quarkus or SpringBoot + openshift.io/provider-display-name: Kie Group. + spec: + tags: + - name: '7.11.0' + annotations: + description: Platform for building Kogito based on Quarkus or SpringBoot + iconClass: icon-jbpm + tags: rhpam-kogito,builder,kogito,quarkus,springboot + supports: quarkus + version: '7.11.0' + referencePolicy: + type: Local + from: + kind: DockerImage + name: registry.redhat.io/rhpam-7/rhpam-kogito-builder-rhel8:7.11.0 diff --git a/rhpam-kogito-runtime-jvm-rhel8-overrides.yaml b/rhpam-kogito-runtime-jvm-rhel8-overrides.yaml new file mode 100644 index 000000000..0cf8c2a44 --- /dev/null +++ b/rhpam-kogito-runtime-jvm-rhel8-overrides.yaml @@ -0,0 +1,25 @@ +schema_version: 1 + +name: "rhpam-7/rhpam-kogito-runtime-jvm-rhel8" +version: "7.11.0" +from: "registry.redhat.io/ubi8/ubi-minimal:latest" +description: "RHPAM Runtime image for Kogito based on Quarkus or SpringBoot JVM image" + +labels: + - name: "com.redhat.component" + value: "rhpam-7-kogito-runtime-jvm-rhel8-container" + - name: "io.k8s.display-name" + value: "Red Hat build of Kogito based on Quarkus or SpringBoot JVM image" + - name: "io.openshift.tags" + value: "rhpam-kogito,runtime,kogito,quarkus,springboot,jvm" + +packages: + content_sets_file: content_sets.yaml + +osbs: + configuration: + container_file: container.yaml + extra_dir: osbs-extra/rhpam-kogito-runtime-jvm-rhel8 + repository: + name: containers/rhpam-7-kogito-runtime-jvm + branch: rhba-7-rhel-8 diff --git a/scripts/README.md b/scripts/README.md index 8f94064b7..de7b159aa 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -4,14 +4,68 @@ On this directory you can find some python scripts used to help with some repeti Today we have these scripts: +- [build-product-image.sh](build-product-image.sh) +- [common.py](common.py) +- [list-images.py](list-images.py) - [manage-kogito-version.py](manage-kogito-version.py) - [push-local-registry.sh](push-local-registry.sh) - [push-staging.py](push-staging.py) +- [run-bats.sh](run-bats.sh) - [update-maven-artifacts.py](update-maven-artifacts.py) - [update-tests.py](update-tests.py) -- [common.py](common.py) -### Managing Kogito images version + + +### Build Product Image Script + +Script should not be used to build community images. Handled by `make build-prod` command. + +To switch the `build_engine` do the following: + +```bash +make BUILD_ENGINE=osbs build-prod +``` + + +It receives the Product image name to build the images. + +The build works in the follow CEKit build hierarchy: + + - image.yaml -> kogito-community-image-name-overrides.yaml -> kogito-product-image-name-overrides.yaml + +Example: + +```bash +cekit --verbose --redhat build --overrides-file kogito-runtime-jvm-overrides.yaml --overrides-file rhpam-kogito-runtime-jvm-rhel8-overrides.yaml docker +``` + +The product image name must respect the community image name: + + - rhpam-$(kogito_image_name)-rhel8 + + +### Common script + +The `common.py` script defines some common functions for the scripts. + + +### List Images Script + +Utilitary script used to retrieve all images that can be built on this repo, there is possible to retrieve +the community image list: + +```bash +$ python3 list-images.py +``` + +And the product image list by using the `--prod` flag: + +```bash +$ python3 list-images.py --prod +``` + + +### Managing Kogito images version script The manage-kogito-version script will help when we need to update the current version due a new release. @@ -189,6 +243,4 @@ $ python update-tests.py --examples-uri https://github.com//kogit This will update the examples uri and/or the ref for the tests. -### Common script -The `common.py` script defines some common functions for the scripts. diff --git a/scripts/build-product-image.sh b/scripts/build-product-image.sh new file mode 100755 index 000000000..709ae4141 --- /dev/null +++ b/scripts/build-product-image.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# Simple usage: /bin/sh scripts/push-local-registry.sh ${REGISTRY} ${SHORTENED_LATEST_VERSION} ${NS} + +ver=$(cekit --version ) +ver=$((${ver//./} + 0)) +if [ ${ver//./} -lt 379 ]; then + echo "Using CEKit version $ver, Please use CEKit version 3.8.0 or greater." + exit 10 +fi + +image="${2}" +if [ "x${image}" == "x" ]; then + echo "image_name can't be empty.." + exit 8 +fi + +BUILD_ENGINE="${3:-docker}" +CEKIT_CMD="cekit --verbose --redhat" + +# extract the community image name from its product relative. +# $1 - prod image name +function get_parent_image_overrides() { + echo "${1}" | awk -v FS="(rhpam-|-rhel8)" '{print $2}' +} + +ACTION=${1} +case ${ACTION} in + "build") + echo "Using ${BUILD_ENGINE} build engine" + ${CEKIT_CMD} build --overrides-file $(get_parent_image_overrides ${image})-overrides.yaml --overrides-file ${image_name}-overrides.yaml ${BUILD_ENGINE} + ;; + + "test") + ${CEKIT_CMD} test --overrides-file $(get_parent_image_overrides ${image})-overrides.yaml --overrides-file ${image_name}-overrides.yaml behave + ;; + *) + echo "Please use build or test actions." + ;; +esac + diff --git a/scripts/common.py b/scripts/common.py index 8f64fcb07..97ea65b36 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -1,5 +1,5 @@ #!/usr/bin/python3 -#This script defines some common function that are used by manage-kogito-version.py and push-staging.py script +# This script defines some common function that are used by manage-kogito-version.py and push-staging.py script import os @@ -10,7 +10,7 @@ # All kogito-image modules that have the kogito version. MODULES = {"kogito-data-index-common", "kogito-data-index-mongodb", "kogito-data-index-infinispan", "kogito-trusty-common", - "kogito-trusty-infinispan","kogito-trusty-redis", + "kogito-trusty-infinispan", "kogito-trusty-redis", "kogito-explainability", "kogito-image-dependencies", "kogito-jobs-service", "kogito-trusty-ui", "kogito-jq", "kogito-kubernetes-client", @@ -27,13 +27,15 @@ IMAGE_STREAM_FILENAME = "kogito-imagestream.yaml" # image.yaml file definition that needs to be updated IMAGE_FILENAME = "image.yaml" -ARTIFACTS_VERSION_ENV_KEY="KOGITO_VERSION" +ARTIFACTS_VERSION_ENV_KEY = "KOGITO_VERSION" -# behave tests that needs to be update +# behave tests that needs to be updated BEHAVE_BASE_DIR = 'tests/features' -BEHAVE_TESTS = {"kogito-builder.feature", "kogito-runtime-jvm.feature", "kogito-runtime-native.feature"} +BEHAVE_TESTS = {"kogito-builder-native.feature", "kogito-common-builder-jvm.feature", + "kogito-common-runtime-jvm.feature", "kogito-runtime-native.feature"} + +CLONE_REPO_SCRIPT = 'tests/test-apps/clone-repo.sh' -CLONE_REPO_SCRIPT='tests/test-apps/clone-repo.sh' def yaml_loader(): """ @@ -46,6 +48,7 @@ def yaml_loader(): yaml.indent(mapping=2, sequence=4, offset=2) return yaml + def update_image_version(target_version): """ Update image.yaml version tag. @@ -72,7 +75,8 @@ def update_image_stream(target_version): Update the imagestream file, it will update the tag name, version and image tag. :param target_version: version used to update the imagestream file; """ - print("Updating ImageStream images version from file {0} to version {1}".format(IMAGE_STREAM_FILENAME, target_version)) + print("Updating ImageStream images version from file {0} to version {1}".format(IMAGE_STREAM_FILENAME, + target_version)) try: with open(IMAGE_STREAM_FILENAME) as imagestream: data = yaml_loader().load(imagestream) @@ -80,10 +84,10 @@ def update_image_stream(target_version): for tag_index, tag in enumerate(item['spec']['tags'], start=0): data['items'][item_index]['spec']['tags'][tag_index]['name'] = target_version data['items'][item_index]['spec']['tags'][tag_index]['annotations']['version'] = target_version - imageDict = str.split(data['items'][item_index]['spec']['tags'][tag_index]['from']['name'], ':') + image_dict = str.split(data['items'][item_index]['spec']['tags'][tag_index]['from']['name'], ':') # image name + new version - updatedImageName = imageDict[0] + ':' + target_version - data['items'][item_index]['spec']['tags'][tag_index]['from']['name'] = updatedImageName + updated_image_name = image_dict[0] + ':' + target_version + data['items'][item_index]['spec']['tags'][tag_index]['from']['name'] = updated_image_name with open(IMAGE_STREAM_FILENAME, 'w') as imagestream: yaml_loader().dump(data, imagestream) @@ -91,6 +95,7 @@ def update_image_stream(target_version): except TypeError: raise + def get_all_module_dirs(): """ Retrieve the module directories @@ -105,6 +110,7 @@ def get_all_module_dirs(): return modules + def get_kogito_module_dirs(): """ Retrieve the Kogito module directories @@ -141,20 +147,21 @@ def update_modules_version(target_version): update_module_version(module_dir, target_version) -def update_module_version(moduleDir, target_version): +def update_module_version(module_dir, target_version): """ Set Kogito module.yaml to given version. + :param module_dir: directory where cekit modules are hold :param target_version: version to set into the module """ try: - moduleFile = os.path.join(moduleDir, "module.yaml") - with open(moduleFile) as module: + module_file = os.path.join(module_dir, "module.yaml") + with open(module_file) as module: data = yaml_loader().load(module) print( "Updating module {0} version from {1} to {2}".format(data['name'], data['version'], target_version)) data['version'] = target_version - with open(moduleFile, 'w') as module: + with open(module_file, 'w') as module: yaml_loader().dump(data, module) except TypeError: @@ -179,14 +186,15 @@ def retrieve_artifacts_version(): def update_artifacts_version_env_in_image(artifacts_version): """ Update `KOGITO_VERSION` env var in image.yaml. - :param target_version: kogito version used to update image.yaml which contains the `KOGITO_VERSION` env var + :param artifacts_version: kogito version used to update image.yaml which contains the `KOGITO_VERSION` env var """ try: with open(IMAGE_FILENAME) as imageFile: data = yaml_loader().load(imageFile) for index, env in enumerate(data['envs'], start=0): if env['name'] == ARTIFACTS_VERSION_ENV_KEY: - print("Updating image.yaml env var {0} with value {1}".format(ARTIFACTS_VERSION_ENV_KEY, artifacts_version)) + print("Updating image.yaml env var {0} with value {1}".format(ARTIFACTS_VERSION_ENV_KEY, + artifacts_version)) data['envs'][index]['value'] = artifacts_version with open(IMAGE_FILENAME, 'w') as imageFile: @@ -240,10 +248,11 @@ def update_maven_repo_in_behave_tests(repo_url, replaceJbossRepository): """ print("Set maven repo {} in behave tests".format(repo_url)) pattern = re.compile('\|\s*variable[\s]*\|[\s]*value[\s]*\|') - envVarKey = "MAVEN_REPO_URL" + env_var_key = "MAVEN_REPO_URL" if replaceJbossRepository: - envVarKey = "JBOSS_MAVEN_REPO_URL" - replacement = "| variable | value |\n | {} | {} |\n | MAVEN_DOWNLOAD_OUTPUT | true |".format(envVarKey, repo_url) + env_var_key = "JBOSS_MAVEN_REPO_URL" + replacement = "| variable | value |\n | {} | {} |\n | MAVEN_DOWNLOAD_OUTPUT | true |".format(env_var_key, + repo_url) update_in_behave_tests(pattern, replacement) @@ -291,23 +300,24 @@ def update_examples_uri_in_clone_repo(examples_uri): update_in_file(CLONE_REPO_SCRIPT, pattern, replacement) -def update_maven_repo_in_clone_repo(repo_url, replaceJbossRepository): +def update_maven_repo_in_clone_repo(repo_url, replace_jboss_repository): """ Update maven repository into clone-repo.sh script :param repo_url: Maven repository url - :param replaceJbossRepository: Set to true if default Jboss repository needs to be overriden + :param replace_jboss_repository: Set to true if default Jboss repository needs to be overridden """ print("Set maven repo {} in clone-repo script".format(repo_url)) pattern = "" replacement = "" - if replaceJbossRepository: + if replace_jboss_repository: pattern = re.compile(r'(export JBOSS_MAVEN_REPO_URL=.*)') replacement = 'export JBOSS_MAVEN_REPO_URL="{}"'.format(repo_url) - else : + else: pattern = re.compile(r'(# export MAVEN_REPO_URL=.*)') replacement = 'export MAVEN_REPO_URL="{}"'.format(repo_url) update_in_file(CLONE_REPO_SCRIPT, pattern, replacement) + def ignore_maven_self_signed_certificate_in_clone_repo(): """ Sets the environment variable to ignore the self-signed certificates in maven diff --git a/scripts/list-images.py b/scripts/list-images.py index b544e137d..e3d79e367 100644 --- a/scripts/list-images.py +++ b/scripts/list-images.py @@ -1,15 +1,28 @@ #!/usr/bin/python3 -#Script responsible to update the tests with -#Should be run from root directory of the repository -#Sample usage: python3 scripts/update-tests.py +# Script responsible to update the tests with +# Should be run from root directory of the repository +# Sample usage: python3 scripts/update-tests.py +import argparse import sys -sys.dont_write_bytecode = True import common +sys.dont_write_bytecode = True + +PRODUCT_PREFIX = "rhpam" + if __name__ == "__main__": - images = sorted(common.get_all_images()) + parser = argparse.ArgumentParser( + description='Kogito Version Manager - List Images by Community and Product version') + parser.add_argument('--prod', default=False, action='store_true', help='List product images') + + args = parser.parse_args() - for img in images: - print(img) + for img in sorted(common.get_all_images()): + if args.prod: + if img.startswith(PRODUCT_PREFIX): + print(img) + else: + if not img.startswith(PRODUCT_PREFIX): + print(img) diff --git a/scripts/push-local-registry.sh b/scripts/push-local-registry.sh index 4c34c9df2..157eb11ee 100644 --- a/scripts/push-local-registry.sh +++ b/scripts/push-local-registry.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Simple usage: /bin/sh scripts/push-local-registry.sh ${REGISTRY} ${SHORTENED_LATEST_VERSION} ${NS} BUILD_ENGINE="docker" diff --git a/tests/features/common-build-runtime.feature b/tests/features/common-build-runtime.feature index 004b680cb..dcf5912b6 100644 --- a/tests/features/common-build-runtime.feature +++ b/tests/features/common-build-runtime.feature @@ -1,4 +1,4 @@ -@quay.io/kiegroup/kogito-builder @quay.io/kiegroup/kogito-runtime-native @quay.io/kiegroup/kogito-runtime-jvm +@quay.io/kiegroup/kogito-builder @quay.io/kiegroup/kogito-runtime-native @quay.io/kiegroup/kogito-runtime-jvm @rhpam-7/rhpam-kogito-builder-rhel8 @rhpam-7/rhpam-kogito-runtime-jvm-rhel8 Feature: Common tests for Kogito builder and runtime images Scenario: Verify if usage help is correctly called diff --git a/tests/features/common.feature b/tests/features/common.feature index 6a5737123..4f9ce9604 100644 --- a/tests/features/common.feature +++ b/tests/features/common.feature @@ -1,4 +1,4 @@ -@quay.io/kiegroup/kogito-builder @quay.io/kiegroup/kogito-runtime-jvm @quay.io/kiegroup/kogito-runtime-native @quay.io/kiegroup/kogito-data-index-infinispan @quay.io/kiegroup/kogito-data-index-mongodb @quay.io/kiegroup/kogito-trusty-infinispan @quay.io/kiegroup/kogito-trusty-redis +@quay.io/kiegroup/kogito-builder @quay.io/kiegroup/kogito-runtime-jvm @quay.io/kiegroup/kogito-runtime-native @quay.io/kiegroup/kogito-data-index-infinispan @quay.io/kiegroup/kogito-data-index-mongodb @quay.io/kiegroup/kogito-trusty-infinispan @quay.io/kiegroup/kogito-trusty-redis @rhpam-7/rhpam-kogito-runtime-jvm-rhel8 @rhpam-7/rhpam-kogito-builder-rhel8 Feature: Common tests for Kogito images Scenario: Verify if Kogito user is correctly configured @@ -6,4 +6,3 @@ Feature: Common tests for Kogito images Then run bash -c 'echo $USER' in container and check its output for kogito And run sh -c 'echo $HOME' in container and check its output for /home/kogito And run sh -c 'id' in container and check its output for uid=1001(kogito) gid=0(root) groups=0(root),1001(kogito) - diff --git a/tests/features/data-index/kogito-data-index-infinispan.feature b/tests/features/data-index/kogito-data-index-infinispan.feature index d60e8afbd..ad92d02bf 100644 --- a/tests/features/data-index/kogito-data-index-infinispan.feature +++ b/tests/features/data-index/kogito-data-index-infinispan.feature @@ -1,7 +1,7 @@ @quay.io/kiegroup/kogito-data-index-infinispan Feature: Kogito-data-index infinispan feature. - Scenario: verify if all labels are correctly set. + Scenario: verify if all labels are correctly set on kogito-data-index-infinispan image Given image is built Then the image should contain label maintainer with value kogito And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i diff --git a/tests/features/data-index/kogito-data-index-mongodb.feature b/tests/features/data-index/kogito-data-index-mongodb.feature index 4def584ef..9ab3e5b91 100644 --- a/tests/features/data-index/kogito-data-index-mongodb.feature +++ b/tests/features/data-index/kogito-data-index-mongodb.feature @@ -1,7 +1,7 @@ @quay.io/kiegroup/kogito-data-index-mongodb Feature: Kogito-data-index mongodb feature. - Scenario: verify if all labels are correctly set. + Scenario: verify if all labels are correctly set on kogito-data-index-mongodb image Given image is built Then the image should contain label maintainer with value kogito And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i diff --git a/tests/features/kogito-builder-native.feature b/tests/features/kogito-builder-native.feature new file mode 100644 index 000000000..7e1a170a8 --- /dev/null +++ b/tests/features/kogito-builder-native.feature @@ -0,0 +1,140 @@ +@quay.io/kiegroup/kogito-builder @rhpam-7/rhpam-kogito-builder-rhel8 +Feature: kogito-builder image native build tests + + Scenario: verify java cacerts and libsunec are available in the given kogito builder container. + When container is started with command bash + Then file /home/kogito/ssl-libs/libsunec.so should exist + And file /home/kogito/cacerts should exist + + Scenario: verify if the maven and graal vm settings are correct on kogito-builder image for native + When container is started with command bash + Then run sh -c 'echo $MAVEN_HOME' in container and immediately check its output for /usr/share/maven + And run sh -c 'echo $MAVEN_VERSION' in container and immediately check its output for 3.6.2 + And run sh -c 'echo $JAVA_HOME' in container and immediately check its output for /usr/lib/jvm/java-11 + And run sh -c 'echo $GRAALVM_HOME' in container and immediately check its output for /usr/share/graalvm + And run sh -c 'echo $GRAALVM_VERSION' in container and immediately check its output for 20.2.0 + + Scenario: Verify if the s2i build is finished as expected using native build and runtime image + Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld using master and runtime-image quay.io/kiegroup/kogito-runtime-native:latest + | variable | value | + | NATIVE | true | + | RUNTIME_TYPE | quarkus | + | LIMIT_MEMORY | 3221225472 | + Then check that page is served + | property | value | + | port | 8080 | + | path | /hello | + | request_method | POST | + | content_type | application/json | + | request_body | {"strings":["hello"]} | + | wait | 80 | + | expected_phrase | ["hello","world"] | + And file /home/kogito/bin/rules-quarkus-helloworld-runner should exist + And file /home/kogito/ssl-libs/libsunec.so should exist + And file /home/kogito/cacerts should exist + And s2i build log should contain -J-Xmx4g + + Scenario: Verify if the s2i build is finished as expected using native build and no runtime image + Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld using master + | variable | value | + | NATIVE | true | + | RUNTIME_TYPE | quarkus | + | LIMIT_MEMORY | 3221225472 | + Then check that page is served + | property | value | + | port | 8080 | + | path | /hello | + | request_method | POST | + | content_type | application/json | + | request_body | {"strings":["hello"]} | + | wait | 80 | + | expected_phrase | ["hello","world"] | + And file /home/kogito/bin/rules-quarkus-helloworld-runner should exist + And file /home/kogito/ssl-libs/libsunec.so should exist + And file /home/kogito/cacerts should exist + And s2i build log should contain -J-Xmx4g + + Scenario: Verify if the s2i build is finished as expected performing a native build and if it is listening on the expected port, test uses custom properties file to test the port configuration. + Given s2i build /tmp/kogito-examples from rules-quarkus-helloworld using master and runtime-image quay.io/kiegroup/kogito-runtime-native:latest + | variable | value | + | NATIVE | true | + | RUNTIME_TYPE | quarkus | + | LIMIT_MEMORY | 6442450944 | + Then check that page is served + | property | value | + | port | 8080 | + | path | /hello | + | request_method | POST | + | content_type | application/json | + | request_body | {"strings":["hello"]} | + | wait | 80 | + | expected_phrase | ["hello","world"] | + And file /home/kogito/bin/rules-quarkus-helloworld-runner should exist + + #ignore until https://issues.redhat.com/browse/KOGITO-3638 is resolved + @ignore + Scenario: Verify if the s2i build is finished as expected performing a native build with persistence enabled + Given s2i build https://github.com/kiegroup/kogito-examples.git from process-quarkus-example using master and runtime-image quay.io/kiegroup/kogito-runtime-native:latest + | variable | value | + | RUNTIME_TYPE | quarkus | + | NATIVE | true | + | LIMIT_MEMORY | 6442450944 | + | MAVEN_ARGS_APPEND | -Ppersistence | + Then file /home/kogito/bin/process-quarkus-example-runner should exist + And s2i build log should contain '/home/kogito/bin/demo.orders.proto' -> '/home/kogito/data/protobufs/demo.orders.proto' + And s2i build log should contain '/home/kogito/bin/persons.proto' -> '/home/kogito/data/protobufs/persons.proto' + + Scenario: Perform a incremental s2i build for native test + Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld with env and incremental using master + | variable | value | + | RUNTIME_TYPE | quarkus | + | NATIVE | false | + Then s2i build log should not contain WARNING: Clean build will be performed because of error saving previous build artifacts + And file /home/kogito/bin/quarkus-run.jar should exist + And check that page is served + | property | value | + | port | 8080 | + | path | /hello | + | request_method | POST | + | content_type | application/json | + | request_body | {"strings":["hello"]} | + | wait | 80 | + | expected_phrase | ["hello","world"] | + + # Since the same image is used we can do a subsequent incremental build and verify if it is working as expected. + Scenario:Perform a second incremental s2i build for native scenario, this time, with native enabled + Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld with env and incremental using master + | variable | value | + | RUNTIME_TYPE | quarkus | + | NATIVE | true | + | LIMIT_MEMORY | 6442450944 | + Then s2i build log should contain Expanding artifacts from incremental build... + And s2i build log should not contain WARNING: Clean build will be performed because of error saving previous build artifacts + And file /home/kogito/bin/rules-quarkus-helloworld-runner should exist + And check that page is served + | property | value | + | port | 8080 | + | path | /hello | + | request_method | POST | + | content_type | application/json | + | request_body | {"strings":["hello"]} | + | wait | 80 | + | expected_phrase | ["hello","world"] | + + Scenario: Verify that the Kogito Maven archetype is generating the project and compiling it correctly using native build + Given s2i build /tmp/kogito-examples from dmn-example using master and runtime-image quay.io/kiegroup/kogito-runtime-native:latest + | variable | value | + | RUNTIME_TYPE | quarkus | + | NATIVE | true | + | LIMIT_MEMORY | 6442450944 | + | KOGITO_VERSION | 2.0.0-SNAPSHOT | + Then file /home/kogito/bin/project-1.0-SNAPSHOT-runner should exist + And check that page is served + | property | value | + | port | 8080 | + | path | /Traffic%20Violation | + | wait | 80 | + | expected_phrase | Should the driver be suspended? | + | request_method | POST | + | content_type | application/json | + | request_body | {"Driver": {"Points": 2}, "Violation": {"Type": "speed","Actual Speed": 120,"Speed Limit": 100}} | diff --git a/tests/features/kogito-builder.feature b/tests/features/kogito-builder.feature index 2037dca1b..6bce80c90 100644 --- a/tests/features/kogito-builder.feature +++ b/tests/features/kogito-builder.feature @@ -1,249 +1,7 @@ @quay.io/kiegroup/kogito-builder Feature: kogito-builder image tests - Scenario: Verify if the s2i build is finished as expected using native build and runtime image - Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld using master and runtime-image quay.io/kiegroup/kogito-runtime-native:latest - | variable | value | - | NATIVE | true | - | RUNTIME_TYPE | quarkus | - | LIMIT_MEMORY | 3221225472 | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/rules-quarkus-helloworld-runner should exist - And file /home/kogito/ssl-libs/libsunec.so should exist - And file /home/kogito/cacerts should exist - And s2i build log should contain -J-Xmx4g - - Scenario: Verify if the s2i build is finished as expected using native build and no runtime image - Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld using master - | variable | value | - | NATIVE | true | - | RUNTIME_TYPE | quarkus | - | LIMIT_MEMORY | 3221225472 | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/rules-quarkus-helloworld-runner should exist - And file /home/kogito/ssl-libs/libsunec.so should exist - And file /home/kogito/cacerts should exist - And s2i build log should contain -J-Xmx4g - - Scenario: Verify if the s2i build is finished as expected with non native build and no runtime image - Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld using master - | variable | value | - | NATIVE | false | - | RUNTIME_TYPE | quarkus | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/quarkus-run.jar should exist - And file /home/kogito/ssl-libs/libsunec.so should exist - And file /home/kogito/cacerts should exist - - Scenario: Verify if the s2i build is finished as expected with non native build and no runtime image and no RUNTIME_TYPE defined - Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld using master - | variable | value | - | NATIVE | false | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/quarkus-run.jar should exist - And file /home/kogito/ssl-libs/libsunec.so should exist - And file /home/kogito/cacerts should exist - - Scenario: Verify if the s2i build is finished as expected performing a non native build with runtime image - Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | NATIVE | false | - | RUNTIME_TYPE | quarkus | - | JAVA_OPTIONS | -Dquarkus.log.level=DEBUG | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/quarkus-run.jar should exist - And container log should contain DEBUG [io.qua. - And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Dquarkus.log.level=DEBUG - - Scenario: Verify if the s2i build is finished as expected performing a non native build and if it is listening on the expected port , test uses custom properties file to test the port configuration. - Given s2i build /tmp/kogito-examples from rules-quarkus-helloworld using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/quarkus-run.jar should exist - - Scenario: Verify if the s2i build is finished as expected performing a native build and if it is listening on the expected port, test uses custom properties file to test the port configuration. - Given s2i build /tmp/kogito-examples from rules-quarkus-helloworld using master and runtime-image quay.io/kiegroup/kogito-runtime-native:latest - | variable | value | - | NATIVE | true | - | RUNTIME_TYPE | quarkus | - | LIMIT_MEMORY | 6442450944 | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/rules-quarkus-helloworld-runner should exist - - Scenario: Verify if the s2i build is finished as expected performing a non native build with persistence enabled - Given s2i build https://github.com/kiegroup/kogito-examples.git from process-quarkus-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | NATIVE | false | - | RUNTIME_TYPE | quarkus | - | MAVEN_ARGS_APPEND | -Ppersistence | - Then file /home/kogito/bin/quarkus-run.jar should exist - And s2i build log should contain '/home/kogito/bin/demo.orders.proto' -> '/home/kogito/data/protobufs/demo.orders.proto' - And s2i build log should contain '/home/kogito/bin/persons.proto' -> '/home/kogito/data/protobufs/persons.proto' - - #ignore until https://issues.redhat.com/browse/KOGITO-3638 is resolved - @ignore - Scenario: Verify if the s2i build is finished as expected performing a native build with persistence enabled - Given s2i build https://github.com/kiegroup/kogito-examples.git from process-quarkus-example using master and runtime-image quay.io/kiegroup/kogito-runtime-native:latest - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | true | - | LIMIT_MEMORY | 6442450944 | - | MAVEN_ARGS_APPEND | -Ppersistence | - Then file /home/kogito/bin/process-quarkus-example-runner should exist - And s2i build log should contain '/home/kogito/bin/demo.orders.proto' -> '/home/kogito/data/protobufs/demo.orders.proto' - And s2i build log should contain '/home/kogito/bin/persons.proto' -> '/home/kogito/data/protobufs/persons.proto' - - Scenario: Verify if the multi-module s2i build is finished as expected performing a non native build - Given s2i build https://github.com/kiegroup/kogito-examples.git from . using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - | ARTIFACT_DIR | rules-quarkus-helloworld/target | - | MAVEN_ARGS_APPEND | -pl rules-quarkus-helloworld -am | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/quarkus-run.jar should exist - - Scenario: Verify if the multi-module s2i build is finished as expected performing a native build - Given s2i build https://github.com/kiegroup/kogito-examples.git from . using master and runtime-image quay.io/kiegroup/kogito-runtime-native:latest - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | true | - | LIMIT_MEMORY | 6442450944 | - | ARTIFACT_DIR | rules-quarkus-helloworld/target | - | MAVEN_ARGS_APPEND | -pl rules-quarkus-helloworld -am | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/rules-quarkus-helloworld-runner should exist - - Scenario: Perform a incremental s2i build - Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld with env and incremental using master - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - Then s2i build log should not contain WARNING: Clean build will be performed because of error saving previous build artifacts - And file /home/kogito/bin/quarkus-run.jar should exist - And check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - - # Since the same image is used we can do a subsequent incremental build and verify if it is working as expected. - Scenario: Perform a second incremental s2i build - Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld with env and incremental using master - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - Then s2i build log should contain Expanding artifacts from incremental build... - And s2i build log should not contain WARNING: Clean build will be performed because of error saving previous build artifacts - And file /home/kogito/bin/quarkus-run.jar should exist - And check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - - Scenario: Perform a third incremental s2i build, this time, with native enabled - Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld with env and incremental using master - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | true | - | LIMIT_MEMORY | 6442450944 | - Then s2i build log should contain Expanding artifacts from incremental build... - And s2i build log should not contain WARNING: Clean build will be performed because of error saving previous build artifacts - And file /home/kogito/bin/rules-quarkus-helloworld-runner should exist - And check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - - Scenario: verify if all labels are correctly set. + Scenario: verify if all labels are correctly set on kogito-builder image Given image is built Then the image should contain label maintainer with value kogito And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i @@ -253,194 +11,3 @@ Feature: kogito-builder image tests And the image should contain label io.k8s.display-name with value Kogito based on Quarkus or Spring Boot And the image should contain label io.openshift.tags with value builder,kogito,quarkus,springboot - Scenario: verify java cacerts and libsunec are available in the given container. - When container is started with command bash - Then file /home/kogito/ssl-libs/libsunec.so should exist - And file /home/kogito/cacerts should exist - - Scenario: verify if the maven and graal vm settings are correct - When container is started with command bash - Then run sh -c 'echo $MAVEN_HOME' in container and immediately check its output for /usr/share/maven - And run sh -c 'echo $MAVEN_VERSION' in container and immediately check its output for 3.6.2 - And run sh -c 'echo $JAVA_HOME' in container and immediately check its output for /usr/lib/jvm/java-11 - And run sh -c 'echo $GRAALVM_HOME' in container and immediately check its output for /usr/share/graalvm - And run sh -c 'echo $GRAALVM_VERSION' in container and immediately check its output for 20.2.0 - - Scenario: Verify that the Kogito Maven archetype is generating the project and compiling it correctly - Given s2i build /tmp/kogito-examples from dmn-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - | KOGITO_VERSION | 2.0.0-SNAPSHOT | - Then file /home/kogito/bin/project-1.0-SNAPSHOT-runner.jar should exist - And check that page is served - | property | value | - | port | 8080 | - | path | /Traffic%20Violation | - | wait | 80 | - | expected_phrase | Should the driver be suspended? | - | request_method | POST | - | content_type | application/json | - | request_body | {"Driver": {"Points": 2}, "Violation": {"Type": "speed","Actual Speed": 120,"Speed Limit": 100}} | - - Scenario: Verify that the Kogito Maven archetype is generating the project and compiling it correctly using native build - Given s2i build /tmp/kogito-examples from dmn-example using master and runtime-image quay.io/kiegroup/kogito-runtime-native:latest - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | true | - | LIMIT_MEMORY | 6442450944 | - | KOGITO_VERSION | 2.0.0-SNAPSHOT | - Then file /home/kogito/bin/project-1.0-SNAPSHOT-runner should exist - And check that page is served - | property | value | - | port | 8080 | - | path | /Traffic%20Violation | - | wait | 80 | - | expected_phrase | Should the driver be suspended? | - | request_method | POST | - | content_type | application/json | - | request_body | {"Driver": {"Points": 2}, "Violation": {"Type": "speed","Actual Speed": 120,"Speed Limit": 100}} | - - Scenario: Verify that the Kogito Maven archetype is generating the project and compiling it correctly with custom group id, archetype & version - Given s2i build /tmp/kogito-examples from dmn-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - | KOGITO_VERSION | 2.0.0-SNAPSHOT | - | PROJECT_GROUP_ID | com.mycompany | - | PROJECT_ARTIFACT_ID | myproject | - | PROJECT_VERSION | 2.0-SNAPSHOT | - Then file /home/kogito/bin/myproject-2.0-SNAPSHOT-runner.jar should exist - And check that page is served - | property | value | - | port | 8080 | - | path | /Traffic%20Violation | - | wait | 80 | - | expected_phrase | Should the driver be suspended? | - | request_method | POST | - | content_type | application/json | - | request_body | {"Driver": {"Points": 2}, "Violation": {"Type": "speed","Actual Speed": 120,"Speed Limit": 100}} | - -#### SpringBoot Scenarios - - Scenario: Verify if the s2i build is finished as expected with debug enabled - Given s2i build https://github.com/kiegroup/kogito-examples.git from process-springboot-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | RUNTIME_TYPE | springboot | - | JAVA_OPTIONS | -Ddebug=true | - Then check that page is served - | property | value | - | port | 8080 | - | path | /orders | - | wait | 80 | - | request_method | POST | - | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | - | content_type | application/json | - | expected_status_code | 201 | - And file /home/kogito/bin/process-springboot-example.jar should exist - And container log should contain main] .c.l.ClasspathLoggingApplicationListener - And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true - - Scenario: Verify if the s2i build is finished as expected with no runtime image and debug enabled - Given s2i build https://github.com/kiegroup/kogito-examples.git from process-springboot-example using master - | variable | value | - | JAVA_OPTIONS | -Ddebug=true | - | RUNTIME_TYPE | springboot | - Then check that page is served - | property | value | - | port | 8080 | - | path | /orders | - | wait | 80 | - | request_method | POST | - | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | - | content_type | application/json | - | expected_status_code | 201 | - And file /home/kogito/bin/process-springboot-example.jar should exist - And container log should contain main] .c.l.ClasspathLoggingApplicationListener - And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true - - Scenario: Verify if the s2i build is finished as expected and if it is listening on the expected port, test uses custom properties file to test the port configuration. - Given s2i build /tmp/kogito-examples from process-springboot-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - # Leave those here as placeholder for scripts adding variable to the test. No impact on tests if empty. - | variable | value | - | RUNTIME_TYPE | springboot | - Then check that page is served - | property | value | - | port | 8080 | - | path | /orders | - | wait | 80 | - | request_method | POST | - | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | - | content_type | application/json | - | expected_status_code | 201 | - And file /home/kogito/bin/process-springboot-example.jar should exist - And container log should contain Tomcat initialized with port(s): 8080 (http) - - Scenario: Verify if the s2i build is finished as expected with persistence enabled - Given s2i build https://github.com/kiegroup/kogito-examples.git from process-springboot-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | MAVEN_ARGS_APPEND | -Ppersistence | - | RUNTIME_TYPE | springboot | - Then file /home/kogito/bin/process-springboot-example.jar should exist - And s2i build log should contain '/home/kogito/bin/demo.orders.proto' -> '/home/kogito/data/protobufs/demo.orders.proto' - And s2i build log should contain '/home/kogito/bin/persons.proto' -> '/home/kogito/data/protobufs/persons.proto' - - Scenario: Verify if the s2i build is finished as expected using multi-module build with debug enabled - Given s2i build https://github.com/kiegroup/kogito-examples.git from . using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | JAVA_OPTIONS | -Ddebug=true | - | RUNTIME_TYPE | springboot | - | ARTIFACT_DIR | process-springboot-example/target | - | MAVEN_ARGS_APPEND | -pl process-springboot-example -am | - Then check that page is served - | property | value | - | port | 8080 | - | path | /orders | - | wait | 80 | - | request_method | POST | - | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | - | content_type | application/json | - | expected_status_code | 201 | - And file /home/kogito/bin/process-springboot-example.jar should exist - And container log should contain main] .c.l.ClasspathLoggingApplicationListener - And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true - - Scenario: Perform a incremental s2i build - Given s2i build https://github.com/kiegroup/kogito-examples.git from process-springboot-example with env and incremental using master - # Leave those here as placeholder for scripts adding variable to the test. No impact on tests if empty. - | variable | value | - | RUNTIME_TYPE | springboot | - Then check that page is served - | property | value | - | port | 8080 | - | path | /orders | - | wait | 80 | - | request_method | POST | - | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | - | content_type | application/json | - | expected_status_code | 201 | - And file /home/kogito/bin/process-springboot-example.jar should exist - - # Since the same image is used we can do a subsequent incremental build and verify if it is working as expected. - Scenario: Perform a second incremental s2i build - Given s2i build https://github.com/kiegroup/kogito-examples.git from process-springboot-example with env and incremental using master - # Leave those here as placeholder for scripts adding variable to the test. No impact on tests if empty. - | variable | value | - | RUNTIME_TYPE | springboot | - Then s2i build log should contain Expanding artifacts from incremental build... - And s2i build log should not contain WARNING: Clean build will be performed because of error saving previous build artifacts - - Scenario: Verify that the Kogito Maven archetype is generating the project and compiling it correctly when runtime is springboot - Given s2i build /tmp/kogito-examples from dmn-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | KOGITO_VERSION | 2.0.0-SNAPSHOT | - | RUNTIME_TYPE | springboot | - Then file /home/kogito/bin/project-1.0-SNAPSHOT.jar should exist - - - Scenario: Verify if the s2i build is finished as expected with uber-jar package type built - Given s2i build https://github.com/kiegroup/kogito-examples.git from process-quarkus-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | MAVEN_ARGS_APPEND | -Dquarkus.package.type=uber-jar | - | RUNTIME_TYPE | quarkus | - Then file /home/kogito/bin/process-quarkus-example-runner.jar should exist diff --git a/tests/features/kogito-common-builder-jvm.feature b/tests/features/kogito-common-builder-jvm.feature new file mode 100644 index 000000000..3f92bcf9b --- /dev/null +++ b/tests/features/kogito-common-builder-jvm.feature @@ -0,0 +1,303 @@ +@quay.io/kiegroup/kogito-builder @rhpam-7/rhpam-kogito-builder-rhel8 +Feature: kogito-builder image JVM build tests + + Scenario: verify if the maven and java installation are correct + When container is started with command bash + Then run sh -c 'echo $MAVEN_HOME' in container and immediately check its output for /usr/share/maven + And run sh -c 'echo $MAVEN_VERSION' in container and immediately check its output for 3.6.2 + And run sh -c 'echo $JAVA_HOME' in container and immediately check its output for /usr/lib/jvm/java-11 + + Scenario: Verify if the s2i build is finished as expected with non native build and no runtime image + Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld using master + | variable | value | + | NATIVE | false | + | RUNTIME_TYPE | quarkus | + Then check that page is served + | property | value | + | port | 8080 | + | path | /hello | + | request_method | POST | + | content_type | application/json | + | request_body | {"strings":["hello"]} | + | wait | 80 | + | expected_phrase | ["hello","world"] | + And file /home/kogito/bin/quarkus-run.jar should exist + And file /home/kogito/ssl-libs/libsunec.so should exist + And file /home/kogito/cacerts should exist + + Scenario: Verify if the s2i build is finished as expected with non native build and no runtime image and no RUNTIME_TYPE defined + Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld using master + | variable | value | + | NATIVE | false | + Then check that page is served + | property | value | + | port | 8080 | + | path | /hello | + | request_method | POST | + | content_type | application/json | + | request_body | {"strings":["hello"]} | + | wait | 80 | + | expected_phrase | ["hello","world"] | + And file /home/kogito/bin/quarkus-run.jar should exist + And file /home/kogito/ssl-libs/libsunec.so should exist + And file /home/kogito/cacerts should exist + + Scenario: Verify if the s2i build is finished as expected performing a non native build with runtime image + Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest + | variable | value | + | NATIVE | false | + | RUNTIME_TYPE | quarkus | + | JAVA_OPTIONS | -Dquarkus.log.level=DEBUG | + Then check that page is served + | property | value | + | port | 8080 | + | path | /hello | + | request_method | POST | + | content_type | application/json | + | request_body | {"strings":["hello"]} | + | wait | 80 | + | expected_phrase | ["hello","world"] | + And file /home/kogito/bin/quarkus-run.jar should exist + And container log should contain DEBUG [io.qua. + And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Dquarkus.log.level=DEBUG + + Scenario: Verify if the s2i build is finished as expected performing a non native build and if it is listening on the expected port , test uses custom properties file to test the port configuration. + Given s2i build /tmp/kogito-examples from rules-quarkus-helloworld using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest + | variable | value | + | RUNTIME_TYPE | quarkus | + | NATIVE | false | + Then check that page is served + | property | value | + | port | 8080 | + | path | /hello | + | request_method | POST | + | content_type | application/json | + | request_body | {"strings":["hello"]} | + | wait | 80 | + | expected_phrase | ["hello","world"] | + And file /home/kogito/bin/quarkus-run.jar should exist + + Scenario: Verify if the s2i build is finished as expected performing a non native build with persistence enabled + Given s2i build https://github.com/kiegroup/kogito-examples.git from process-quarkus-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest + | variable | value | + | NATIVE | false | + | RUNTIME_TYPE | quarkus | + | MAVEN_ARGS_APPEND | -Ppersistence | + Then file /home/kogito/bin/quarkus-run.jar should exist + And s2i build log should contain '/home/kogito/bin/demo.orders.proto' -> '/home/kogito/data/protobufs/demo.orders.proto' + And s2i build log should contain '/home/kogito/bin/persons.proto' -> '/home/kogito/data/protobufs/persons.proto' + + Scenario: Verify if the multi-module s2i build is finished as expected performing a non native build + Given s2i build https://github.com/kiegroup/kogito-examples.git from . using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest + | variable | value | + | RUNTIME_TYPE | quarkus | + | NATIVE | false | + | ARTIFACT_DIR | rules-quarkus-helloworld/target | + | MAVEN_ARGS_APPEND | -pl rules-quarkus-helloworld -am | + Then check that page is served + | property | value | + | port | 8080 | + | path | /hello | + | request_method | POST | + | content_type | application/json | + | request_body | {"strings":["hello"]} | + | wait | 80 | + | expected_phrase | ["hello","world"] | + And file /home/kogito/bin/quarkus-run.jar should exist + + Scenario: Perform a incremental s2i build using quarkus runtime type + Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld with env and incremental using master + | variable | value | + | RUNTIME_TYPE | quarkus | + | NATIVE | false | + Then s2i build log should not contain WARNING: Clean build will be performed because of error saving previous build artifacts + And file /home/kogito/bin/quarkus-run.jar should exist + And check that page is served + | property | value | + | port | 8080 | + | path | /hello | + | request_method | POST | + | content_type | application/json | + | request_body | {"strings":["hello"]} | + | wait | 80 | + | expected_phrase | ["hello","world"] | + + # Since the same image is used we can do a subsequent incremental build and verify if it is working as expected. + Scenario: Perform a second incremental s2i build using quarkus runtime type + Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld with env and incremental using master + | variable | value | + | RUNTIME_TYPE | quarkus | + | NATIVE | false | + Then s2i build log should contain Expanding artifacts from incremental build... + And s2i build log should not contain WARNING: Clean build will be performed because of error saving previous build artifacts + And file /home/kogito/bin/quarkus-run.jar should exist + And check that page is served + | property | value | + | port | 8080 | + | path | /hello | + | request_method | POST | + | content_type | application/json | + | request_body | {"strings":["hello"]} | + | wait | 80 | + | expected_phrase | ["hello","world"] | + + Scenario: Verify that the Kogito Maven archetype is generating the project and compiling it correctly + Given s2i build /tmp/kogito-examples from dmn-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest + | variable | value | + | RUNTIME_TYPE | quarkus | + | NATIVE | false | + | KOGITO_VERSION | 2.0.0-SNAPSHOT | + Then file /home/kogito/bin/project-1.0-SNAPSHOT-runner.jar should exist + And check that page is served + | property | value | + | port | 8080 | + | path | /Traffic%20Violation | + | wait | 80 | + | expected_phrase | Should the driver be suspended? | + | request_method | POST | + | content_type | application/json | + | request_body | {"Driver": {"Points": 2}, "Violation": {"Type": "speed","Actual Speed": 120,"Speed Limit": 100}} | + + Scenario: Verify that the Kogito Maven archetype is generating the project and compiling it correctly with custom group id, archetype & version + Given s2i build /tmp/kogito-examples from dmn-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest + | variable | value | + | RUNTIME_TYPE | quarkus | + | NATIVE | false | + | KOGITO_VERSION | 2.0.0-SNAPSHOT | + | PROJECT_GROUP_ID | com.mycompany | + | PROJECT_ARTIFACT_ID | myproject | + | PROJECT_VERSION | 2.0-SNAPSHOT | + Then file /home/kogito/bin/myproject-2.0-SNAPSHOT-runner.jar should exist + And check that page is served + | property | value | + | port | 8080 | + | path | /Traffic%20Violation | + | wait | 80 | + | expected_phrase | Should the driver be suspended? | + | request_method | POST | + | content_type | application/json | + | request_body | {"Driver": {"Points": 2}, "Violation": {"Type": "speed","Actual Speed": 120,"Speed Limit": 100}} | + +#### SpringBoot Scenarios + + Scenario: Verify if the s2i build is finished as expected with debug enabled + Given s2i build https://github.com/kiegroup/kogito-examples.git from process-springboot-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest + | variable | value | + | RUNTIME_TYPE | springboot | + | JAVA_OPTIONS | -Ddebug=true | + Then check that page is served + | property | value | + | port | 8080 | + | path | /orders | + | wait | 80 | + | request_method | POST | + | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | + | content_type | application/json | + | expected_status_code | 201 | + And file /home/kogito/bin/process-springboot-example.jar should exist + And container log should contain main] .c.l.ClasspathLoggingApplicationListener + And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true + + Scenario: Verify if the s2i build is finished as expected with no runtime image and debug enabled + Given s2i build https://github.com/kiegroup/kogito-examples.git from process-springboot-example using master + | variable | value | + | JAVA_OPTIONS | -Ddebug=true | + | RUNTIME_TYPE | springboot | + Then check that page is served + | property | value | + | port | 8080 | + | path | /orders | + | wait | 80 | + | request_method | POST | + | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | + | content_type | application/json | + | expected_status_code | 201 | + And file /home/kogito/bin/process-springboot-example.jar should exist + And container log should contain main] .c.l.ClasspathLoggingApplicationListener + And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true + + Scenario: Verify if the s2i build is finished as expected and if it is listening on the expected port, test uses custom properties file to test the port configuration. + Given s2i build /tmp/kogito-examples from process-springboot-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest + # Leave those here as placeholder for scripts adding variable to the test. No impact on tests if empty. + | variable | value | + | RUNTIME_TYPE | springboot | + Then check that page is served + | property | value | + | port | 8080 | + | path | /orders | + | wait | 80 | + | request_method | POST | + | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | + | content_type | application/json | + | expected_status_code | 201 | + And file /home/kogito/bin/process-springboot-example.jar should exist + And container log should contain Tomcat initialized with port(s): 8080 (http) + + Scenario: Verify if the s2i build is finished as expected with persistence enabled + Given s2i build https://github.com/kiegroup/kogito-examples.git from process-springboot-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest + | variable | value | + | MAVEN_ARGS_APPEND | -Ppersistence | + | RUNTIME_TYPE | springboot | + Then file /home/kogito/bin/process-springboot-example.jar should exist + And s2i build log should contain '/home/kogito/bin/demo.orders.proto' -> '/home/kogito/data/protobufs/demo.orders.proto' + And s2i build log should contain '/home/kogito/bin/persons.proto' -> '/home/kogito/data/protobufs/persons.proto' + + Scenario: Verify if the s2i build is finished as expected using multi-module build with debug enabled + Given s2i build https://github.com/kiegroup/kogito-examples.git from . using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest + | variable | value | + | JAVA_OPTIONS | -Ddebug=true | + | RUNTIME_TYPE | springboot | + | ARTIFACT_DIR | process-springboot-example/target | + | MAVEN_ARGS_APPEND | -pl process-springboot-example -am | + Then check that page is served + | property | value | + | port | 8080 | + | path | /orders | + | wait | 80 | + | request_method | POST | + | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | + | content_type | application/json | + | expected_status_code | 201 | + And file /home/kogito/bin/process-springboot-example.jar should exist + And container log should contain main] .c.l.ClasspathLoggingApplicationListener + And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true + + Scenario: Perform a incremental s2i build using springboot runtime type + Given s2i build https://github.com/kiegroup/kogito-examples.git from process-springboot-example with env and incremental using master + # Leave those here as placeholder for scripts adding variable to the test. No impact on tests if empty. + | variable | value | + | RUNTIME_TYPE | springboot | + Then check that page is served + | property | value | + | port | 8080 | + | path | /orders | + | wait | 80 | + | request_method | POST | + | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | + | content_type | application/json | + | expected_status_code | 201 | + And file /home/kogito/bin/process-springboot-example.jar should exist + + # Since the same image is used we can do a subsequent incremental build and verify if it is working as expected. + Scenario: Perform a second incremental s2i build using springboot runtime type + Given s2i build https://github.com/kiegroup/kogito-examples.git from process-springboot-example with env and incremental using master + # Leave those here as placeholder for scripts adding variable to the test. No impact on tests if empty. + | variable | value | + | RUNTIME_TYPE | springboot | + Then s2i build log should contain Expanding artifacts from incremental build... + And s2i build log should not contain WARNING: Clean build will be performed because of error saving previous build artifacts + + Scenario: Verify that the Kogito Maven archetype is generating the project and compiling it correctly when runtime is springboot + Given s2i build /tmp/kogito-examples from dmn-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest + | variable | value | + | KOGITO_VERSION | 2.0.0-SNAPSHOT | + | RUNTIME_TYPE | springboot | + Then file /home/kogito/bin/project-1.0-SNAPSHOT.jar should exist + + + Scenario: Verify if the s2i build is finished as expected with uber-jar package type built + Given s2i build https://github.com/kiegroup/kogito-examples.git from process-quarkus-example using master and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest + | variable | value | + | MAVEN_ARGS_APPEND | -Dquarkus.package.type=uber-jar | + | RUNTIME_TYPE | quarkus | + Then file /home/kogito/bin/process-quarkus-example-runner.jar should exist diff --git a/tests/features/kogito-common-runtime-jvm.feature b/tests/features/kogito-common-runtime-jvm.feature new file mode 100644 index 000000000..c9569b3c2 --- /dev/null +++ b/tests/features/kogito-common-runtime-jvm.feature @@ -0,0 +1,81 @@ +@quay.io/kiegroup/kogito-runtime-jvm @rhpam-7/rhpam-kogito-runtime-jvm-rhel8 +Feature: kogito-runtime-jvm feature. + + Scenario: verify if the java installation is correct + When container is started with command bash + Then run sh -c 'echo $JAVA_HOME' in container and immediately check its output for /usr/lib/jvm/java-11 + And run sh -c 'echo $JAVA_VENDOR' in container and immediately check its output for openjdk + And run sh -c 'echo $JAVA_VERSION' in container and immediately check its output for 11 + + Scenario: Verify if the binary build is finished as expected and if it is listening on the expected port with quarkus + Given s2i build /tmp/kogito-examples/rules-quarkus-helloworld from target + | variable | value | + | RUNTIME_TYPE | quarkus | + | NATIVE | false | + | JAVA_OPTIONS | -Dquarkus.log.level=DEBUG | + Then check that page is served + | property | value | + | port | 8080 | + | path | /hello | + | request_method | POST | + | content_type | application/json | + | request_body | {"strings":["hello"]} | + | wait | 80 | + | expected_phrase | ["hello","world"] | + And file /home/kogito/bin/quarkus-run.jar should exist + + Scenario: Verify if the binary build (forcing) is finished as expected and if it is listening on the expected port + Given s2i build /tmp/kogito-examples/rules-quarkus-helloworld from target + | variable | value | + | RUNTIME_TYPE | quarkus | + | NATIVE | false | + | JAVA_OPTIONS | -Dquarkus.log.level=DEBUG | + | BINARY_BUILD | true | + Then check that page is served + | property | value | + | port | 8080 | + | path | /hello | + | request_method | POST | + | content_type | application/json | + | request_body | {"strings":["hello"]} | + | wait | 80 | + | expected_phrase | ["hello","world"] | + And file /home/kogito/bin/quarkus-run.jar should exist + + Scenario: Verify if the binary build is finished as expected and if it is listening on the expected port with springboot + Given s2i build /tmp/kogito-examples/process-springboot-example from target + | variable | value | + | JAVA_OPTIONS | -Ddebug=true | + | RUNTIME_TYPE | springboot | + Then check that page is served + | property | value | + | port | 8080 | + | path | /orders | + | wait | 80 | + | request_method | POST | + | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | + | content_type | application/json | + | expected_status_code | 201 | + And file /home/kogito/bin/process-springboot-example.jar should exist + And container log should contain DEBUG 1 --- [ main] o.s.boot.SpringApplication + And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true + + Scenario: Verify if the (forcing) binary build is finished as expected and if it is listening on the expected port + Given s2i build /tmp/kogito-examples/process-springboot-example from target + | variable | value | + | JAVA_OPTIONS | -Ddebug=true | + | BINARY_BUILD | true | + | RUNTIME_TYPE | springboot | + Then check that page is served + | property | value | + | port | 8080 | + | path | /orders | + | wait | 80 | + | request_method | POST | + | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | + | content_type | application/json | + | expected_status_code | 201 | + And file /home/kogito/bin/process-springboot-example.jar should exist + And container log should contain DEBUG 1 --- [ main] o.s.boot.SpringApplication + And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true + diff --git a/tests/features/kogito-explainability.feature b/tests/features/kogito-explainability.feature index 0809b3a34..d78298db7 100644 --- a/tests/features/kogito-explainability.feature +++ b/tests/features/kogito-explainability.feature @@ -1,7 +1,7 @@ @quay.io/kiegroup/kogito-explainability Feature: Kogito-explainability feature. - Scenario: verify if all labels are correctly set. + Scenario: verify if all labels are correctly set on kogito-explainability image Given image is built Then the image should contain label maintainer with value kogito And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i diff --git a/tests/features/kogito-jit-runner.feature b/tests/features/kogito-jit-runner.feature index f40ddc032..3ac2f6561 100644 --- a/tests/features/kogito-jit-runner.feature +++ b/tests/features/kogito-jit-runner.feature @@ -1,7 +1,7 @@ @quay.io/kiegroup/kogito-jit-runner Feature: Kogito-jit-runner feature. - Scenario: verify if all labels are correctly set. + Scenario: verify if all labels are correctly set on kogito-jit-runner image Given image is built Then the image should contain label maintainer with value kogito And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i diff --git a/tests/features/kogito-jobs-service.feature b/tests/features/kogito-jobs-service.feature index 324568500..9d7b58637 100644 --- a/tests/features/kogito-jobs-service.feature +++ b/tests/features/kogito-jobs-service.feature @@ -1,7 +1,7 @@ @quay.io/kiegroup/kogito-jobs-service Feature: Kogito-jobs-service feature. - Scenario: verify if all labels are correctly set. + 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 kogito And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i diff --git a/tests/features/kogito-management-console.feature b/tests/features/kogito-management-console.feature index e197bef06..ba17a81e5 100644 --- a/tests/features/kogito-management-console.feature +++ b/tests/features/kogito-management-console.feature @@ -1,7 +1,7 @@ @quay.io/kiegroup/kogito-management-console Feature: kogito-management-console feature - Scenario: verify if all labels are correctly set. + Scenario: verify if all labels are correctly set kogito-management-console image Given image is built Then the image should contain label maintainer with value kogito And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i diff --git a/tests/features/kogito-runtime-jvm.feature b/tests/features/kogito-runtime-jvm.feature index 7f22bf84d..bfcd6a16a 100644 --- a/tests/features/kogito-runtime-jvm.feature +++ b/tests/features/kogito-runtime-jvm.feature @@ -1,7 +1,7 @@ @quay.io/kiegroup/kogito-runtime-jvm Feature: kogito-runtime-jvm feature. - Scenario: verify if all labels are correctly set. + Scenario: verify if all labels are correctly set on kogito-runtime-jvm image Given image is built Then the image should contain label maintainer with value kogito And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i @@ -9,84 +9,5 @@ Feature: kogito-runtime-jvm feature. 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 Runtime image for Kogito based on Quarkus or Spring Boot JVM image And the image should contain label io.k8s.display-name with value Kogito based on Quarkus or Spring Boot JVM image - And the image should contain label io.openshift.tags with value builder,runtime,kogito,quarkus,springboot,jvm + And the image should contain label io.openshift.tags with value runtime,kogito,quarkus,springboot,jvm And the image should contain label io.openshift.s2i.assemble-input-files with value /home/kogito/bin - - Scenario: verify if the java installation is correct - When container is started with command bash - Then run sh -c 'echo $JAVA_HOME' in container and immediately check its output for /usr/lib/jvm/java-11 - And run sh -c 'echo $JAVA_VENDOR' in container and immediately check its output for openjdk - And run sh -c 'echo $JAVA_VERSION' in container and immediately check its output for 11 - - Scenario: Verify if the binary build is finished as expected and if it is listening on the expected port - Given s2i build /tmp/kogito-examples/rules-quarkus-helloworld from target - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - | JAVA_OPTIONS | -Dquarkus.log.level=DEBUG | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/quarkus-run.jar should exist - - Scenario: Verify if the binary build (forcing) is finished as expected and if it is listening on the expected port - Given s2i build /tmp/kogito-examples/rules-quarkus-helloworld from target - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - | JAVA_OPTIONS | -Dquarkus.log.level=DEBUG | - | BINARY_BUILD | true | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/quarkus-run.jar should exist - - Scenario: Verify if the binary build is finished as expected and if it is listening on the expected port - Given s2i build /tmp/kogito-examples/process-springboot-example from target - | variable | value | - | JAVA_OPTIONS | -Ddebug=true | - | RUNTIME_TYPE | springboot | - Then check that page is served - | property | value | - | port | 8080 | - | path | /orders | - | wait | 80 | - | request_method | POST | - | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | - | content_type | application/json | - | expected_status_code | 201 | - And file /home/kogito/bin/process-springboot-example.jar should exist - And container log should contain DEBUG 1 --- [ main] o.s.boot.SpringApplication - And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true - - Scenario: Verify if the (forcing) binary build is finished as expected and if it is listening on the expected port - Given s2i build /tmp/kogito-examples/process-springboot-example from target - | variable | value | - | JAVA_OPTIONS | -Ddebug=true | - | BINARY_BUILD | true | - | RUNTIME_TYPE | springboot | - Then check that page is served - | property | value | - | port | 8080 | - | path | /orders | - | wait | 80 | - | request_method | POST | - | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | - | content_type | application/json | - | expected_status_code | 201 | - And file /home/kogito/bin/process-springboot-example.jar should exist - And container log should contain DEBUG 1 --- [ main] o.s.boot.SpringApplication - And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true - diff --git a/tests/features/kogito-runtime-native.feature b/tests/features/kogito-runtime-native.feature index fe7419f38..d7c18f863 100644 --- a/tests/features/kogito-runtime-native.feature +++ b/tests/features/kogito-runtime-native.feature @@ -1,7 +1,7 @@ @quay.io/kiegroup/kogito-runtime-native Feature: Kogito-runtime-native feature. - Scenario: verify if all labels are correctly set. + Scenario: verify if all labels are correctly set on kogito-runtime-native image Given image is built Then the image should contain label maintainer with value kogito And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i @@ -12,12 +12,12 @@ Feature: Kogito-runtime-native feature. And the image should contain label io.openshift.tags with value builder,runtime,kogito,quarkus,native And the image should contain label io.openshift.s2i.assemble-input-files with value /home/kogito/bin - Scenario: verify java cacerts and libsunec are available in the given container. + Scenario: verify java cacerts and libsunec are available in the given kogito runtime container. When container is started with command bash Then file /home/kogito/ssl-libs/libsunec.so should exist And file /home/kogito/cacerts should exist - Scenario: Verify if the binary build is finished as expected and if it is listening on the expected port + Scenario: Verify if the binary build is finished as expected and if it is listening on the expected port with quarkus native Given s2i build /tmp/kogito-examples/rules-quarkus-helloworld-native/ from target | variable | value | | NATIVE | false | diff --git a/tests/features/kogito-task-console.feature b/tests/features/kogito-task-console.feature index 5e4948c2f..c0eafb476 100644 --- a/tests/features/kogito-task-console.feature +++ b/tests/features/kogito-task-console.feature @@ -1,7 +1,7 @@ @quay.io/kiegroup/kogito-task-console Feature: kogito-task-console feature - Scenario: verify if all labels are correctly set. + Scenario: verify if all labels are correctly set on kogito-task-console image Given image is built Then the image should contain label maintainer with value kogito And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i diff --git a/tests/features/kogito-trusty-ui.feature b/tests/features/kogito-trusty-ui.feature index c4024da0e..dd437a4c1 100644 --- a/tests/features/kogito-trusty-ui.feature +++ b/tests/features/kogito-trusty-ui.feature @@ -1,7 +1,7 @@ @quay.io/kiegroup/kogito-trusty-ui Feature: kogito-trusty-ui feature - Scenario: verify if all labels are correctly set. + Scenario: verify if all labels are correctly set on kogito-trusty-ui image Given image is built Then the image should contain label maintainer with value kogito And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i diff --git a/tests/features/rhpam-kogito-builder-jvm.feature b/tests/features/rhpam-kogito-builder-jvm.feature new file mode 100644 index 000000000..28c453b77 --- /dev/null +++ b/tests/features/rhpam-kogito-builder-jvm.feature @@ -0,0 +1,13 @@ +@rhpam-7/rhpam-kogito-builder-rhel8 +Feature: rhpam-kogito-runtime-jvm feature. + + Scenario: verify if all labels are correctly set on rhpam-kogito-builder-rhel8 image + Given image is built + Then the image should contain label maintainer with value kogito + And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i + And the image should contain label io.openshift.s2i.destination with value /tmp + 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 Platform for building Kogito based on Quarkus or Spring Boot + And the image should contain label io.k8s.display-name with value Red Hat build of Kogito based on Quarkus or Spring Boot + And the image should contain label io.openshift.tags with value rhpam-kogito,builder,kogito,quarkus,springboot + And the image should contain label com.redhat.component with value rhpam-7-kogito-runtime-jvm-rhel8-container diff --git a/tests/features/rhpam-kogito-runtime-jvm.feature b/tests/features/rhpam-kogito-runtime-jvm.feature new file mode 100644 index 000000000..165b5494c --- /dev/null +++ b/tests/features/rhpam-kogito-runtime-jvm.feature @@ -0,0 +1,16 @@ +@rhpam-7/rhpam-kogito-runtime-jvm-rhel8 +Feature: rhpam-kogito-runtime-jvm feature. + + Scenario: verify if all labels are correctly set onrhpam-kogito-runtime-jvm-rhel8 image + Given image is built + Then the image should contain label maintainer with value kogito + And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i + And the image should contain label io.openshift.s2i.destination with value /tmp + 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 Runtime image for Kogito based on Quarkus or Spring Boot JVM image + And the image should contain label io.k8s.display-name with value Red Hat build of Kogito based on Quarkus or Spring Boot JVM image + And the image should contain label io.openshift.tags with value rhpam-kogito,runtime,kogito,quarkus,springboot,jvm + And the image should contain label io.openshift.s2i.assemble-input-files with value /home/kogito/bin + And the image should contain label com.redhat.component with value rhpam-7-kogito-runtime-jvm-rhel8-container + + diff --git a/tests/features/trusty/kogito-trusty-infinispan.feature b/tests/features/trusty/kogito-trusty-infinispan.feature index 3e507b07b..75e845988 100644 --- a/tests/features/trusty/kogito-trusty-infinispan.feature +++ b/tests/features/trusty/kogito-trusty-infinispan.feature @@ -1,7 +1,7 @@ @quay.io/kiegroup/kogito-trusty-infinispan Feature: Kogito-trusty infinispan feature. - Scenario: verify if all labels are correctly set. + Scenario: verify if all labels are correctly set on kogito-trusty-infinispan image Given image is built Then the image should contain label maintainer with value kogito And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i diff --git a/tests/features/trusty/kogito-trusty-redis.feature b/tests/features/trusty/kogito-trusty-redis.feature index 6bcca7c10..76d379919 100644 --- a/tests/features/trusty/kogito-trusty-redis.feature +++ b/tests/features/trusty/kogito-trusty-redis.feature @@ -1,7 +1,7 @@ @quay.io/kiegroup/kogito-trusty-redis Feature: Kogito-trusty redis feature. - Scenario: verify if all labels are correctly set. + Scenario: verify if all labels are correctly set on kogito-trusty-redis image Given image is built Then the image should contain label maintainer with value kogito And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i