|
| 1 | +/* |
| 2 | + * Copyright (C) 2026 Google LLC |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 5 | + * use this file except in compliance with the License. You may obtain a copy of |
| 6 | + * the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | + * License for the specific language governing permissions and limitations under |
| 14 | + * the License. |
| 15 | + */ |
| 16 | +package com.google.cloud.teleport.v2.templates.loadtesting; |
| 17 | + |
| 18 | +import com.google.cloud.teleport.metadata.TemplateLoadTest; |
| 19 | +import com.google.cloud.teleport.v2.source.reader.io.jdbc.iowrapper.config.SQLDialect; |
| 20 | +import com.google.cloud.teleport.v2.templates.SourceDbToSpanner; |
| 21 | +import java.util.HashMap; |
| 22 | +import java.util.Map; |
| 23 | +import org.junit.Ignore; |
| 24 | +import org.junit.Test; |
| 25 | +import org.junit.experimental.categories.Category; |
| 26 | +import org.junit.runner.RunWith; |
| 27 | +import org.junit.runners.JUnit4; |
| 28 | + |
| 29 | +@Category(TemplateLoadTest.class) |
| 30 | +@TemplateLoadTest(SourceDbToSpanner.class) |
| 31 | +@RunWith(JUnit4.class) |
| 32 | +@Ignore("Waiting Dataflow release b/492536316") |
| 33 | +public class MySQLSourceDbtoSpannerWideRow50KBFetchSizeLT extends SourceDbToSpannerLTBase { |
| 34 | + private static final String WORKER_MACHINE_TYPE = "n2-standard-4"; |
| 35 | + private static final String LAUNCHER_MACHINE_TYPE = "n2-standard-4"; |
| 36 | + |
| 37 | + @Test |
| 38 | + public void mySQLToSpannerWideRow50KBFetchSizeTest() throws Exception { |
| 39 | + |
| 40 | + String username = |
| 41 | + accessSecret("projects/269744978479/secrets/wide-row-50kb-username/versions/1"); |
| 42 | + String password = |
| 43 | + accessSecret("projects/269744978479/secrets/wide-row-50kb-password/versions/1"); |
| 44 | + String database = "50KBRow"; |
| 45 | + String host = accessSecret("projects/269744978479/secrets/wide-row-50kb-host/versions/1"); |
| 46 | + int port = 3306; |
| 47 | + |
| 48 | + setUp(SQLDialect.MYSQL, host, port, username, password, database); |
| 49 | + createSpannerDDL("SourceDbToSpannerLT/WideRow/spanner-schema-50kb-row.sql"); |
| 50 | + |
| 51 | + Map<String, Integer> expectedCountPerTable = |
| 52 | + new HashMap<>() { |
| 53 | + { |
| 54 | + put("heavy_users", 1000000); |
| 55 | + } |
| 56 | + }; |
| 57 | + |
| 58 | + Map<String, String> params = |
| 59 | + new HashMap<>() { |
| 60 | + { |
| 61 | + put("workerMachineType", WORKER_MACHINE_TYPE); |
| 62 | + put("numPartitions", "1"); |
| 63 | + } |
| 64 | + }; |
| 65 | + |
| 66 | + Map<String, String> env = |
| 67 | + new HashMap<>() { |
| 68 | + { |
| 69 | + put("launcherMachineType", LAUNCHER_MACHINE_TYPE); |
| 70 | + } |
| 71 | + }; |
| 72 | + runLoadTest(expectedCountPerTable, params, env); |
| 73 | + } |
| 74 | +} |
0 commit comments