Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- Linux/Mac: Added support for docker credential helpers so that images may be pulled from private registries. See [\#729](https://github.com/testcontainers/testcontainers-java/issues/729), [\#647](https://github.com/testcontainers/testcontainers-java/issues/647) and [\#567](https://github.com/testcontainers/testcontainers-java/issues/567).
- Ensure that the `COMPOSE_FILE` environment variable is populated with all relevant compose file names when running docker-compose in local mode [\#755](https://github.com/testcontainers/testcontainers-java/issues/755).
- Fixed issue whereby specified command in MariaDB image was not being applied. ([\#534](https://github.com/testcontainers/testcontainers-java/issues/534))

### Changed
- Update Apache Pulsar module to 2.0.1 [\#760](https://github.com/testcontainers/testcontainers-java/issues/760).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void testSpecificVersion() throws SQLException {
public void testMariaDBWithCustomIniFile() throws SQLException {
assumeFalse(SystemUtils.IS_OS_WINDOWS);
MariaDBContainer mariadbCustomConfig = new MariaDBContainer("mariadb:10.1.16")
.withConfigurationOverride("somepath/mariadb_conf_override");
.withConfigurationOverride("somepath/mariadb_conf_override");
mariadbCustomConfig.start();

try {
Expand All @@ -69,6 +69,23 @@ public void testMariaDBWithCustomIniFile() throws SQLException {
}
}

@Test
public void testMariaDBWithCommandOverride() throws SQLException {

MariaDBContainer mariadbCustomConfig = (MariaDBContainer) new MariaDBContainer("mariadb:10.1.16")
.withCommand("mysqld --auto_increment_increment=10");
mariadbCustomConfig.start();

try {
ResultSet resultSet = performQuery(mariadbCustomConfig, "show variables like 'auto_increment_increment'");
String result = resultSet.getString("Value");

assertEquals("Auto increment increment should be overriden by command line", "10", result);
} finally {
mariadbCustomConfig.stop();
}
}

@NonNull
protected ResultSet performQuery(MariaDBContainer containerRule, String sql) throws SQLException {
HikariConfig hikariConfig = new HikariConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ protected void configure() {
addEnv("MYSQL_USER", MARIADB_USER);
addEnv("MYSQL_PASSWORD", MARIADB_PASSWORD);
addEnv("MYSQL_ROOT_PASSWORD", MARIADB_PASSWORD);
setCommand("mysqld");
setStartupAttempts(3);
}

Expand Down