Skip to content
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

Use Java 11 in build workflows #3

Merged
merged 1 commit into from
Nov 22, 2023
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '11'
distribution: 'adopt'
cache: maven

- name: Build for Flink ${{ matrix.flink }}
run: mvn $MAVEN_CLI_OPTS $JAVA_ADDITIONAL_OPTS -Dflink.version=${{ matrix.flink }} install -DskipTests

- name: Tests for Flink ${{ matrix.flink }}
run: mvn $MAVEN_CLI_OPTS $JAVA_ADDITIONAL_OPTS -Dflink.version=${{ matrix.flink }} test
run: mvn $MAVEN_CLI_OPTS $JAVA_ADDITIONAL_OPTS -Dflink.version=${{ matrix.flink }} verify
4 changes: 2 additions & 2 deletions .github/workflows/prepare-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '11'
distribution: 'adopt'
cache: maven

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
- name: Check release tag match # ... and fail fast if they do not
run: diff <(echo "${{ github.ref_name }}") <(echo "$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout)")

- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '11'
distribution: 'adopt'
cache: maven

Expand All @@ -40,7 +40,7 @@ jobs:
- name: Set up Apache Maven Central
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '11'
distribution: 'adopt'
server-id: ossrh
server-username: SONATYPE_USERNAME
Expand Down
26 changes: 24 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
</scm>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<scala.binary.version>2.12</scala.binary.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

Expand All @@ -58,7 +58,9 @@

<assertj.version>3.23.1</assertj.version>
<junit.version>5.9.1</junit.version>
<logback.version>1.3.5</logback.version>
<mockito.version>2.21.0</mockito.version>
<slf4j-api.version>2.0.4</slf4j-api.version>
<testcontainers.version>1.18.2</testcontainers.version>
</properties>

Expand Down Expand Up @@ -242,6 +244,26 @@
<scope>test</scope>
</dependency>

<!-- Logging dependencies for testcontainers -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j-api.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
<scope>test</scope>
</dependency>

<!-- Flink test dependencies -->
<dependency>
<groupId>org.apache.flink</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,26 @@
import org.apache.flink.connector.jdbc.testutils.DatabaseExtension;
import org.apache.flink.connector.jdbc.testutils.DatabaseMetadata;
import org.apache.flink.util.FlinkRuntimeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.elasticsearch.ElasticsearchContainer;

import java.time.Duration;

import static com.getindata.flink.connector.jdbc.testutils.databases.elasticsearch.ElasticsearchMetadata.PASSWORD;
import static com.getindata.flink.connector.jdbc.testutils.databases.elasticsearch.ElasticsearchMetadata.USERNAME;


/**
* Elasticsearch database for testing.
*/
public class ElasticsearchDatabase extends DatabaseExtension implements ElasticsearchImages {

private static final ElasticsearchContainer CONTAINER =
new ElasticsearchContainer(ELASTICSEARCH_8)
.waitingFor(
Wait.forHttp("/_license")
.withBasicCredentials(USERNAME, PASSWORD)
.withReadTimeout(Duration.ofSeconds(5))
.withStartupTimeout(Duration.ofMinutes(5)));
private static final Logger LOGGER = LoggerFactory.getLogger(ElasticsearchDatabase.class);
private static final ElasticsearchContainer CONTAINER = new ElasticsearchContainer(ELASTICSEARCH_8)
.waitingFor(Wait.forLogMessage(".*license mode is .*", 1))
.withLogConsumer(new Slf4jLogConsumer(LOGGER));

private static ElasticsearchMetadata metadata;
private static ElasticsearchRestClient client;
Expand Down
19 changes: 19 additions & 0 deletions src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
</encoder>
</appender>

<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>

<logger name="org.apache.flink" level="ERROR"/>
<logger name="org.testcontainers" level="DEBUG"/>
<logger name="org.testcontainers.containers.wait.strategy" level="TRACE"/>
<!-- The following logger can be used for containers logs since 1.18.0 -->
<logger name="tc" level="INFO"/>
<logger name="com.github.dockerjava" level="INFO"/>
<logger name="com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire" level="OFF"/>
</configuration>