mirror of
https://github.com/google/nomulus.git
synced 2025-07-09 04:33:28 +02:00
Always save reserved lists to Cloud SQL (#471)
* Always save reserved lists to Cloud SQL Otherwise it's too easy to forget to run this additional option, and then things will fall out of sync and start throwing errors.
This commit is contained in:
parent
9ea06ebf35
commit
b148102716
5 changed files with 24 additions and 43 deletions
|
@ -178,8 +178,7 @@ public class CreateReservedListCommandTest extends
|
|||
|
||||
@Test
|
||||
public void testSaveToCloudSql_succeeds() throws Exception {
|
||||
runCommandForced(
|
||||
"--name=xn--q9jyb4c_common-reserved", "--input=" + reservedTermsPath, "--also_cloud_sql");
|
||||
runCommandForced("--name=xn--q9jyb4c_common-reserved", "--input=" + reservedTermsPath);
|
||||
verifyXnq9jyb4cInDatastore();
|
||||
verifyXnq9jyb4cInCloudSql();
|
||||
}
|
||||
|
@ -193,8 +192,7 @@ public class CreateReservedListCommandTest extends
|
|||
"xn--q9jyb4c_common-reserved",
|
||||
true,
|
||||
ImmutableMap.of("testdomain", ReservedEntry.create(FULLY_BLOCKED, ""))));
|
||||
runCommandForced(
|
||||
"--name=xn--q9jyb4c_common-reserved", "--input=" + reservedTermsPath, "--also_cloud_sql");
|
||||
runCommandForced("--name=xn--q9jyb4c_common-reserved", "--input=" + reservedTermsPath);
|
||||
verifyXnq9jyb4cInDatastore();
|
||||
}
|
||||
|
||||
|
|
|
@ -116,20 +116,18 @@ public class UpdateReservedListCommandTest extends
|
|||
public void testSaveToCloudSql_succeeds() throws Exception {
|
||||
populateInitialReservedListInDatastore(true);
|
||||
populateInitialReservedListInCloudSql(true);
|
||||
runCommandForced(
|
||||
"--name=xn--q9jyb4c_common-reserved", "--input=" + reservedTermsPath, "--also_cloud_sql");
|
||||
runCommandForced("--name=xn--q9jyb4c_common-reserved", "--input=" + reservedTermsPath);
|
||||
verifyXnq9jyb4cInDatastore();
|
||||
verifyXnq9jyb4cInCloudSql();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSaveToCloudSql_succeedsEvenPreviousListNotExist() throws Exception {
|
||||
// Note that, during the dual-write phase, we just always save the revered list to
|
||||
// Cloud SQL (if --also_cloud_sql is set) without checking if there is a list with
|
||||
// same name. This is to backfill the existing list in Datastore when we update it.
|
||||
// Note that, during the dual-write phase, we always save the reserved list to Cloud SQL without
|
||||
// checking if there is a list with same name. This is to backfill the existing list in Cloud
|
||||
// Datastore when we update it.
|
||||
populateInitialReservedListInDatastore(true);
|
||||
runCommandForced(
|
||||
"--name=xn--q9jyb4c_common-reserved", "--input=" + reservedTermsPath, "--also_cloud_sql");
|
||||
runCommandForced("--name=xn--q9jyb4c_common-reserved", "--input=" + reservedTermsPath);
|
||||
verifyXnq9jyb4cInDatastore();
|
||||
assertThat(ReservedListDao.checkExists("xn--q9jyb4c_common-reserved")).isTrue();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue