Skip to content

Latest commit

 

History

History
76 lines (64 loc) · 3.69 KB

TESTING.md

File metadata and controls

76 lines (64 loc) · 3.69 KB

Testing kas-fleetshard

Running unit test

mvn test

Running systemtest

Requirements

  • kubectl/oc client installed
  • connected to a running kubernetes/openshift cluster
  • image of operator is built with quarkus.profile=test and stored in any container registry
  • image of sync is built with quarkus.profile=test and stored in any container registry

example how to build and generate deployment files for your minikube

mvn package -pl operator,sync -am -Pimage-test-push --no-transfer-progress

you can also override image registry etc by mvn in case you cant to push images somewhere else

mvn package -pl operator,sync -am -Pimage-test-push --no-transfer-progress \
  -Dquarkus.container-image.registry=some-registry.com \
  -Dquarkus.container-image.group=my-org \
  -Dquarkus.container-image.tag=latest

Information

  • suite installs latest released strimzi operator
  • suite installs CRD generated by kas-fleetshard-api
  • suite by default gets generated operator/sync deployments from target/kubernetes folders
  • if you want to use different deployment files run test suite with env var YAML_BUNDLE_PATH=/custom/path

System Tests with Image Pull Secrets

Testing with image pull secrets can done using the following steps. Note, only tests using both the operator and sync components support pull secrets. The optional properties for overriding the operand images are only necessary for those images for which you wish to tests image pull secrets.

  1. Build the operator image as you typically would for system tests, additionally setting the following system properties. These properties will be used to push the test images as well as configure the kubernetes.yml deployment files accordingly.
  • quarkus.container-image.registry: registry where the images will be pushed. This registry should support authentication
  • quarkus.container-image.username: username for the given registry (used to push the image only)
  • quarkus.container-image.password: password for the given registry (used to push the image only)
  • quarkus.container-image.group: the image group name
  • quarkus.kubernetes.image-pull-secrets: list of image pull secret names to be used. The secrets themselves are provided in step 2
  • (optional) quarkus.kubernetes.env.vars."IMAGE_ADMIN_API": reference string of the admin server image to deploy
  • (optional) quarkus.kubernetes.env.vars."IMAGE_CANARY": reference string of the canary image to deploy
  • (optional) quarkus.kubernetes.env.vars."IMAGE_KAFKA": reference string of the Kafka image to deploy (via Strimzi)
  • (optional) quarkus.kubernetes.env.vars."IMAGE_ZOOKEEPER": reference string of the ZooKeeper image to deploy (via Strimzi)
  1. Provide an image-pull-secrets.yaml (or any YAML) file at a location specified by environment variable FLEET_SHARD_PULL_SECRET_PATH containing the pull secrets you wish to use.

Running full suite

mvn verify -P systemtest -pl systemtest -am

Running smoke tests

mvn verify -P systemtest -pl systemtest -Dgroups=smoke -am

Running single test or subset of tests

mvn verify -P systemtest -pl systemtest -am -Dit.test=SmokeST#testCreateManagedKafka
mvn verify -P systemtest -pl systemtest -am -Dit.test=ManagedKafkaST,SmokeST

Running testsuite in parallel

mvn verify -P systemtest -pl systemtest -am -Djunit.jupiter.execution.parallel.enabled=true
mvn verify -P systemtest -pl systemtest -am \
            -Djunit.jupiter.execution.parallel.enabled=true \
            -Djunit.jupiter.execution.parallel.config.fixed.parallelism=2