Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hotfix] Remove broken MySQL incremental sources used in tests #3792

Merged
merged 1 commit into from
Dec 12, 2024
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
3 changes: 2 additions & 1 deletion .github/workflows/flink_cdc_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ env:
flink-cdc-cli,\
flink-cdc-common,\
flink-cdc-composer,\
flink-cdc-runtime"
flink-cdc-runtime,\
flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base"

MODULES_PIPELINE_CONNECTORS: "\
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-values,\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
package org.apache.flink.cdc.connectors.base;

import org.apache.flink.cdc.connectors.base.config.JdbcSourceConfig;
import org.apache.flink.cdc.connectors.base.experimental.MysqlPooledDataSourceFactory;
import org.apache.flink.cdc.connectors.base.experimental.config.MySqlSourceConfig;
import org.apache.flink.cdc.connectors.base.mocked.MockedPooledDataSourceFactory;
import org.apache.flink.cdc.connectors.base.mocked.MockedSourceConfig;
import org.apache.flink.cdc.connectors.base.options.StartupOptions;
import org.apache.flink.cdc.connectors.base.relational.connection.ConnectionPoolId;
import org.apache.flink.cdc.connectors.base.relational.connection.JdbcConnectionPoolFactory;
Expand All @@ -34,7 +34,7 @@
import java.util.Properties;

/** Tests for {@link JdbcConnectionPools}. */
public class JdbcConnectionPoolTest {
public class GenericConnectionPoolTest {
public static final String HOSTNAME = "localhost";
public static final int PORT = 3306;

Expand All @@ -48,13 +48,13 @@ public class JdbcConnectionPoolTest {
@Test
public void testMultiConnectionPoolFactory() {
MockConnectionPoolFactory mockConnectionPoolFactory = new MockConnectionPoolFactory();
MysqlPooledDataSourceFactory mysqlPooledDataSourceFactory =
new MysqlPooledDataSourceFactory();
MockedPooledDataSourceFactory genericPooledDataSourceFactory =
new MockedPooledDataSourceFactory();
JdbcConnectionPools mockInstance =
JdbcConnectionPools.getInstance(mockConnectionPoolFactory);
JdbcConnectionPools mysqlInstance =
JdbcConnectionPools.getInstance(mysqlPooledDataSourceFactory);
MySqlSourceConfig mySqlSourceConfig =
JdbcConnectionPools.getInstance(genericPooledDataSourceFactory);
MockedSourceConfig mySqlSourceConfig =
getMockMySqlSourceConfig(HOSTNAME, PORT, USER_NAME, PASSWORD, DATABASE, TABLE);

Assert.assertEquals(
Expand All @@ -63,21 +63,21 @@ public void testMultiConnectionPoolFactory() {
mockConnectionPoolFactory.getJdbcUrl(mySqlSourceConfig));
Assert.assertEquals(
mysqlInstance.getJdbcUrl(
mySqlSourceConfig, mysqlPooledDataSourceFactory.getClass().getName()),
mysqlPooledDataSourceFactory.getJdbcUrl(mySqlSourceConfig));
mySqlSourceConfig, genericPooledDataSourceFactory.getClass().getName()),
genericPooledDataSourceFactory.getJdbcUrl(mySqlSourceConfig));
Assert.assertNotEquals(
mysqlInstance.getJdbcUrl(
mySqlSourceConfig, mysqlPooledDataSourceFactory.getClass().getName()),
mySqlSourceConfig, genericPooledDataSourceFactory.getClass().getName()),
mockConnectionPoolFactory.getJdbcUrl(mySqlSourceConfig));
}

@Test
public void testNoDataSourcePoolFactoryIdentifier() {
MysqlPooledDataSourceFactory mysqlPooledDataSourceFactory =
new MysqlPooledDataSourceFactory();
MockedPooledDataSourceFactory mysqlPooledDataSourceFactory =
new MockedPooledDataSourceFactory();
JdbcConnectionPools mysqlInstance =
JdbcConnectionPools.getInstance(mysqlPooledDataSourceFactory);
MySqlSourceConfig mySqlSourceConfig =
MockedSourceConfig mySqlSourceConfig =
getMockMySqlSourceConfig(HOSTNAME, PORT, USER_NAME, PASSWORD, DATABASE, TABLE);
ConnectionPoolId poolId =
new ConnectionPoolId(
Expand All @@ -94,14 +94,14 @@ public void testNoDataSourcePoolFactoryIdentifier() {
() -> mysqlInstance.getOrCreateConnectionPool(poolId, mySqlSourceConfig));
}

private static MySqlSourceConfig getMockMySqlSourceConfig(
private static MockedSourceConfig getMockMySqlSourceConfig(
String hostname,
int port,
String username,
String password,
String database,
String table) {
return new MySqlSourceConfig(
return new MockedSourceConfig(
StartupOptions.latest(),
Arrays.asList(database),
Arrays.asList(table),
Expand Down

This file was deleted.

Loading
Loading