Skip to content

Bump dependencies versions in examples and testsuite, and some cleanup #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ if [ "$arch" == 's390x' ]; then
mvn test-compile spotbugs:check -e -V -B -f testsuite
set +e
clearDockerEnv
mvn -e -V -B clean install -f testsuite -Pkafka-3_6_1
mvn -e -V -B clean install -f testsuite -Pkafka-3_9_0
EXIT=$?
exitIfError
set -e
Expand All @@ -77,47 +77,49 @@ elif [[ "$arch" != 'ppc64le' ]]; then
set +e

clearDockerEnv
mvn -e -V -B clean install -f testsuite -Pkafka-3_6_1 $MAVEN_EXTRA_ARGS
mvn -e -V -B clean install -f testsuite -Pkafka-3_9_0 $MAVEN_EXTRA_ARGS
EXIT=$?
exitIfError

# Excluded by default to not exceed Travis job timeout
if [ "$SKIP_DISABLED" == "false" ]; then

clearDockerEnv
mvn -e -V -B clean install -f testsuite -Pkafka-3_5_2 $MAVEN_EXTRA_ARGS
mvn -e -V -B clean install -f testsuite -Pkafka-3_8_1 $MAVEN_EXTRA_ARGS
EXIT=$?
exitIfError

clearDockerEnv
mvn -e -V -B clean install -f testsuite -Pkafka-3_4_0 $MAVEN_EXTRA_ARGS
mvn -e -V -B clean install -f testsuite -Pkafka-3_7_1 $MAVEN_EXTRA_ARGS
EXIT=$?
exitIfError

clearDockerEnv
mvn -e -V -B clean install -f testsuite -Pkafka-3_3_2 $MAVEN_EXTRA_ARGS
mvn -e -V -B clean install -f testsuite -Pkafka-3_6_2 $MAVEN_EXTRA_ARGS
EXIT=$?
exitIfError

clearDockerEnv
mvn -e -V -B clean install -f testsuite -Pkafka-3_2_3 $MAVEN_EXTRA_ARGS -DfailIfNoTests=false -Dtest=\!KeycloakKRaftAuthorizationTests
mvn -e -V -B clean install -f testsuite -Pkafka-3_5_2 $MAVEN_EXTRA_ARGS
EXIT=$?
exitIfError

clearDockerEnv
mvn -e -V -B clean install -f testsuite -Pkafka-3_1_2 $MAVEN_EXTRA_ARGS -DfailIfNoTests=false -Dtest=\!KeycloakKRaftAuthorizationTests,\!KeycloakZKAuthorizationTests
mvn -e -V -B clean install -f testsuite -Pkafka-3_4_0 $MAVEN_EXTRA_ARGS
EXIT=$?
exitIfError

clearDockerEnv
mvn -e -V -B clean install -f testsuite -Pkafka-3_0_0 $MAVEN_EXTRA_ARGS -DfailIfNoTests=false -Dtest=\!KeycloakKRaftAuthorizationTests,\!KeycloakZKAuthorizationTests
mvn -e -V -B clean install -f testsuite -Pkafka-3_3_2 $MAVEN_EXTRA_ARGS
EXIT=$?
exitIfError

clearDockerEnv
mvn -e -V -B clean install -f testsuite -Pkafka-2_8_1 $MAVEN_EXTRA_ARGS -DfailIfNoTests=false -Dtest=\!KeycloakKRaftAuthorizationTests,\!KeycloakZKAuthorizationTests
mvn -e -V -B clean install -f testsuite -Pkafka-3_2_3 $MAVEN_EXTRA_ARGS -DfailIfNoTests=false -Dtest=\!KeycloakKRaftAuthorizationTests
EXIT=$?
exitIfError

# Kafka 3.1.x and older versions are no longer supported
fi

set -e
Expand Down
8 changes: 4 additions & 4 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ We have to update the oauth library dependency version:

sed -Ei 's#<strimzi-oauth.version>[0-9a-zA-Z.-]+</strimzi-oauth.version>#<strimzi-oauth.version>1.0.0-SNAPSHOT</strimzi-oauth.version>#g' \
pom.xml \
docker-images/kafka/kafka-thirdparty-libs/2.6.x/pom.xml \
docker-images/kafka/kafka-thirdparty-libs/2.7.x/pom.xml
docker-images/artifacts/kafka-thirdparty-libs/3.8.x/pom.xml \
docker-images/artifacts/kafka-thirdparty-libs/3.9.x/pom.xml

This makes sure the latest strimzi-kafka-oauth library that we built previously is included into Kafka images that we'll build next.
We can check the change:
Expand Down Expand Up @@ -371,7 +371,7 @@ instead of doing the whole `docker_build` again:

