fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!… #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run System Tests | ||
on: | ||
workflow_call: | ||
inputs: | ||
profileList: | ||
description: "Comma-separated or single profile name(s)" | ||
required: false | ||
default: "" | ||
type: string | ||
pipelineList: | ||
description: "Comma-separated or single pipeline name(s)" | ||
required: false | ||
default: "" | ||
type: string | ||
excludedGroups: | ||
description: "Excluded groups" | ||
required: false | ||
default: "" | ||
type: string | ||
cluster_operator_install_type: | ||
description: "Install type method used for Strimzi operator" | ||
required: false | ||
default: "bundle" | ||
type: string | ||
strimzi_rbac_scope: | ||
description: "RBAC configuration for operator access" | ||
required: false | ||
default: "CLUSTER" | ||
type: string | ||
parallel: | ||
description: "How many tests should be executed in parallel" | ||
required: false | ||
default: "2" | ||
type: string | ||
strimzi_feature_gates: | ||
description: "Which feature-gates will be used by operator" | ||
required: false | ||
default: "" | ||
type: string | ||
releaseVersion: | ||
description: "Release version to test (i.e. 'latest', '0.46.0')" | ||
required: false | ||
default: "latest" | ||
type: string | ||
kafkaVersion: | ||
description: "Kafka version. e.g. '4.0.0' or 'latest'" | ||
required: false | ||
default: "latest" | ||
type: string | ||
agent: | ||
description: "On which agent the jobs will be executed" | ||
required: true | ||
type: string | ||
architecture: | ||
description: "Which architecture is used for the job" | ||
required: true | ||
type: string | ||
jobs: | ||
generate-matrix: | ||
runs-on: oracle-2cpu-8gb-arm64 | ||
outputs: | ||
matrix: ${{ steps.gen.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Generate Matrix | ||
id: gen | ||
uses: ./.github/actions/generate-matrix | ||
with: | ||
pipelines: ${{ inputs.pipelineList }} | ||
profiles: ${{ inputs.profileList }} | ||
default_agent: ${{ inputs.agent }} | ||
default_arch: ${{ inputs.architecture }} | ||
default_strimzi_feature_gates: ${{ inputs.strimzi_feature_gates }} | ||
default_strimzi_rbac_scope: ${{ inputs.strimzi_rbac_scope }} | ||
default_cluster_operator_install_type: ${{ inputs.cluster_operator_install_type }} | ||
default_parallel: ${{ inputs.parallel }} | ||
run-tests: | ||
needs: generate-matrix | ||
strategy: | ||
matrix: | ||
: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} | ||
fail-fast: false | ||
name: ${{ matrix.config.pipeline }}-${{ matrix.config.profile }}-${{ matrix.config.arch }} | ||
runs-on: ${{ matrix.config.agent }} | ||
timeout-minutes: ${{ fromJson(matrix.config.timeout) }} | ||
# Environment variables | ||
env: | ||
KAFKA_VERSION: ${{ inputs.kafkaVersion }} | ||
DOCKER_TAG: ${{ inputs.releaseVersion }} | ||
PROFILE: ${{ matrix.config.profile }} | ||
ARCH: ${{ matrix.config.architecture }} | ||
STRIMZI_RBAC_SCOPE: ${{ matrix.config.strimzi_rbac_scope }} | ||
CLUSTER_OPERATOR_INSTALL_TYPE: ${{ matrix.config.cluster_operator_install_type }} | ||
STRIMZI_FEATURE_GATES: ${{ matrix.config.strimzi_feature_gates }} | ||
PARALLEL: ${{ matrix.config.parallel }} | ||
STRIMZI_DEFAULT_LOG_LEVEL: DEBUG | ||
OPERATOR_IMAGE_PULL_POLICY: IfNotPresent | ||
COMPONENTS_IMAGE_PULL_POLICY: IfNotPresent | ||
# Job steps | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set default environment variables | ||
uses: ./.github/actions/set-defaults | ||
- name: Set release version | ||
if: ${{ inputs.releaseVersion != 'latest' }} | ||
run: | | ||
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV | ||
env: | ||
RELEASE_VERSION: ${{ inputs.releaseVersion }} | ||
- name: Set DOCKER_TAG to releaseVersion | ||
if: ${{ inputs.releaseVersion != 'latest' }} | ||
run: | | ||
echo "DOCKER_REGISTRY=quay.io" >> $GITHUB_ENV | ||
- name: Set DOCKER_REGISTRY to quay.io if releaseVersion != latest | ||
if: ${{ inputs.releaseVersion != 'latest' }} | ||
run: | | ||
echo "DOCKER_REGISTRY=quay.io" >> $GITHUB_ENV | ||
- name: Set ST_KAFKA_VERSION if kafkaVersion != latest | ||
if: ${{ env.KAFKA_VERSION != 'latest' }} | ||
run: | | ||
echo "ST_KAFKA_VERSION=${KAFKA_VERSION}" >> $GITHUB_ENV | ||
- name: Print out environment info | ||
uses: ./.github/actions/log-variables | ||
- name: Set up Maven | ||
uses: stCarolas/setup-maven@v5 | ||
with: | ||
maven-version: 3.9.9 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: "temurin" | ||
# TODO - maybe change as a parameter? | ||
java-version: "17" | ||
cache: maven | ||
- name: Install Helm | ||
uses: ./.github/actions/install-helm | ||
- name: Install Shellcheck | ||
uses: ./.github/actions/install-shellcheck | ||
with: | ||
architecture: ${{ matrix.config.arch }} | ||
- name: Install yq | ||
uses: ./.github/actions/install-yq | ||
with: | ||
architecture: ${{ matrix.config.arch }} | ||
- name: Install Docker | ||
uses: ./.github/actions/install-docker | ||
- name: Install Minikube | ||
uses: ./.github/actions/setup-minikube | ||
with: | ||
architecture: ${{ matrix.config.arch }} | ||
- name: Print out environment info | ||
uses: ./.github/actions/log-variables | ||
- name: DEBUG - dns utils | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y dnsutils | ||
- name: DEBUG - redhat | ||
run: | | ||
curl cdn-ubi.redhat.com | ||
cat /etc/resolv.conf | ||
# Build Strimzi and its images => used when running STs against PR or main branch where container images should be built | ||
- name: Build Strimzi images | ||
# Build images in case that we are not running tests on the `main` branch and the docker_tag is `latest`, which means | ||
# that we are running tests on a PR | ||
# add back: eval $(minikube docker-env) | ||
if: ${{ env.DOCKER_TAG == 'latest' && github.ref_name != 'main' }} | ||
uses: ./.github/actions/load-strimzi-images | ||
with: | ||
architecture: ${{ matrix.config.arch }} | ||
# run: | | ||
# make java_install | ||
# make docker_build | ||
# make docker_tag | ||
# make docker_push | ||
# env: | ||
# MVN_ARGS: '-B -DskipTests -Dmaven.javadoc.skip=true' | ||
# Build Strimzi without images => used when running the STs against releases or release candidates where the images | ||
# are already built, and we need only the Java build | ||
- name: Build Strimzi Java code | ||
# Build Strimzi without images in case that we are on the `main` branch or in case that we are running tests against tags during release | ||
if: ${{ !(env.DOCKER_TAG == 'latest' && github.ref_name != 'main') }} | ||
run: make java_install | ||
env: | ||
MVN_ARGS: "-DskipTests -Dmaven.javadoc.skip=true -e -V -B" | ||
- name: Create dir for Kafka binaries cache | ||
if: ${{ env.DOCKER_TAG != 'latest' }} | ||
run: mkdir -p docker-images/artifacts/binaries/kafka/archives | ||
############################################################################ | ||
# Build KafkaConnect image with file-sink plugin, skipping if "upgrade" | ||
############################################################################ | ||
- name: Build KafkaConnect image | ||
# we want to let Connect image build for different versions of Kafka inside the upgrade/downgrade STs | ||
# TODO - set Kafka version globally? | ||
if: ${{ !contains(env.PROFILE, 'upgrade') }} | ||
run: | | ||
eval $(minikube docker-env) | ||
export KAFKA_VERSION=$([[ "${KAFKA_VERSION}" == *"latest"* ]] && yq eval '.[] | select(.default) | .version' kafka-versions.yaml || echo "${KAFKA_VERSION}") | ||
BASE_IMAGE="${DOCKER_REGISTRY}/${DOCKER_ORG}/kafka:${DOCKER_TAG}-kafka-${KAFKA_VERSION}" | ||
echo "Base image: $BASE_IMAGE" | ||
eval "$(./systemtest/src/test/resources/connect-build/build-connect-image.sh "$KAFKA_VERSION" "$BASE_IMAGE")" | ||
echo "connect build image: $CONNECT_IMAGE_WITH_FILE_SINK_PLUGIN" | ||
# Provide "connectImage" variable for tests: | ||
echo "CONNECT_IMAGE_WITH_FILE_SINK_PLUGIN=${CONNECT_IMAGE_WITH_FILE_SINK_PLUGIN}" >> $GITHUB_ENV | ||
############################################################################ | ||
# We need to set DOCKER_REGISTRY to IP and port of service, which is created by minikube registry addon, port is always 80 | ||
# Default value for PRs is localhost:5000 because we need to push built images into minikube registry and make them available for pods | ||
############################################################################ | ||
- name: "Set docker_registry to local registry in minikube" | ||
if: ${{ contains(env.DOCKER_REGISTRY, 'localhost:5000') }} | ||
run: | | ||
echo "DOCKER_REGISTRY=$(kubectl get service registry -n kube-system -o=jsonpath='{.spec.clusterIP}'):80" >> $GITHUB_ENV | ||
############################################################################ | ||
# Additional "setup_upgrade.sh" if profile includes "upgrade" | ||
############################################################################ | ||
- name: Setup environment for upgrade | ||
if: ${{ contains(env.PROFILE, 'upgrade') }} | ||
run: | | ||
.azure/scripts/setup_upgrade.sh | ||
############################################################################ | ||
# Set KAFKA_TIERED_STORAGE_BASE_IMAGE for Tiered Storage tests | ||
############################################################################ | ||
# TODO - check if the image is correct for releases | ||
- name: Set KAFKA_TIERED_STORAGE_BASE_IMAGE | ||
run: | | ||
export KAFKA_VERSION=$([[ "${KAFKA_VERSION}" == *"latest"* ]] && yq eval '.[] | select(.default) | .version' kafka-versions.yaml || echo "${KAFKA_VERSION}") | ||
echo "KAFKA_TIERED_STORAGE_BASE_IMAGE=${DOCKER_REGISTRY}/${DOCKER_ORG}/kafka:${DOCKER_TAG}-kafka-${KAFKA_VERSION}" >> $GITHUB_ENV | ||
- name: Print out environment info | ||
uses: ./.github/actions/log-variables | ||
############################################################################ | ||
# Run system tests | ||
############################################################################ | ||
- name: Run systemtests | ||
run: | | ||
mvn -f systemtest/pom.xml verify \ | ||
-P"${PROFILE}" \ | ||
-DexcludedGroups="flaky,loadbalancer,networkpolicies,${EXCLUDED_GROUPS}" \ | ||
-Dmaven.javadoc.skip=true \ | ||
-B -V \ | ||
-Dfailsafe.rerunFailingTestsCount=1 \ | ||
-Djunit.jupiter.execution.parallel.enabled="true" \ | ||
-Djunit.jupiter.execution.parallel.config.fixed.parallelism="${PARALLEL}" \ | ||
-Dskip.surefire.tests \ | ||
-s ./.azure/systemtests/systemtest-settings.xml | ||
env: | ||
DOCKER_TAG: ${{ env.DOCKER_TAG }} | ||
BRIDGE_IMAGE: "latest-released" | ||
DOCKER_REGISTRY: ${{ env.DOCKER_REGISTRY }} | ||
BUILD_ID: ${{ matrix.config.agent }}-${{ matrix.config.pipeline }}-${{ matrix.config.profile }}-systemtests | ||
RESOURCE_ALLOCATION_STRATEGY: "SHARE_MEMORY_FOR_ALL_COMPONENTS" | ||
TEST_LOG_DIR: "systemtest-logs" | ||
CONNECT_IMAGE_WITH_FILE_SINK_PLUGIN: ${{ env.CONNECT_IMAGE_WITH_FILE_SINK_PLUGIN }} | ||
- name: DEBUG - digging | ||
if: ${{ always() }} | ||
run: | | ||
dig cdn-ubi.redhat.com | ||
- name: Archive JUnit test results | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: junit-results-${{ matrix.config.pipeline }}-${{ matrix.config.profile }}-${{ matrix.config.agent }} | ||
path: systemtest/target/failsafe-reports/**/TEST-*.xml | ||
- name: Archive systemtest logs | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: systemtest-logs-${{ matrix.config.pipeline }}-${{ matrix.config.profile }}-${{ matrix.config.agent }} | ||
path: systemtest-logs |