Skip to content

Commit

Permalink
setup mysql source, skip when test relies on Connector
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Jan 9, 2025
1 parent 1c82250 commit ae4257a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion flow/e2e/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ func (s ClickHouseSuite) T() *testing.T {
}

func (s ClickHouseSuite) Connector() *connpostgres.PostgresConnector {
return s.source.Connector().(*connpostgres.PostgresConnector)
c, ok := s.source.Connector().(*connpostgres.PostgresConnector)
if !ok {
s.t.Skip(fmt.Sprintf("skipping test because it relies on PostgresConnector, while source is %T", s.source))

Check failure on line 40 in flow/e2e/clickhouse/clickhouse.go

View workflow job for this annotation

GitHub Actions / lint

S1038: should use s.t.Skipf(...) instead of s.t.Skip(fmt.Sprintf(...)) (gosimple)
}
return c
}

func (s ClickHouseSuite) DestinationConnector() connectors.Connector {
Expand Down
2 changes: 1 addition & 1 deletion flow/e2e/clickhouse/peer_flow_ch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestPeerFlowE2ETestSuitePG_CH(t *testing.T) {
}

func TestPeerFlowE2ETestSuiteMySQL_CH(t *testing.T) {
// TODO e2eshared.RunSuite(t, SetupSuite(t, e2e.SetupMySQL))
e2eshared.RunSuite(t, SetupSuite(t, e2e.SetupMySQL))
}

func (s ClickHouseSuite) attachSchemaSuffix(tableName string) string {
Expand Down
4 changes: 2 additions & 2 deletions flow/e2e/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var mysqlConfig = &protos.MySqlConfig{
Port: 3306,
User: "root",
Password: "maria",
Database: "default",
Database: "",
Setup: nil,
Compression: 0,
DisableTls: true,
Expand Down Expand Up @@ -62,7 +62,7 @@ func (s *MySqlSource) Teardown(t *testing.T, suffix string) {
func (s *MySqlSource) GeneratePeer(t *testing.T) *protos.Peer {
t.Helper()
peer := &protos.Peer{
Name: "catalog",
Name: "mysql",
Type: protos.DBType_MYSQL,
Config: &protos.Peer_MysqlConfig{
MysqlConfig: mysqlConfig,
Expand Down

0 comments on commit ae4257a

Please sign in to comment.