Let's make sure the SNAPSHOT Strimzi OAuth libraries are included.

docker run --rm -ti $DOCKER_REG/strimzi/kafka:0.31.1-kafka-3.2.3 /bin/sh -c 'ls -la /opt/kafka/libs/kafka-oauth*'
docker run --rm -ti $DOCKER_REG/strimzi/kafka:0.35.0-kafka-3.9.0 /bin/sh -c 'ls -la /opt/kafka/libs/kafka-oauth*'

This executes a `ls` command inside a new Kafka container, which it removes afterwards.
The deployed version should be 1.0.0-SNAPSHOT.
Expand Down Expand Up @@ -461,7 +461,7 @@ For examples of deploying such a cluster see [/examples/kubernetes/README.md](ex

You can explore the Kafka container more by starting it in interactive mode:

docker run --rm -ti $DOCKER_REG/strimzi/kafka:0.31.1-kafka-3.2.3 /bin/sh
docker run --rm -ti $DOCKER_REG/strimzi/kafka:0.35.0-kafka-3.9.0 /bin/sh

Here you've just started another interactive container from within the existing interactive container session.
Pretty neat!
Expand Down
2 changes: 0 additions & 2 deletions examples/docker/hydra/compose-db-migrate.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.5'

services:

hydra-db-migrate:
Expand Down
2 changes: 0 additions & 2 deletions examples/docker/hydra/compose-db.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.5'

services:

hydra-db:
Expand Down
2 changes: 1 addition & 1 deletion examples/docker/spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.3</version>
<version>3.3.7</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

Expand Down
2 changes: 1 addition & 1 deletion examples/docker/spring/test-spring.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -x

docker rm -f spring
docker run -d --name spring strimzi/example-spring
for i in {1..10}
for i in {1..60}
do
sleep 1
RESULT=$(docker logs spring | grep "Started SpringAuthorizationServerApplication")
Expand Down
29 changes: 11 additions & 18 deletions testsuite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ phase which is otherwise used when integration tests are intermingled in the sam
Preparing
=========

Make sure that the following ports on your host machine are free: 9092, 2181 (Kafka), 8080, 8443 (Keycloak), 4444, 4445 (Hydra), 8091, 8090 (Mock OAuth Server).
Make sure that the following ports on your host machine are free: 9092, 2181 (Kafka), 8080, 8443 (Keycloak), 4444, 4445 (Hydra), 8091, 8090 (Mock OAuth Server), 1088, 1750 (Kerberos).

Then, you have to add some entries to your `/etc/hosts` file:

Expand All @@ -32,7 +32,7 @@ Running

You may first need to perform the following cleanup of pre-existing containers / network definitions:

docker rm -f keycloak kafka zookeeper hydra hydra-jwt hydra-import hydra-jwt-import
docker rm -f keycloak kafka zookeeper hydra hydra-jwt mockoauth kerberos
docker network rm $(docker network ls | grep test | awk '{print $1}')

To build and run the testsuite you need a running 'docker' daemon, then simply run:
Expand All @@ -47,29 +47,21 @@ By using `clean` you make sure that the latest project jars are included into th

There are several profiles available to test with a specific version of Kafka images:

- kafka-2_3_1
- kafka-2_4_0
- kafka-2_4_1
- kafka-2_5_0
- kafka-2_5_1
- kafka-2_6_0
- kafka-2_6_2
- kafka-2_7_0
- kafka-2_7_1
- kafka-2_8_0
- kafka-2_8_1
- kafka-3_0_0
- kafka-3_1_0
- kafka-3_1_2
- kafka-3_2_3
- kafka-3_3_1
- kafka-3_3_2
- kafka-3_4_0
- kafka-3_5_0
- kafka-3_5_2
- kafka-3_6_1
- kafka-3_6_2
- kafka-3_7_1
- kafka-3_8_1
- kafka-3_9_0

Only one at a time can be applied. For example:

mvn clean install -f testsuite -Pkafka-2_4_1
mvn clean install -f testsuite -Pkafka-3_7_1

If you only want to run a single test, you first have to build the testsuite 'parent':

Expand Down Expand Up @@ -159,6 +151,7 @@ Make sure that you added 'kafka', 'keycloak', and 'hydra' to your `/etc/hosts` a
127.0.0.1 hydra
127.0.0.1 hydra-jwt
127.0.0.1 mockoauth
127.0.0.1 kerberos


### How to set a custom Kafka image
Expand All @@ -171,6 +164,6 @@ Thus, you don't need to use the latest local build of strimzi/kafka libraries to

But if you want you can specify the kafka image to use for the test as follows:

mvn clean test -Dkafka.docker.image=quay.io/strimzi/kafka:0.39.0-kafka-3.5.2 -f testsuite/keycloak-auth-tests
mvn clean test -Dkafka.docker.image=quay.io/strimzi/kafka:0.44.0-kafka-3.7.1 -f testsuite/keycloak-auth-tests

This will use the latest locally built kafka image of strimzi-kafka-operator project.
2 changes: 1 addition & 1 deletion testsuite/docker/kerberos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM ubuntu:22.04

RUN DEBIAN_FRONTEND=noninteractive apt-get update -y && apt-get install -y krb5-kdc krb5-admin-server

EXPOSE 1088 1749
EXPOSE 1088 1750

ADD ./config.sh /config.sh

Expand Down
2 changes: 0 additions & 2 deletions testsuite/keycloak-errors-tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
keycloak:
image: quay.io/keycloak/keycloak:23.0.5
Expand Down
2 changes: 1 addition & 1 deletion testsuite/mock-oauth-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<properties>
<checkstyle.dir>../..</checkstyle.dir>
<vertx.version>4.5.11</vertx.version>
<vertx.version>4.5.13</vertx.version>
<logback.version>1.3.15</logback.version>

<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
Expand Down
91 changes: 0 additions & 91 deletions testsuite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -322,97 +322,6 @@
</build>

<profiles>
<profile>
<id>kafka-2_3_1</id>
<properties>
<!-- Uses JDK 1.8.0 -->
<kafka.docker.image>quay.io/strimzi/kafka:0.17.0-kafka-2.3.1</kafka.docker.image>
</properties>
</profile>
<profile>
<id>kafka-2_4_0</id>
<properties>
<!-- Uses JDK 11.0.x -->
<kafka.docker.image>quay.io/strimzi/kafka:0.19.0-kafka-2.4.0</kafka.docker.image>
</properties>
</profile>
<profile>
<id>kafka-2_4_1</id>
<properties>
<!-- Uses JDK 11.0.x -->
<kafka.docker.image>quay.io/strimzi/kafka:0.19.0-kafka-2.4.1</kafka.docker.image>
</properties>
</profile>
<profile>
<id>kafka-2_5_0</id>
<properties>
<!-- Uses JDK 11.0.x -->
<kafka.docker.image>quay.io/strimzi/kafka:0.22.1-kafka-2.5.0</kafka.docker.image>
</properties>
</profile>
<profile>
<id>kafka-2_5_1</id>
<properties>
<!-- Uses JDK 11.0.x -->
<kafka.docker.image>quay.io/strimzi/kafka:0.22.1-kafka-2.5.1</kafka.docker.image>
</properties>
</profile>
<profile>
<id>kafka-2_6_0</id>
<properties>
<!-- Uses JDK 11.0.x -->
<kafka.docker.image>quay.io/strimzi/kafka:0.23.0-kafka-2.6.0</kafka.docker.image>
</properties>
</profile>
<profile>
<id>kafka-2_6_2</id>
<properties>
<!-- Uses JDK 11.0.x -->
<kafka.docker.image>quay.io/strimzi/kafka:0.23.0-kafka-2.6.2</kafka.docker.image>
</properties>
</profile>
<profile>
<id>kafka-2_7_0</id>
<properties>
<!-- Uses JDK 11.0.x -->
<kafka.docker.image>quay.io/strimzi/kafka:0.25.0-kafka-2.7.0</kafka.docker.image>
</properties>
</profile>
<profile>
<id>kafka-2_7_1</id>
<properties>
<!-- Uses JDK 11.0.x -->
<kafka.docker.image>quay.io/strimzi/kafka:0.25.0-kafka-2.7.1</kafka.docker.image>
</properties>
</profile>
<profile>
<id>kafka-2_8_0</id>
<properties>
<!-- Uses JDK 11.0.x -->
<kafka.docker.image>quay.io/strimzi/kafka:0.27.1-kafka-2.8.0</kafka.docker.image>
</properties>
</profile>
<profile>
<id>kafka-2_8_1</id>
<properties>
<!-- Uses JDK 11.0.x -->
<kafka.docker.image>quay.io/strimzi/kafka:0.27.1-kafka-2.8.1</kafka.docker.image>
</properties>
</profile>
<profile>
<id>kafka-3_0_0</id>
<properties>
<!-- Uses JDK 11.0.x -->
<kafka.docker.image>quay.io/strimzi/kafka:0.28.0-kafka-3.0.0</kafka.docker.image>
</properties>
</profile>
<profile>
<id>kafka-3_1_2</id>
<properties>
<!-- Uses JDK 11.0.x -->
<kafka.docker.image>quay.io/strimzi/kafka:0.31.1-kafka-3.1.2</kafka.docker.image>
</properties>
</profile>
<profile>
<id>kafka-3_2_3</id>
<properties>
Expand Down
Loading