Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import com.datastax.oss.driver.api.core.cql.ResultSet;
import com.datastax.oss.driver.api.core.cql.Row;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.teleport.metadata.SkipDirectRunnerTest;
import com.google.cloud.teleport.metadata.TemplateIntegrationTest;
import com.google.pubsub.v1.SubscriptionName;
import java.io.IOException;
import java.time.Duration;
Expand All @@ -40,9 +42,15 @@
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Category({TemplateIntegrationTest.class, SkipDirectRunnerTest.class})
@TemplateIntegrationTest(SpannerToSourceDb.class)
@RunWith(JUnit4.class)
public class SpannerToCassandraSourceDbMaxColumnsIT extends SpannerToSourceDbITBase {

private static final Logger LOG =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import com.datastax.oss.driver.api.core.cql.ResultSet;
import com.datastax.oss.driver.api.core.cql.Row;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.teleport.metadata.SkipDirectRunnerTest;
import com.google.cloud.teleport.metadata.TemplateIntegrationTest;
import com.google.pubsub.v1.SubscriptionName;
import java.io.IOException;
import java.time.Duration;
Expand All @@ -40,9 +42,15 @@
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Category({TemplateIntegrationTest.class, SkipDirectRunnerTest.class})
@TemplateIntegrationTest(SpannerToSourceDb.class)
@RunWith(JUnit4.class)
public class SpannerToCassandraSourceDbMaxColumnsSizeIT extends SpannerToSourceDbITBase {

private static final Logger LOG =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
@TemplateIntegrationTest(SpannerToSourceDb.class)
@RunWith(JUnit4.class)
public class SpannerToMySqlSourceDbWideRow10MbIT extends SpannerToSourceDbITBase {

private static final int MAX_ALLOWED_PACKET = 128 * 1024 * 1024; // 128 MiB
private static final Logger LOG =
LoggerFactory.getLogger(SpannerToMySqlSourceDbWideRow10MbIT.class);
private static final String SPANNER_DDL_RESOURCE =
Expand Down Expand Up @@ -91,7 +91,7 @@ public void setUp() throws IOException {
spannerMetadataResourceManager = createSpannerMetadataDatabase();

jdbcResourceManager = MySQLResourceManager.builder(testName).build();

increasePacketSize();
createMySQLSchema(
jdbcResourceManager, SpannerToMySqlSourceDbWideRow10MbIT.MYSQL_SCHEMA_FILE_RESOURCE);

Expand Down Expand Up @@ -142,6 +142,11 @@ public static void cleanUp() throws IOException {
pubsubResourceManager);
}

private void increasePacketSize() {
String allowedGlobalPacket = "SET GLOBAL max_allowed_packet = " + MAX_ALLOWED_PACKET;
jdbcResourceManager.runSQLUpdate(allowedGlobalPacket);
}

@Test
public void spannerToMYSQLSourceDB10MBTest()
throws IOException, InterruptedException, MultipleFailureException {
Expand Down Expand Up @@ -204,7 +209,7 @@ private void assertRowInMySQL() throws MultipleFailureException {
assertThat(row.get("id")).isNotNull();
assertThat(row.get("id").toString()).isNotEmpty();

Object largeBlob = row.get("large_text");
Object largeBlob = row.get("large_blob");
assertThat(largeBlob).isNotNull();
assertThat(((byte[]) largeBlob).length).isEqualTo(safeBlobSize); // 10MB

Expand Down
Loading
Loading