Skip to content

Commit

Permalink
More 7132 ports outside e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Feb 27, 2024
1 parent 796fdcc commit bf391b5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 26 deletions.
9 changes: 2 additions & 7 deletions flow/connectors/postgres/postgres_schema_delta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/jackc/pgx/v5"
"github.com/stretchr/testify/require"

"github.com/PeerDB-io/peer-flow/connectors/utils/catalog"
"github.com/PeerDB-io/peer-flow/e2eshared"
"github.com/PeerDB-io/peer-flow/generated/protos"
"github.com/PeerDB-io/peer-flow/model/qvalue"
Expand All @@ -24,13 +25,7 @@ type PostgresSchemaDeltaTestSuite struct {
func SetupSuite(t *testing.T) PostgresSchemaDeltaTestSuite {
t.Helper()

connector, err := NewPostgresConnector(context.Background(), &protos.PostgresConfig{
Host: "localhost",
Port: 7132,
User: "postgres",
Password: "postgres",
Database: "postgres",
})
connector, err := NewPostgresConnector(context.Background(), utils.GetCatalogPostgresConfigFromEnv())
require.NoError(t, err)

setupTx, err := connector.conn.Begin(context.Background())
Expand Down
11 changes: 2 additions & 9 deletions flow/connectors/postgres/qrep_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,14 @@ import (
"context"
"testing"

"github.com/PeerDB-io/peer-flow/generated/protos"
"github.com/PeerDB-io/peer-flow/connectors/utils/catalog"
)

func BenchmarkQRepQueryExecutor(b *testing.B) {
query := "SELECT * FROM bench.large_table"

ctx := context.Background()
connector, err := NewPostgresConnector(ctx,
&protos.PostgresConfig{
Host: "localhost",
Port: 7132,
User: "postgres",
Password: "postgres",
Database: "postgres",
})
connector, err := NewPostgresConnector(ctx, utils.GetCatalogPostgresConfigFromEnv())
if err != nil {
b.Fatalf("failed to create connection: %v", err)
}
Expand Down
3 changes: 2 additions & 1 deletion flow/connectors/postgres/qrep_partition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/stretchr/testify/assert"
"go.temporal.io/sdk/log"

"github.com/PeerDB-io/peer-flow/connectors/utils/catalog"
"github.com/PeerDB-io/peer-flow/generated/protos"
"github.com/PeerDB-io/peer-flow/shared"
)
Expand Down Expand Up @@ -63,7 +64,7 @@ func newTestCaseForCTID(schema string, name string, rows uint32, expectedNum int
}

func TestGetQRepPartitions(t *testing.T) {
const connStr = "postgres://postgres:postgres@localhost:7132/postgres"
connStr := utils.GetCatalogConnectionStringFromEnv()

// Setup the DB
config, err := pgx.ParseConfig(connStr)
Expand Down
11 changes: 2 additions & 9 deletions flow/connectors/postgres/qrep_query_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,13 @@ import (
"github.com/google/uuid"
"github.com/jackc/pgx/v5"

"github.com/PeerDB-io/peer-flow/generated/protos"
"github.com/PeerDB-io/peer-flow/connectors/utils/catalog"
)

func setupDB(t *testing.T) (*PostgresConnector, string) {
t.Helper()

connector, err := NewPostgresConnector(context.Background(),
&protos.PostgresConfig{
Host: "localhost",
Port: 7132,
User: "postgres",
Password: "postgres",
Database: "postgres",
})
connector, err := NewPostgresConnector(context.Background(), utils.GetCatalogPostgresConfigFromEnv())
if err != nil {
t.Fatalf("unable to create connector: %v", err)
}
Expand Down

0 comments on commit bf391b5

Please sign in to comment.