Skip to content

Commit

Permalink
pass field names
Browse files Browse the repository at this point in the history
  • Loading branch information
pankaj-peerdb committed Feb 10, 2024
1 parent 5c42f83 commit 0965ca1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions flow/e2e/clickhouse/qrep_flow_ch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ import (
)

//nolint:unparam
func (s PeerFlowE2ETestSuiteCH) setupSourceTable(tableName string, numRows int) {
fieldNames := []string{"id", "ownerable_type", "created_at", "updated_at"}
func (s PeerFlowE2ETestSuiteCH) setupSourceTable(tableName string, numRows int, fieldNames []string) {
err := e2e.CreateTableForQRepNew(s.conn, s.pgSuffix, tableName, fieldNames)
fmt.Printf("\n**************************** setupSourceTable created")
require.NoError(s.t, err)
err = e2e.PopulateSourceTableNew(s.conn, s.pgSuffix, tableName, numRows, fieldNames)
require.NoError(s.t, err)
}

func (s PeerFlowE2ETestSuiteCH) setupCHDestinationTable(dstTable string) {
fieldNames := []string{"id", "ownerable_type", "created_at", "updated_at"}

func (s PeerFlowE2ETestSuiteCH) setupCHDestinationTable(dstTable string, fieldNames []string) {
schema := e2e.GetOwnersSchemaNew(fieldNames)
//TODO: write your own table creation logic for ch or modify the one in chHelper()
err := s.chHelper.CreateTable(dstTable, schema)
Expand Down Expand Up @@ -152,8 +149,8 @@ func (s PeerFlowE2ETestSuiteCH) Test_Complete_QRep_Flow_Avro_CH_S3() {
numRows := 10

tblName := "test_qrep_flow_avro_ch_s3"
s.setupSourceTable(tblName, numRows)
s.setupCHDestinationTable(tblName) //As currently qrep doesnot create destination table on its own
s.setupSourceTable(tblName, numRows, fieldNames)
s.setupCHDestinationTable(tblName, fieldNames) //As currently qrep doesnot create destination table on its own
fmt.Printf("\n*********************************............Test_Complete_QRep_Flow_Avro_CH_S3 1 setupSourceTable done\n")

dstSchemaQualified := fmt.Sprintf("%s.%s", s.chHelper.testSchemaName, tblName)
Expand Down

0 comments on commit 0965ca1

Please sign in to comment.