Description
ZMSTestUtils uses Testcontainers which defaults to pulling images from Docker Hub. This causes issues in enterprise CI/CD environments that:
- Cannot access Docker Hub directly (firewall restrictions)
- Require pulling images from internal registries
Affected images
MySQL container - Used for database tests
Ryuk container - Testcontainers' resource reaper for cleanup
Proposed Solution
Require explicit configuration via environment variables
ZMS_TEST_MYSQL_IMAGE
TESTCONTAINERS_RYUK_CONTAINER_IMAGE
Update ZMSTestUtils
private static final String MYSQL_IMAGE_ENV_VAR = "ZMS_TEST_MYSQL_IMAGE";
private static final String DEFAULT_MYSQL_IMAGE = "mysql/mysql-server:8.0";
public static String getMySQLImage() {
String image = System.getenv("ZMS_TEST_MYSQL_IMAGE");
if (image == null || image.isEmpty()) {
image = DEFAULT_MYSQL_IMAGE; // fallback to default if no image specified
}
return image;
}
public static MySQLContainer startMemoryMySQL(final String userName, final String password) {
final String mysqlImage = getMySQLImage();
...
}
Description
ZMSTestUtils uses Testcontainers which defaults to pulling images from Docker Hub. This causes issues in enterprise CI/CD environments that:
Affected images
MySQL container - Used for database tests
Ryuk container - Testcontainers' resource reaper for cleanup
Proposed Solution
Require explicit configuration via environment variables
ZMS_TEST_MYSQL_IMAGETESTCONTAINERS_RYUK_CONTAINER_IMAGEUpdate ZMSTestUtils