Skip to content

Commit

Permalink
ci: Apache Kafka and JDK build matrix
Browse files Browse the repository at this point in the history
. AK 2.5, 2.6
. Will also shadow build the latest version of AK
. Includes shadow builds for 2.4
. Add JDK matrix (8 and 13)
. Test to show all system properties
  • Loading branch information
astubbs committed Mar 30, 2021
1 parent a4a1d6a commit 5c841c3
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 5 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

# Tests disabled due to flakiness with under resourced github test machines. Confluent Jira works fine. Will fix later.
name: CI compile only - Java 8 (IT disabled atm, unit tests only)
name: Unit tests only

on:
push:
Expand All @@ -12,7 +12,26 @@ on:

jobs:
build:

strategy:
fail-fast: false
matrix:
# Why not? because we can.
# 2.0.1, 2.1.1, 2.2.2, 2.3.1, 2.4.1 don't work - needs zstd and some kafka client libs.
# Doesn't mean it couldn't be modified slightly to work...
ak: [2.5.1, 2.6.1]
jdk: ['-P jvm8-release -Djvm8.location=/opt/hostedtoolcache/jdk/8.0.282/x64', '']
experimental: [false]
name: ["Stable AK version"]
include:
- ak: "'[2.4.1,2.5)'" # currently failing
experimental: true
name: "Oldest AK breaking version 2.4.1+ (below 2.5.0) expected to fail"
- ak: "'[2.7.0,4)'" # currently failing
experimental: true
name: "Newest AK version 2.7.0+ expected to fail"

continue-on-error: ${{ matrix.experimental }}
name: "${{ matrix.name }} (AK: ${{ matrix.ak }}) experimental? ${{ matrix.experimental }} JDK: ${{ matrix.jdk }}"
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -71,8 +90,9 @@ jobs:
key: ${{ runner.os }}-m2
restore-keys: ${{ runner.os }}-m2

- name: Test with Maven on Java 8
run: mvn -B package -P jvm8-release -Djvm8.location=/opt/hostedtoolcache/jdk/8.0.282/x64
- name: Test with Maven
#run: mvn -B package -P jvm8-release -Djvm8.location=/opt/hostedtoolcache/jdk/8.0.282/x64 -Dkafka.version=${{ matrix.ak }}
run: mvn -B package ${{ matrix.jdk }} -Dkafka.version=${{ matrix.ak }}
# - name: Test with Maven on Java 9
# run: mvn -B package -P jvm9-release -Djvm9.location=/opt/hostedtoolcache/jdk/9.0.7/x64
# - name: Test with Maven on Java
Expand Down
3 changes: 3 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,9 @@ See what profiles are active::
See what plugins or dependencies are available to be updated::
`mvn versions:display-plugin-updates versions:display-property-updates versions:display-dependency-updates`

Run a single unit test::
`mvn -Dtest=TestCircle test`

Run a specific integration test method in a submodule project, skipping unit tests::
`mvn -Dit.test=TransactionAndCommitModeTest#testLowMaxPoll -DskipUTs=true verify -DfailIfNoTests=false --projects parallel-consumer-core`

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.confluent.csid.utils;

import lombok.extern.slf4j.Slf4j;
import org.assertj.core.presentation.StandardRepresentation;
import org.junit.jupiter.api.Test;
import org.slf4j.helpers.MessageFormatter;

import java.util.Map;
import java.util.Properties;

import static io.confluent.csid.utils.StringTestUtils.pretty;

@Slf4j
class JavaEnvTest {

/**
* Used to check the java environment at runtime
*/
@Test
void checkJavaEnvironment() {
log.error("Java all env: {}", pretty(System.getProperties().entrySet()));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.confluent.csid.utils;

import lombok.experimental.UtilityClass;
import org.assertj.core.presentation.StandardRepresentation;

@UtilityClass
public class StringTestUtils {

public static final StandardRepresentation STANDARD_REPRESENTATION = new StandardRepresentation();

public static String pretty(Object properties) {
return STANDARD_REPRESENTATION.toStringOf(properties);
}
}
14 changes: 13 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

<!-- core -->
<slf4j.version>1.7.30</slf4j.version>
<kafka.version>2.5.0</kafka.version>
<kafka.version>2.5.1</kafka.version>
<version.unij>0.1.3</version.unij>

<!-- tests -->
Expand Down Expand Up @@ -645,6 +645,18 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>tree</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>

<!-- Management -->
Expand Down
3 changes: 3 additions & 0 deletions src/docs/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,9 @@ See what profiles are active::
See what plugins or dependencies are available to be updated::
`mvn versions:display-plugin-updates versions:display-property-updates versions:display-dependency-updates`

Run a single unit test::
`mvn -Dtest=TestCircle test`

Run a specific integration test method in a submodule project, skipping unit tests::
`mvn -Dit.test=TransactionAndCommitModeTest#testLowMaxPoll -DskipUTs=true verify -DfailIfNoTests=false --projects parallel-consumer-core`

Expand Down

0 comments on commit 5c841c3

Please sign in to comment.