Skip to content

Commit

Permalink
fix: disables pitr-lite tests in emulator
Browse files Browse the repository at this point in the history
The feature is not supported in the emulator currently.
  • Loading branch information
thiagotnunes committed Sep 29, 2020
1 parent e20cf0e commit c146253
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Expand Up @@ -16,8 +16,10 @@

package com.google.cloud.spanner.it;

import static com.google.cloud.spanner.testing.EmulatorSpannerHelper.isUsingEmulator;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeFalse;

import com.google.cloud.spanner.Database;
import com.google.cloud.spanner.DatabaseAdminClient;
Expand All @@ -34,6 +36,7 @@
import java.util.concurrent.TimeUnit;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
Expand All @@ -53,6 +56,11 @@ public class ITPitrCreateDatabaseTest {
private DatabaseAdminClient dbAdminClient;
private List<Database> databasesToDrop;

@BeforeClass
public static void doNotRunOnEmulator() {
assumeFalse("PITR-lite features are not supported by the emulator", isUsingEmulator());
}

@Before
public void setUp() {
testHelper = env.getTestHelper();
Expand Down
Expand Up @@ -16,8 +16,10 @@

package com.google.cloud.spanner.it;

import static com.google.cloud.spanner.testing.EmulatorSpannerHelper.isUsingEmulator;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeFalse;

import com.google.api.gax.paging.Page;
import com.google.cloud.spanner.Database;
Expand Down Expand Up @@ -58,6 +60,8 @@ public class ITPitrUpdateDatabaseTest {

@BeforeClass
public static void setUp() throws Exception {
assumeFalse("PITR-lite features are not supported by the emulator", isUsingEmulator());

final RemoteSpannerHelper testHelper = env.getTestHelper();
final String projectId = testHelper.getOptions().getProjectId();
instanceId = testHelper.getInstanceId().getInstance();
Expand All @@ -73,7 +77,9 @@ public static void setUp() throws Exception {

@AfterClass
public static void tearDown() {
dbAdminClient.dropDatabase(instanceId, databaseId);
if (!isUsingEmulator()) {
dbAdminClient.dropDatabase(instanceId, databaseId);
}
}

@Test
Expand Down

0 comments on commit c146253

Please sign in to comment.