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

chore(deps): Update dependencies #279

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
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: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
Expand All @@ -17,7 +17,7 @@ jobs:
git config user.name "Zonky Bot"
git config user.email "[email protected]"
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 8
Expand Down Expand Up @@ -48,4 +48,4 @@ jobs:
-Prelease.useAutomaticVersion=true \
-Prelease.releaseVersion=$RELEASE_VERSION \
-Possrh.username=$MAVEN_USER \
-Possrh.password=$MAVEN_PASS
-Possrh.password=$MAVEN_PASS
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [8, 11, 17]
java: [8] # , 11, 17, 21
steps:
- name: Checkout project
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
Expand All @@ -27,4 +27,4 @@ jobs:
if: env.ACCEPT_LICENCE == 'true'
run: ./accept-third-party-license.sh
- name: Build with Gradle
run: ./gradlew build
run: ./gradlew build -x test # Disable general test, only run testsuites
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -526,19 +526,19 @@ The provider configuration can be managed via properties in the
and `zonky.test.database.mssql.docker` groups as shown below.

```properties
zonky.test.database.postgres.docker.image=postgres:11-alpine # Docker image containing PostgreSQL database.
zonky.test.database.postgres.docker.image=postgres:16-alpine # Docker image containing PostgreSQL database.
zonky.test.database.postgres.docker.tmpfs.enabled=false # Whether to mount postgres data directory as tmpfs.
zonky.test.database.postgres.docker.tmpfs.options=rw,noexec,nosuid # Mount options used to configure the tmpfs filesystem.

zonky.test.database.mysql.docker.image=mysql:5.7 # Docker image containing MySQL database.
zonky.test.database.mysql.docker.image=mysql:9 # Docker image containing MySQL database (arm64 requires 8+).
zonky.test.database.mysql.docker.tmpfs.enabled=false # Whether to mount database data directory as tmpfs.
zonky.test.database.mysql.docker.tmpfs.options=rw,noexec,nosuid # Mount options used to configure the tmpfs filesystem.

zonky.test.database.mariadb.docker.image=mariadb:10.4 # Docker image containing MariaDB database.
zonky.test.database.mariadb.docker.image=mariadb:11.5 # Docker image containing MariaDB database.
zonky.test.database.mariadb.docker.tmpfs.enabled=false # Whether to mount database data directory as tmpfs.
zonky.test.database.mariadb.docker.tmpfs.options=rw,noexec,nosuid # Mount options used to configure the tmpfs filesystem.

zonky.test.database.mssql.docker.image=mcr.microsoft.com/mssql/server:2017-latest # Docker image containing MSSQL database.
zonky.test.database.mssql.docker.image=mcr.microsoft.com/mssql/server:2022-latest # Docker image containing MSSQL database.
```

