diff --git a/common/gradle.lockfile b/common/gradle.lockfile index d35ea654e..0403f9edd 100644 --- a/common/gradle.lockfile +++ b/common/gradle.lockfile @@ -56,12 +56,12 @@ org.jacoco:org.jacoco.core:0.8.12=jacocoAnt org.jacoco:org.jacoco.report:0.8.12=jacocoAnt org.javassist:javassist:3.28.0-GA=checkstyle org.jspecify:jspecify:1.0.0=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,testing,testingCompileClasspath -org.junit.jupiter:junit-jupiter-api:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit:junit-bom:5.12.0-M1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.7=jacocoAnt org.ow2.asm:asm-tree:9.7=jacocoAnt diff --git a/core/gradle.lockfile b/core/gradle.lockfile index 734f07fbf..a1a12fc94 100644 --- a/core/gradle.lockfile +++ b/core/gradle.lockfile @@ -529,17 +529,17 @@ org.json:json:20240303=compileClasspath,deploy_jar,nonprodCompileClasspath,nonpr org.jsoup:jsoup:1.18.3=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.jspecify:jspecify:1.0.0=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit-pioneer:junit-pioneer:2.3.0=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-migrationsupport:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.12.0-M1=testRuntimeClasspath -org.junit:junit-bom:5.12.0-M1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-migrationsupport:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.12.0-RC1=testRuntimeClasspath +org.junit:junit-bom:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-core:5.15.2=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-junit-jupiter:5.15.2=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testRuntimeClasspath diff --git a/core/src/nonprod/java/google/registry/tools/GenerateSqlErDiagramCommand.java b/core/src/nonprod/java/google/registry/tools/GenerateSqlErDiagramCommand.java index 38f94cb60..b15129bac 100644 --- a/core/src/nonprod/java/google/registry/tools/GenerateSqlErDiagramCommand.java +++ b/core/src/nonprod/java/google/registry/tools/GenerateSqlErDiagramCommand.java @@ -105,7 +105,7 @@ public class GenerateSqlErDiagramCommand implements Command { } try (PostgreSQLContainer postgresContainer = - new PostgreSQLContainer<>(NomulusPostgreSql.getDockerTag())) { + new PostgreSQLContainer<>(NomulusPostgreSql.getDockerImageName())) { postgresContainer .withDatabaseName(DB_NAME) .withUsername(DB_USER) diff --git a/core/src/nonprod/java/google/registry/tools/GenerateSqlSchemaCommand.java b/core/src/nonprod/java/google/registry/tools/GenerateSqlSchemaCommand.java index 834bfbabf..60f1cef5f 100644 --- a/core/src/nonprod/java/google/registry/tools/GenerateSqlSchemaCommand.java +++ b/core/src/nonprod/java/google/registry/tools/GenerateSqlSchemaCommand.java @@ -83,7 +83,7 @@ public class GenerateSqlSchemaCommand implements Command { // Start the container and store the address information. postgresContainer = - new PostgreSQLContainer<>(NomulusPostgreSql.getDockerTag()) + new PostgreSQLContainer<>(NomulusPostgreSql.getDockerImageName()) .withDatabaseName(DB_NAME) .withUsername(DB_USERNAME) .withPassword(DB_PASSWORD); @@ -93,20 +93,20 @@ public class GenerateSqlSchemaCommand implements Command { } else if (databaseHost == null) { System.err.println( """ - You must specify either --start_postgresql to start a PostgreSQL database in a - docker instance, or specify --db_host (and, optionally, --db_port) to identify - the location of a running instance. To start a long-lived instance (suitable - for running this command multiple times) run this: + You must specify either --start_postgresql to start a PostgreSQL database in a + docker instance, or specify --db_host (and, optionally, --db_port) to identify + the location of a running instance. To start a long-lived instance (suitable + for running this command multiple times) run this: - docker run --rm --name some-postgres -e POSTGRES_PASSWORD=domain-registry \\ - -d postgres:9.6.12 + docker run --rm --name some-postgres -e POSTGRES_PASSWORD=domain-registry \\ + -d postgres:9.6.12 - Copy the container id output from the command, then run: + Copy the container id output from the command, then run: - docker inspect | grep IPAddress + docker inspect | grep IPAddress - To obtain the value for --db-host. - """); + To obtain the value for --db-host. + """); // TODO(mmuller): need exit(1), see above. return; } @@ -124,20 +124,20 @@ public class GenerateSqlSchemaCommand implements Command { // existing data in the file. String copyright = """ - -- Copyright 2019 The Nomulus Authors. All Rights Reserved. - -- - -- Licensed under the Apache License, Version 2.0 (the "License"); - -- you may not use this file except in compliance with the License. - -- You may obtain a copy of the License at - -- - -- http://www.apache.org/licenses/LICENSE-2.0 - -- - -- Unless required by applicable law or agreed to in writing, software - -- distributed under the License is distributed on an "AS IS" BASIS, - -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -- See the License for the specific language governing permissions and - -- limitations under the License. - """; + -- Copyright 2019 The Nomulus Authors. All Rights Reserved. + -- + -- Licensed under the Apache License, Version 2.0 (the "License"); + -- you may not use this file except in compliance with the License. + -- You may obtain a copy of the License at + -- + -- http://www.apache.org/licenses/LICENSE-2.0 + -- + -- Unless required by applicable law or agreed to in writing, software + -- distributed under the License is distributed on an "AS IS" BASIS, + -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + -- See the License for the specific language governing permissions and + -- limitations under the License. + """; try { Files.writeString(outputFile.toPath(), copyright); } catch (IOException e) { diff --git a/core/src/nonprod/java/google/registry/tools/PostgresqlCommand.java b/core/src/nonprod/java/google/registry/tools/PostgresqlCommand.java index f7d81c12b..d50defbad 100644 --- a/core/src/nonprod/java/google/registry/tools/PostgresqlCommand.java +++ b/core/src/nonprod/java/google/registry/tools/PostgresqlCommand.java @@ -68,7 +68,7 @@ public abstract class PostgresqlCommand implements Command { // Start the container and store the address information. postgresContainer = - new PostgreSQLContainer<>(NomulusPostgreSql.getDockerTag()) + new PostgreSQLContainer<>(NomulusPostgreSql.getDockerImageName()) .withDatabaseName(DB_NAME) .withUsername(DB_USERNAME) .withPassword(DB_PASSWORD); @@ -89,7 +89,7 @@ public abstract class PostgresqlCommand implements Command { + "for running this command multiple times) run this:\n\n" + " docker run --rm --name some-postgres -e POSTGRES_PASSWORD=domain-registry \\\n" + " -d " - + NomulusPostgreSql.getDockerTag() + + NomulusPostgreSql.getDockerImageName() + "\n\nCopy the container id output from the command, then run:\n\n" + " docker inspect | grep IPAddress\n\n" + "To obtain the value for --db-host.\n"); diff --git a/core/src/test/java/google/registry/persistence/HibernateSchemaExporterTest.java b/core/src/test/java/google/registry/persistence/HibernateSchemaExporterTest.java index 4f2748a1a..9ba25f3ca 100644 --- a/core/src/test/java/google/registry/persistence/HibernateSchemaExporterTest.java +++ b/core/src/test/java/google/registry/persistence/HibernateSchemaExporterTest.java @@ -38,7 +38,7 @@ class HibernateSchemaExporterTest { @Container private static final PostgreSQLContainer database = - new PostgreSQLContainer(NomulusPostgreSql.getDockerTag()); + new PostgreSQLContainer(NomulusPostgreSql.getDockerImageName()); private static HibernateSchemaExporter exporter; @@ -61,12 +61,12 @@ class HibernateSchemaExporterTest { .isEqualTo( """ - create table "TestEntity" ( - name text not null, - cu text, - primary key (name) - ); - """ + create table "TestEntity" ( + name text not null, + cu text, + primary key (name) + ); +""" .getBytes(StandardCharsets.UTF_8)); } diff --git a/core/src/test/java/google/registry/persistence/PersistenceModuleTest.java b/core/src/test/java/google/registry/persistence/PersistenceModuleTest.java index da51435b6..04f7ab513 100644 --- a/core/src/test/java/google/registry/persistence/PersistenceModuleTest.java +++ b/core/src/test/java/google/registry/persistence/PersistenceModuleTest.java @@ -42,7 +42,7 @@ class PersistenceModuleTest { @Container private final PostgreSQLContainer database = - new PostgreSQLContainer(NomulusPostgreSql.getDockerTag()); + new PostgreSQLContainer(NomulusPostgreSql.getDockerImageName()); private EntityManagerFactory emf; diff --git a/core/src/test/java/google/registry/persistence/transaction/JpaTransactionManagerExtension.java b/core/src/test/java/google/registry/persistence/transaction/JpaTransactionManagerExtension.java index fab3006e9..72436681b 100644 --- a/core/src/test/java/google/registry/persistence/transaction/JpaTransactionManagerExtension.java +++ b/core/src/test/java/google/registry/persistence/transaction/JpaTransactionManagerExtension.java @@ -140,7 +140,7 @@ public abstract class JpaTransactionManagerExtension private static JdbcDatabaseContainer create() { PostgreSQLContainer container = - new PostgreSQLContainer<>(NomulusPostgreSql.getDockerTag()) + new PostgreSQLContainer<>(NomulusPostgreSql.getDockerImageName()) .withDatabaseName(POSTGRES_DB_NAME); container.start(); return container; diff --git a/core/src/test/java/google/registry/tools/GenerateSqlSchemaCommandTest.java b/core/src/test/java/google/registry/tools/GenerateSqlSchemaCommandTest.java index 365d015cb..d04c6fd2b 100644 --- a/core/src/test/java/google/registry/tools/GenerateSqlSchemaCommandTest.java +++ b/core/src/test/java/google/registry/tools/GenerateSqlSchemaCommandTest.java @@ -39,7 +39,7 @@ class GenerateSqlSchemaCommandTest extends CommandTestCase postgres = - new PostgreSQLContainer<>(NomulusPostgreSql.getDockerTag()) + new PostgreSQLContainer<>(NomulusPostgreSql.getDockerImageName()) .withDatabaseName("postgres") .withUsername("postgres") .withPassword("domain-registry"); diff --git a/core/src/test/java/google/registry/webdriver/ConsoleScreenshotTest.java b/core/src/test/java/google/registry/webdriver/ConsoleScreenshotTest.java index 75bb0c8a4..8d1f6d37b 100644 --- a/core/src/test/java/google/registry/webdriver/ConsoleScreenshotTest.java +++ b/core/src/test/java/google/registry/webdriver/ConsoleScreenshotTest.java @@ -23,6 +23,7 @@ import google.registry.model.console.RegistrarRole; import google.registry.server.RegistryTestServer; import java.util.List; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.junit.jupiter.api.extension.RegisterExtension; import org.junitpioneer.jupiter.RetryingTest; import org.openqa.selenium.By; @@ -47,6 +48,8 @@ import org.openqa.selenium.WebElement; * the color fading over a short period of time. We must wait for the highlighting to fade to get * cnosistent images to avoid spurious failures. */ +// The Selenium image only supports amd64 architecture. +@EnabledIfSystemProperty(named = "os.arch", matches = "amd64") public class ConsoleScreenshotTest extends WebDriverTestCase { @RegisterExtension diff --git a/core/src/test/java/google/registry/webdriver/DockerWebDriverExtension.java b/core/src/test/java/google/registry/webdriver/DockerWebDriverExtension.java index a0e56c737..9e48bb766 100644 --- a/core/src/test/java/google/registry/webdriver/DockerWebDriverExtension.java +++ b/core/src/test/java/google/registry/webdriver/DockerWebDriverExtension.java @@ -37,7 +37,11 @@ class DockerWebDriverExtension implements BeforeAllCallback, AfterAllCallback { // This port number is defined in this Dockerfile: // https://github.com/SeleniumHQ/docker-selenium/blob/master/StandaloneChrome/Dockerfile#L21 private static final int CHROME_DRIVER_SERVICE_PORT = 4444; - private static final URL WEB_DRIVER_URL = getWebDriverUrl(); + // The selenium image only supports amd64 architecture. We disable the call to getWebDriverUrl() + // here as the extension is instantiated in the test class before the test runner had a chance to + // disable the tests. + private static final URL WEB_DRIVER_URL = + System.getProperty("os.arch").equals("amd64") ? getWebDriverUrl() : null; private WebDriver webDriver; private static URL getWebDriverUrl() { diff --git a/db/build.gradle b/db/build.gradle index bb58cd0be..c0642d489 100644 --- a/db/build.gradle +++ b/db/build.gradle @@ -178,6 +178,7 @@ dependencies { implementation deps['org.flywaydb:flyway-core'] implementation deps['org.flywaydb:flyway-database-postgresql'] + implementation deps['org.testcontainers:testcontainers'] runtimeOnly deps['com.google.cloud.sql:postgres-socket-factory'] runtimeOnly deps['org.postgresql:postgresql'] @@ -190,8 +191,6 @@ dependencies { testImplementation deps['org.junit.jupiter:junit-jupiter-api'] testImplementation deps['org.junit.jupiter:junit-jupiter-engine'] testImplementation deps['org.junit.platform:junit-platform-launcher'] - testImplementation deps['org.testcontainers:postgresql'] - testImplementation deps['org.testcontainers:testcontainers'] testImplementation deps['org.testcontainers:junit-jupiter'] testImplementation deps['org.testcontainers:postgresql'] testImplementation project(path: ':common', configuration: 'testing') diff --git a/db/gradle.lockfile b/db/gradle.lockfile index 55406402a..c7e1af491 100644 --- a/db/gradle.lockfile +++ b/db/gradle.lockfile @@ -10,9 +10,9 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.2=compileClasspath,d com.fasterxml.jackson:jackson-bom:2.15.2=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.ben-manes.caffeine:caffeine:3.0.5=annotationProcessor,errorprone,testAnnotationProcessor com.github.ben-manes.caffeine:caffeine:3.2.0=testCompileClasspath,testRuntimeClasspath -com.github.docker-java:docker-java-api:3.4.0=testCompileClasspath,testRuntimeClasspath -com.github.docker-java:docker-java-transport-zerodep:3.4.0=testCompileClasspath,testRuntimeClasspath -com.github.docker-java:docker-java-transport:3.4.0=testCompileClasspath,testRuntimeClasspath +com.github.docker-java:docker-java-api:3.4.0=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.docker-java:docker-java-transport-zerodep:3.4.0=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.docker-java:docker-java-transport:3.4.0=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jffi:1.3.13=deploy_jar,runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=deploy_jar,runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=deploy_jar,runtimeClasspath,testRuntimeClasspath @@ -79,10 +79,10 @@ jakarta.inject:jakarta.inject-api:1.0.5=testCompileClasspath,testRuntimeClasspat javax.inject:javax.inject:1=annotationProcessor,errorprone,testAnnotationProcessor joda-time:joda-time:2.13.1=testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=testCompileClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.13.0=testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna:5.13.0=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:10.6=checkstyle org.antlr:antlr4-runtime:4.9.3=checkstyle -org.apache.commons:commons-compress:1.24.0=testCompileClasspath,testRuntimeClasspath +org.apache.commons:commons-compress:1.24.0=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.apache.httpcomponents:httpclient:4.5.14=deploy_jar,runtimeClasspath,testRuntimeClasspath org.apache.httpcomponents:httpcore:4.4.16=deploy_jar,runtimeClasspath,testRuntimeClasspath org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath @@ -99,14 +99,14 @@ org.jacoco:org.jacoco.ant:0.8.12=jacocoAnt org.jacoco:org.jacoco.core:0.8.12=jacocoAnt org.jacoco:org.jacoco.report:0.8.12=jacocoAnt org.javassist:javassist:3.28.0-GA=checkstyle -org.jetbrains:annotations:17.0.0=testCompileClasspath,testRuntimeClasspath +org.jetbrains:annotations:17.0.0=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit:junit-bom:5.12.0-M1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=deploy_jar,runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.7=jacocoAnt @@ -119,12 +119,12 @@ org.ow2.asm:asm:9.7.1=deploy_jar,runtimeClasspath,testRuntimeClasspath org.pcollections:pcollections:3.1.4=annotationProcessor,errorprone,testAnnotationProcessor org.postgresql:postgresql:42.7.5=deploy_jar,runtimeClasspath,testRuntimeClasspath org.reflections:reflections:0.10.2=checkstyle -org.rnorth.duct-tape:duct-tape:1.0.8=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.36=testCompileClasspath +org.rnorth.duct-tape:duct-tape:1.0.8=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.36=compileClasspath,testCompileClasspath org.slf4j:slf4j-api:2.0.16=deploy_jar,runtimeClasspath,testRuntimeClasspath org.testcontainers:database-commons:1.20.4=testCompileClasspath,testRuntimeClasspath org.testcontainers:jdbc:1.20.4=testCompileClasspath,testRuntimeClasspath org.testcontainers:junit-jupiter:1.20.4=testCompileClasspath,testRuntimeClasspath org.testcontainers:postgresql:1.20.4=testCompileClasspath,testRuntimeClasspath -org.testcontainers:testcontainers:1.20.4=testCompileClasspath,testRuntimeClasspath +org.testcontainers:testcontainers:1.20.4=compileClasspath,deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath empty=implementationApi,schema diff --git a/db/src/main/java/google/registry/persistence/NomulusPostgreSql.java b/db/src/main/java/google/registry/persistence/NomulusPostgreSql.java index 59726d894..65ef933ac 100644 --- a/db/src/main/java/google/registry/persistence/NomulusPostgreSql.java +++ b/db/src/main/java/google/registry/persistence/NomulusPostgreSql.java @@ -13,15 +13,27 @@ // limitations under the License. package google.registry.persistence; +import org.testcontainers.utility.DockerImageName; + /** Information about Nomulus' Cloud SQL PostgreSql instance. */ public class NomulusPostgreSql { + /** Get the current system architecture, used to deduce the docker image name. */ + private static final String ARCH = System.getProperty("os.arch"); + /** The current PostgreSql version in Cloud SQL. */ // TODO(weiminyu): setup periodic checks to detect version changes in Cloud SQL. private static final String TARGET_VERSION = "11.21-alpine"; - /** Returns the docker image tag of the targeted Postgresql server version. */ - public static String getDockerTag() { - return "postgres:" + TARGET_VERSION; + /** + * Returns the docker image of the targeted Postgresql server version. + * + *

If the architecture is not amd64, the image will be prefixed with the architecture name. + * + * @see Postgres Docker Hub + */ + public static DockerImageName getDockerImageName() { + String image = (ARCH.equals("amd64") ? "" : ARCH + "/") + "postgres:" + TARGET_VERSION; + return DockerImageName.parse(image).asCompatibleSubstituteFor("postgres"); } } diff --git a/db/src/test/java/google/registry/sql/flyway/SchemaTest.java b/db/src/test/java/google/registry/sql/flyway/SchemaTest.java index 77c15484f..811884263 100644 --- a/db/src/test/java/google/registry/sql/flyway/SchemaTest.java +++ b/db/src/test/java/google/registry/sql/flyway/SchemaTest.java @@ -79,7 +79,7 @@ class SchemaTest { */ @Container private final PostgreSQLContainer sqlContainer = - new PostgreSQLContainer<>(NomulusPostgreSql.getDockerTag()) + new PostgreSQLContainer<>(NomulusPostgreSql.getDockerImageName()) .withClasspathResourceMapping( MOUNTED_RESOURCE_PATH, CONTAINER_MOUNT_POINT, BindMode.READ_WRITE); diff --git a/networking/gradle.lockfile b/networking/gradle.lockfile index aaf269d12..b273fa4e7 100644 --- a/networking/gradle.lockfile +++ b/networking/gradle.lockfile @@ -153,16 +153,16 @@ org.jetbrains.kotlin:kotlin-stdlib:1.9.20=annotationProcessor,testAnnotationProc org.jetbrains:annotations:13.0=annotationProcessor,testAnnotationProcessor org.jetbrains:annotations:17.0.0=testCompileClasspath,testRuntimeClasspath org.jspecify:jspecify:1.0.0=deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.12.0-M1=testRuntimeClasspath -org.junit:junit-bom:5.12.0-M1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.12.0-RC1=testRuntimeClasspath +org.junit:junit-bom:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.7=jacocoAnt org.ow2.asm:asm-tree:9.7=jacocoAnt diff --git a/prober/gradle.lockfile b/prober/gradle.lockfile index 9e2483a1d..86a2ab6a6 100644 --- a/prober/gradle.lockfile +++ b/prober/gradle.lockfile @@ -159,16 +159,16 @@ org.jetbrains.kotlin:kotlin-stdlib:1.9.20=annotationProcessor,testAnnotationProc org.jetbrains:annotations:13.0=annotationProcessor,testAnnotationProcessor org.jetbrains:annotations:17.0.0=testCompileClasspath,testRuntimeClasspath org.jspecify:jspecify:1.0.0=deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.12.0-M1=testRuntimeClasspath -org.junit:junit-bom:5.12.0-M1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.12.0-RC1=testRuntimeClasspath +org.junit:junit-bom:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-core:5.15.2=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath diff --git a/proxy/gradle.lockfile b/proxy/gradle.lockfile index f717d1ac8..0cb2a6f06 100644 --- a/proxy/gradle.lockfile +++ b/proxy/gradle.lockfile @@ -223,16 +223,16 @@ org.jetbrains.kotlin:kotlin-stdlib:1.9.20=annotationProcessor,testAnnotationProc org.jetbrains:annotations:13.0=annotationProcessor,testAnnotationProcessor org.jetbrains:annotations:17.0.0=testCompileClasspath,testRuntimeClasspath org.jspecify:jspecify:1.0.0=deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.12.0-M1=testRuntimeClasspath -org.junit:junit-bom:5.12.0-M1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.12.0-RC1=testRuntimeClasspath +org.junit:junit-bom:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-core:5.15.2=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath diff --git a/util/gradle.lockfile b/util/gradle.lockfile index 6de66130e..ae93aac7a 100644 --- a/util/gradle.lockfile +++ b/util/gradle.lockfile @@ -144,15 +144,15 @@ org.jetbrains.kotlin:kotlin-stdlib:1.9.20=annotationProcessor,testAnnotationProc org.jetbrains:annotations:13.0=annotationProcessor,testAnnotationProcessor org.jetbrains:annotations:17.0.0=testCompileClasspath,testRuntimeClasspath org.jspecify:jspecify:1.0.0=deploy_jar,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.12.0-M1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.12.0-M1=testRuntimeClasspath -org.junit:junit-bom:5.12.0-M1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.12.0-RC1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.12.0-RC1=testRuntimeClasspath +org.junit:junit-bom:5.12.0-RC1=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-core:5.15.2=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-junit-jupiter:5.15.2=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testRuntimeClasspath