Skip to content

Commit aa2d507

Browse files
authored
Use proper condition for skipping second operator build (#31)
* Use proper condition for skipping second operator build Signed-off-by: Jakub Stejskal <xstejs24@gmail.com> * Try to check that unit tests ran Signed-off-by: Jakub Stejskal <xstejs24@gmail.com> * Check tests results based on testing param Signed-off-by: Jakub Stejskal <xstejs24@gmail.com> * Add unit test rerun to avoid flakes Signed-off-by: Jakub Stejskal <xstejs24@gmail.com> * Use released version of Operators Signed-off-by: Jakub Stejskal <xstejs24@gmail.com> * Use released version of Bridge Signed-off-by: Jakub Stejskal <xstejs24@gmail.com> * Try to change versions to snapshot for released versions Signed-off-by: Jakub Stejskal <xstejs24@gmail.com> --------- Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
1 parent a9c09c2 commit aa2d507

3 files changed

Lines changed: 58 additions & 6 deletions

File tree

.github/actions/build/build-binaries/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ runs:
9999
#############################################################
100100
- name: Run tests and verification
101101
# Tests for operators repo are in separated workflow and this is just a redundant step
102-
if: ${{ inputs.clusterOperatorBuild == 'true' }}
102+
if: ${{ inputs.clusterOperatorBuild != 'true' }}
103103
shell: bash
104104
run: |
105105
make java_install

.github/workflows/reusable-test-integrations.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ on:
5151
description: "Flag whether it is Strimzi Operator build or not (should be set only in Strimzi Kafka Operator repo)"
5252
required: false
5353
type: boolean
54+
checkTests:
55+
description: "Flag whether unit tests should be run and verified during build (set to false for repos without tests)"
56+
required: false
57+
type: boolean
58+
default: true
5459
githubActionsRef:
5560
description: "Ref of strimzi/github-actions to use (tag, branch, or SHA). Leave empty for local calls within github-actions repo."
5661
required: false
@@ -107,8 +112,8 @@ jobs:
107112
artifactSuffix: ${{ inputs.artifactSuffix }}
108113
clusterOperatorBuild: ${{ inputs.clusterOperatorBuild }}
109114
env:
110-
# Always skipTests during testing of the actions to save time
111-
MVN_ARGS: "-B -DskipTests"
115+
# Skip just ITs and rerun unit tests in case of flakes
116+
MVN_ARGS: "-DskipITs -Dsurefire.rerunFailingTestsCount=5"
112117

113118
- name: Verify binaries artifact was created
114119
run: |
@@ -121,6 +126,17 @@ jobs:
121126
tar -tf binaries-${{ inputs.artifactSuffix }}.tar
122127
echo "✓ Binaries artifact created successfully"
123128
129+
- name: Verify test results exist
130+
if: ${{ inputs.checkTests == true }}
131+
shell: bash
132+
run: |
133+
REPORT_COUNT=$(find . -path "*/surefire-reports/TEST-*.xml" -type f | wc -l)
134+
if [ "$REPORT_COUNT" -eq 0 ]; then
135+
echo "No surefire test reports found - unit tests may not have run"
136+
exit 1
137+
fi
138+
echo "✓ Found $REPORT_COUNT surefire test report(s)"
139+
124140
test-deploy-java:
125141
name: Deploy to Maven
126142
if: ${{ inputs.modules != 'none' }}
@@ -184,6 +200,15 @@ jobs:
184200
- name: Install yq
185201
uses: ./.github/actions/dependencies/install-yq
186202

203+
# The central-publishing-maven-plugin creates a bundle zip for release versions
204+
# and uploads via the Central Portal API, which local Nexus doesn't support.
205+
# Setting a SNAPSHOT version forces direct artifact deployment instead.
206+
# This is required for projects where we use release branches, and it is used only for testing purposes.
207+
- name: Set SNAPSHOT version for testing
208+
shell: bash
209+
run: |
210+
mvn versions:set -DnewVersion=${{ inputs.releaseVersion }}-SNAPSHOT -DgenerateBackupPoms=false
211+
187212
- name: Deploy to local Maven repository using deploy-java action
188213
uses: ./.github/actions/build/deploy-java
189214
with:

.github/workflows/test-integrations.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
project:
2929
# Strimzi Operator - Full pipeline with containers and Helm
3030
- repo: "strimzi/strimzi-kafka-operator"
31-
ref: "main"
31+
ref: "release-0.51.x"
3232
artifactSuffix: "operators"
3333
architecture: "amd64"
3434
buildContainers: true
@@ -39,10 +39,11 @@ jobs:
3939
releaseVersion: "6.6.6"
4040
imagesDir: "./docker-images/container-archives"
4141
clusterOperatorBuild: true
42+
checkTests: false
4243

4344
# Kafka Bridge - Full pipeline with containers
4445
- repo: "strimzi/strimzi-kafka-bridge"
45-
ref: "main"
46+
ref: "release-1.0.x"
4647
artifactSuffix: "kafka-bridge"
4748
architecture: "amd64"
4849
buildContainers: true
@@ -53,6 +54,7 @@ jobs:
5354
releaseVersion: "6.6.6-rc1"
5455
imagesDir: "kafka-bridge-amd64.tar.gz"
5556
clusterOperatorBuild: false
57+
checkTests: true
5658

5759
# Access Operator - Full pipeline with containers
5860
- repo: "strimzi/kafka-access-operator"
@@ -67,6 +69,7 @@ jobs:
6769
releaseVersion: "6.6.6"
6870
imagesDir: "access-operator-container-amd64.tar.gz"
6971
clusterOperatorBuild: false
72+
checkTests: true
7073

7174
# MQTT Bridge - Full pipeline with containers
7275
- repo: "strimzi/strimzi-mqtt-bridge"
@@ -81,6 +84,7 @@ jobs:
8184
releaseVersion: "6.6.6"
8285
imagesDir: "mqtt-bridge-amd64.tar.gz"
8386
clusterOperatorBuild: false
87+
checkTests: true
8488

8589
# Drain Cleaner - Full pipeline with containers and Helm
8690
- repo: "strimzi/drain-cleaner"
@@ -95,8 +99,9 @@ jobs:
9599
releaseVersion: "6.6.6"
96100
imagesDir: "drain-cleaner-container-amd64.tar.gz"
97101
clusterOperatorBuild: false
102+
checkTests: true
98103

99-
# Client Examples - Containers only (no Maven deploy)
104+
# Client Examples - Containers only (no Maven deploy, no tests)
100105
- repo: "strimzi/client-examples"
101106
ref: "main"
102107
artifactSuffix: "client-examples"
@@ -109,6 +114,7 @@ jobs:
109114
releaseVersion: "none"
110115
imagesDir: "*-amd64.tar.gz"
111116
clusterOperatorBuild: false
117+
checkTests: false
112118

113119
# Test Clients - Containers only (no Maven deploy)
114120
- repo: "strimzi/test-clients"
@@ -123,6 +129,7 @@ jobs:
123129
releaseVersion: "6.6.6"
124130
imagesDir: "./docker-images/container-archives"
125131
clusterOperatorBuild: false
132+
checkTests: true
126133

127134
# Metrics Reporter - Java only (no containers)
128135
- repo: "strimzi/metrics-reporter"
@@ -137,6 +144,7 @@ jobs:
137144
releaseVersion: "6.6.6"
138145
imagesDir: "none"
139146
clusterOperatorBuild: false
147+
checkTests: true
140148

141149
# Kafka Quotas Plugin - Java only (no containers)
142150
- repo: "strimzi/kafka-quotas-plugin"
@@ -151,6 +159,7 @@ jobs:
151159
releaseVersion: "6.6.6"
152160
imagesDir: "none"
153161
clusterOperatorBuild: false
162+
checkTests: true
154163

155164
# Kafka Kubernetes Config Provider - Java only (no containers)
156165
- repo: "strimzi/kafka-kubernetes-config-provider"
@@ -165,6 +174,7 @@ jobs:
165174
releaseVersion: "6.6.6"
166175
imagesDir: "none"
167176
clusterOperatorBuild: false
177+
checkTests: true
168178

169179
# Kafka OAuth - Java only (no containers)
170180
- repo: "strimzi/strimzi-kafka-oauth"
@@ -179,6 +189,22 @@ jobs:
179189
releaseVersion: "6.6.6"
180190
imagesDir: "none"
181191
clusterOperatorBuild: false
192+
checkTests: true
193+
194+
# Test Container - Java only (no containers)
195+
- repo: "strimzi/test-container"
196+
ref: "main"
197+
artifactSuffix: "strimzi-test-container"
198+
architecture: "amd64"
199+
buildContainers: false
200+
modules: "./"
201+
nexusCheck: "strimzi-test-container"
202+
javaVersion: "17"
203+
helmChartName: "none"
204+
releaseVersion: "6.6.6"
205+
imagesDir: "none"
206+
clusterOperatorBuild: false
207+
checkTests: true
182208

183209
uses: ./.github/workflows/reusable-test-integrations.yml
184210
with:
@@ -194,4 +220,5 @@ jobs:
194220
releaseVersion: ${{ matrix.project.releaseVersion }}
195221
imagesDir: ${{ matrix.project.imagesDir }}
196222
clusterOperatorBuild: ${{ matrix.project.clusterOperatorBuild }}
223+
checkTests: ${{ matrix.project.checkTests }}
197224
secrets: inherit

0 commit comments

Comments
 (0)