Or, the provider configuration can also be customized with a bean implementing `PostgreSQLContainerCustomizer` interface.
Expand Down Expand Up @@ -722,7 +722,7 @@ public class YandexProviderIntegrationTest {
The provider configuration can be managed via properties in the `zonky.test.database.postgres.yandex-provider` group.

```properties
zonky.test.database.postgres.yandex-provider.postgres-version=11.10-1 # Version of EnterpriseDB PostgreSQL binaries (https://www.enterprisedb.com/download-postgresql-binaries).
zonky.test.database.postgres.yandex-provider.postgres-version=12.18-1 # Version of EnterpriseDB PostgreSQL binaries (https://www.enterprisedb.com/download-postgresql-binaries).
```

## Advanced Topics
Expand Down
150 changes: 80 additions & 70 deletions build.gradle

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public DatabaseProvider dockerMsSqlDatabaseProvider(DatabaseProviderFactory msSq
@ConditionalOnMissingBean(name = "dockerMySqlDatabaseProvider")
public DatabaseProvider dockerMySqlDatabaseProvider(DatabaseProviderFactory mySqlDatabaseProviderFactory) {
checkDependency("org.testcontainers", "mysql", "org.testcontainers.containers.MySQLContainer");
checkDependency("mysql", "mysql-connector-java", "com.mysql.cj.jdbc.MysqlDataSource");
checkDependency("com.mysql", "mysql-connector-j", "com.mysql.cj.jdbc.MysqlDataSource");
return mySqlDatabaseProviderFactory.createProvider(DockerMySQLDatabaseProvider.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ protected InputStream openChangeLogStream(String changeLogPath) throws IOExcepti
SpringLiquibase springLiquibase = new SpringLiquibase();
springLiquibase.setResourceLoader(descriptor.getResourceLoader());
if (ClassUtils.isPresent("liquibase.integration.spring.SpringLiquibase$SpringResourceOpener", null)) {
SpringLiquibase.SpringResourceOpener resourceAccessor = springLiquibase.new SpringResourceOpener(descriptor.getChangeLog());
return StreamUtil.singleInputStream(changeLogPath, resourceAccessor);
return StreamUtil.openStream(changeLogPath, null, null, null);
} else if (ClassUtils.isPresent("liquibase.integration.spring.SpringLiquibase$SpringResourceAccessor", null)) {
Object resourceAccessor = ReflectionUtils.invokeConstructor("liquibase.integration.spring.SpringLiquibase$SpringResourceAccessor", springLiquibase);
return ReflectionUtils.invokeMethod(resourceAccessor, "openStream", null, changeLogPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public DatabasePool load(DatabaseConfig config) {
private final ClientConfig clientConfig;

public DockerMariaDBDatabaseProvider(Environment environment, ObjectProvider<List<MariaDBContainerCustomizer>> containerCustomizers) {
String dockerImage = environment.getProperty("zonky.test.database.mariadb.docker.image", "mariadb:10.4");
String dockerImage = environment.getProperty("zonky.test.database.mariadb.docker.image", "mariadb:11.5");
String tmpfsOptions = environment.getProperty("zonky.test.database.mariadb.docker.tmpfs.options", "rw,noexec,nosuid");
boolean tmpfsEnabled = environment.getProperty("zonky.test.database.mariadb.docker.tmpfs.enabled", boolean.class, false);

Expand Down Expand Up @@ -140,12 +140,17 @@ protected static class DatabaseInstance {

private final DatabasePool databasePool;
private final MariaDBContainer container;
private final boolean useMariadbCommand;
private final Semaphore semaphore;

private DatabaseInstance(DatabaseConfig config, DatabasePool pool) {
databasePool = pool;
container = createContainer(config.dockerImage);

String version = DockerImageName.parse(config.dockerImage).getVersionPart().replaceFirst("^([0-9]+\\.[0-9]+).*", "$1");
Float containerVersion = Character.isDigit(version.charAt(0)) ? Float.parseFloat(version) : null;
useMariadbCommand = containerVersion != null && containerVersion >= 11;

if (config.tmpfsEnabled) {
Consumer<CreateContainerCmd> consumer = cmd -> cmd.getHostConfig()
.withTmpFs(ImmutableMap.of("/var/lib/mysql", config.tmpfsOptions));
Expand Down Expand Up @@ -191,8 +196,9 @@ public EmbeddedDatabase createDatabase(ClientConfig config, DatabasePreparer pre
}

protected void cleanDatabase(ClientConfig config, String dbName) {
try {
String dropCommand = "mysql -uroot -pdocker -N -e \"show databases\" | grep -v -E \"^(information_schema|performance_schema|mysql|sys)$\" | awk '{print \"drop database \" $1 \"\"}' | mysql -uroot -pdocker";
try { // MariaDB 11 moved from mysql to mariadb binary
String dropCommand = useMariadbCommand ? "mariadb -uroot -pdocker -N -e \"show databases\" | grep -v -E \"^(information_schema|performance_schema|mysql|sys)$\" | awk '{print \"drop database \" $1 \"\"}' | mariadb -uroot -pdocker" :
"mysql -uroot -pdocker -N -e \"show databases\" | grep -v -E \"^(information_schema|performance_schema|mysql|sys)$\" | awk '{print \"drop database \" $1 \"\"}' | mysql -uroot -pdocker";
ExecResult dropResult = container.execInContainer("sh", "-c", dropCommand);
if (dropResult.getExitCode() != 0) {
throw new ProviderException("Unexpected error when cleaning up the database");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public DatabaseInstance load(DatabaseConfig config) {
private final ClientConfig clientConfig;

public DockerMSSQLDatabaseProvider(Environment environment, ObjectProvider<List<MSSQLServerContainerCustomizer>> containerCustomizers) {
String dockerImage = environment.getProperty("zonky.test.database.mssql.docker.image", "mcr.microsoft.com/mssql/server:2017-latest");
String dockerImage = environment.getProperty("zonky.test.database.mssql.docker.image", "mcr.microsoft.com/mssql/server:2022-latest");
Map<String, String> connectProperties = PropertyUtils.extractAll(environment, "zonky.test.database.mssql.client.properties");
List<MSSQLServerContainerCustomizer> customizers = Optional.ofNullable(containerCustomizers.getIfAvailable()).orElse(emptyList());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public DatabasePool load(DatabaseConfig config) {
private final ClientConfig clientConfig;

public DockerMySQLDatabaseProvider(Environment environment, ObjectProvider<List<MySQLContainerCustomizer>> containerCustomizers) {
String dockerImage = environment.getProperty("zonky.test.database.mysql.docker.image", "mysql:5.7");
String dockerImage = environment.getProperty("zonky.test.database.mysql.docker.image", "mysql:9.0");
String tmpfsOptions = environment.getProperty("zonky.test.database.mysql.docker.tmpfs.options", "rw,noexec,nosuid");
boolean tmpfsEnabled = environment.getProperty("zonky.test.database.mysql.docker.tmpfs.enabled", boolean.class, false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public DatabaseInstance load(DatabaseConfig config) {
private final ClientConfig clientConfig;

public DockerPostgresDatabaseProvider(Environment environment, ObjectProvider<List<PostgreSQLContainerCustomizer>> containerCustomizers) {
String dockerImage = environment.getProperty("zonky.test.database.postgres.docker.image", "postgres:11-alpine");
String dockerImage = environment.getProperty("zonky.test.database.postgres.docker.image", "postgres:16-alpine");
String tmpfsOptions = environment.getProperty("zonky.test.database.postgres.docker.tmpfs.options", "rw,noexec,nosuid");
boolean tmpfsEnabled = environment.getProperty("zonky.test.database.postgres.docker.tmpfs.enabled", boolean.class, false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public DatabaseInstance load(DatabaseConfig config) throws IOException {
private final ClientConfig clientConfig;

public YandexPostgresDatabaseProvider(Environment environment) {
String postgresVersion = environment.getProperty("zonky.test.database.postgres.yandex-provider.postgres-version", "11.10-1");
String postgresVersion = environment.getProperty("zonky.test.database.postgres.yandex-provider.postgres-version", "10.23-1");

Map<String, String> initdbProperties = PropertyUtils.extractAll(environment, "zonky.test.database.postgres.initdb.properties");
Map<String, String> configProperties = PropertyUtils.extractAll(environment, "zonky.test.database.postgres.server.properties");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"name": "zonky.test.database.postgres.docker.image",
"type": "java.lang.String",
"description": "Docker image containing PostgreSQL database.",
"defaultValue": "postgres:11-alpine"
"defaultValue": "postgres:16-alpine"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep in mind that such changes will have to wait until the next major version.

},
{
"name": "zonky.test.database.postgres.docker.tmpfs.enabled",
Expand All @@ -130,8 +130,8 @@
{
"name": "zonky.test.database.postgres.yandex-provider.postgres-version",
"type": "java.lang.String",
"description": "Version of EnterpriseDB PostgreSQL binaries (https://www.enterprisedb.com/download-postgresql-binaries).",
"defaultValue": "11.10-1"
"description": "Version of EnterpriseDB PostgreSQL binaries (https://www.enterprisedb.com/download-postgresql-binaries). 11+ for Linux available on https://www.postgresql.org/download/",
"defaultValue": "10.23-1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PostgreSQL versions for OpenTable and Yandex providers must match the other providers, regardless of whether they support Linux platform or not. I plan to remove them in the next major version anyway.

},
{
"name": "zonky.test.database.mssql.client.properties",
Expand All @@ -142,7 +142,7 @@
"name": "zonky.test.database.mssql.docker.image",
"type": "java.lang.String",
"description": "Docker image containing MSSQL database.",
"defaultValue": "mcr.microsoft.com/mssql/server:2017-latest"
"defaultValue": "mcr.microsoft.com/mssql/server:2022-latest"
},
{
"name": "zonky.test.database.mysql.client.properties",
Expand All @@ -153,7 +153,7 @@
"name": "zonky.test.database.mysql.docker.image",
"type": "java.lang.String",
"description": "Docker image containing MySQL database.",
"defaultValue": "mysql:5.7"
"defaultValue": "mysql:9.0"
},
{
"name": "zonky.test.database.mysql.docker.tmpfs.enabled",
Expand All @@ -176,7 +176,7 @@
"name": "zonky.test.database.mariadb.docker.image",
"type": "java.lang.String",
"description": "Docker image containing MariaDB database.",
"defaultValue": "mariadb:10.4"
"defaultValue": "mariadb:11.5"
},
{
"name": "zonky.test.database.mariadb.docker.tmpfs.enabled",
Expand Down Expand Up @@ -256,76 +256,64 @@
"name": "zonky.test.database.postgres.docker.image",
"values": [
{
"value": "postgres:13-alpine"
},
{
"value": "postgres:12-alpine"
},
{
"value": "postgres:11-alpine"
"value": "postgres:16-alpine"
},
{
"value": "postgres:10-alpine"
"value": "postgres:15-alpine"
},
{
"value": "postgres:9.6-alpine"
"value": "postgres:14-alpine"
},
{
"value": "postgres:9.5-alpine"
},
{
"value": "postgres:13"
},
{
"value": "postgres:12"
"value": "postgres:13-alpine"
},
{
"value": "postgres:11"
"value": "postgres:12-alpine"
},
{
"value": "postgres:10"
"value": "postgres:16"
},
{
"value": "postgres:9.6"
"value": "postgres:15"
},
{
"value": "postgres:9.5"
"value": "postgres:14"
},
{
"value": "postgis/postgis:13-3.1-alpine"
"value": "postgres:13"
},
{
"value": "postgis/postgis:12-3.1-alpine"
"value": "postgres:12"
},
{
"value": "postgis/postgis:11-3.1-alpine"
"value": "postgis/postgis:16-3.4-alpine"
},
{
"value": "postgis/postgis:10-3.1-alpine"
"value": "postgis/postgis:15-3.4-alpine"
},
{
"value": "postgis/postgis:9.6-3.1-alpine"
"value": "postgis/postgis:14-3.4-alpine"
},
{
"value": "postgis/postgis:9.5-3.0-alpine"
"value": "postgis/postgis:13-3.4-alpine"
},
{
"value": "postgis/postgis:13-3.1"
"value": "postgis/postgis:12-3.4-alpine"
},
{
"value": "postgis/postgis:12-3.1"
"value": "postgis/postgis:16-3.4"
},
{
"value": "postgis/postgis:11-3.1"
"value": "postgis/postgis:15-3.4"
},
{
"value": "postgis/postgis:10-3.1"
"value": "postgis/postgis:14-3.4"
},
{
"value": "postgis/postgis:9.6-3.1"
"value": "postgis/postgis:13-3.4"
},
{
"value": "postgis/postgis:9.5-3.0"
"value": "postgis/postgis:12-3.4"
}
],
"providers": [
Expand Down Expand Up @@ -357,13 +345,13 @@
"name": "zonky.test.database.mysql.docker.image",
"values": [
{
"value": "mysql:8.0"
"value": "mysql:9.0"
},
{
"value": "mysql:5.7"
"value": "mysql:8.4"
},
{
"value": "mysql:5.6"
"value": "mysql:8.0"
}
],
"providers": [
Expand All @@ -376,19 +364,25 @@
"name": "zonky.test.database.mariadb.docker.image",
"values": [
{
"value": "mariadb:10.5"
"value": "mariadb:11.5"
},
{
"value": "mariadb:11.4"
},
{
"value": "mariadb:10.4"
"value": "mariadb:11.2"
},
{
"value": "mariadb:10.3"
"value": "mariadb:11.1"
},
{
"value": "mariadb:10.2"
"value": "mariadb:10.11"
},
{
"value": "mariadb:10.1"
"value": "mariadb:10.6"
},
{
"value": "mariadb:10.5"
}
],
"providers": [
Expand All @@ -398,4 +392,4 @@
]
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import static io.zonky.test.db.AutoConfigureEmbeddedDatabase.DatabaseType.POSTGRES;
import static io.zonky.test.db.AutoConfigureEmbeddedDatabase.RefreshMode.AFTER_EACH_TEST_METHOD;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import static io.zonky.test.db.AutoConfigureEmbeddedDatabase.DatabaseType.POSTGRES;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
Expand Down
Loading
Loading