1
0
mirror of https://github.com/google/nomulus synced 2026-04-24 02:00:50 +00:00

Compile Nomulus with Java 21 (#2344)

Make the necessary changes for the code base to compile with JDK 21.

Other changes:

1. Upgraded testcontainer version and the SQL image version (to be the
   same as what we use in Cloud SQL). This led to some schema changes and
   also changed the order of results in some test queries (for the
   better I think, as the new order appears to be alphabetical).
2. Remove dependency on Truth8, which is deprecated.
3. Enable parallel Gradle task execution and greatly increased the
   number of parallel tests in standardTest. Removed outcastTest.
This commit is contained in:
Lai Jiang
2024-03-04 14:31:08 -05:00
committed by GitHub
parent fbe0f4e0f2
commit dcf0412f11
112 changed files with 558 additions and 239 deletions

View File

@@ -16,8 +16,8 @@ package google.registry.sql.flyway;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import static com.google.common.truth.Truth8.assertThat;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.nio.file.Files.readAllLines;
import static java.util.concurrent.TimeUnit.SECONDS;
@@ -45,8 +45,8 @@ import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
* <p>Flyway deploys each DDL script in one transaction. If a script modifies multiple schema
* elements (table, index, sequence), it MAY hit deadlocks when applied on sandbox/production where
* it'll be competing against live traffic that may also be locking said elements but in a different
* order. This test checks every new script to be merged, counts the elements it locks, and raise an
* error when there are more than one locked elements.
* order. This test checks every new script to be merged, counts the elements it locks, and raises
* an error when there is more than one locked element.
*
* <p>For deadlock-prevention purpose, we can ignore elements being created or dropped: our
* schema-server compatibility tests ensure that such elements are not accessed by live traffic.

View File

@@ -77,7 +77,7 @@ class SchemaTest {
* easier to update the golden schema this way.
*/
@Container
private PostgreSQLContainer sqlContainer =
private final PostgreSQLContainer<?> sqlContainer =
new PostgreSQLContainer<>(NomulusPostgreSql.getDockerTag())
.withClasspathResourceMapping(
MOUNTED_RESOURCE_PATH, CONTAINER_MOUNT_POINT, BindMode.READ_WRITE);
@@ -116,7 +116,7 @@ class SchemaTest {
@Test
@EnabledIfSystemProperty(named = "deploy_to_existing_db", matches = ".*")
void deploySchema_existingDb() {
// Initialize database with the base schema, which is on the classpath.
// Initialize the database with the base schema, which is on the classpath.
Flyway flyway =
Flyway.configure()
.locations("sql/flyway")