From cd29d051fdb1fb2bedd9f721ebdad164e060117d Mon Sep 17 00:00:00 2001 From: Rohith BCS Date: Tue, 24 Dec 2024 10:59:45 +0530 Subject: [PATCH] chore: fix bq test --- warehouse/integrations/bigquery/bigquery_test.go | 1 + warehouse/router/sync.go | 7 +++++-- warehouse/schema/schema_test.go | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/warehouse/integrations/bigquery/bigquery_test.go b/warehouse/integrations/bigquery/bigquery_test.go index 3639962c27..c3b130060b 100644 --- a/warehouse/integrations/bigquery/bigquery_test.go +++ b/warehouse/integrations/bigquery/bigquery_test.go @@ -607,6 +607,7 @@ func TestIntegration(t *testing.T) { t.Setenv("RSERVER_WAREHOUSE_BIGQUERY_ENABLE_DELETE_BY_JOBS", "true") t.Setenv("RSERVER_WAREHOUSE_BIGQUERY_MAX_PARALLEL_LOADS", "8") t.Setenv("RSERVER_WAREHOUSE_BIGQUERY_SLOW_QUERY_THRESHOLD", "0s") + t.Setenv("RSERVER_WAREHOUSE_SYNC_SCHEMA_FREQUENCY", "1s") whth.BootstrapSvc(t, workspaceConfig, httpPort, jobsDBPort) diff --git a/warehouse/router/sync.go b/warehouse/router/sync.go index 672220d343..b487c67fe6 100644 --- a/warehouse/router/sync.go +++ b/warehouse/router/sync.go @@ -5,6 +5,8 @@ import ( "fmt" "time" + warehouseutils "github.com/rudderlabs/rudder-server/warehouse/utils" + obskit "github.com/rudderlabs/rudder-observability-kit/go/labels" "github.com/rudderlabs/rudder-server/warehouse/integrations/manager" "github.com/rudderlabs/rudder-server/warehouse/internal/model" @@ -22,9 +24,10 @@ func (r *Router) syncRemoteSchema(ctx context.Context) error { return fmt.Errorf("failed to create warehouse manager: %w", err) } for _, warehouse := range warehouses { - err := whManager.Setup(ctx, warehouse, nil) + err := whManager.Setup(ctx, warehouse, warehouseutils.NewNoOpUploader()) if err != nil { - return err + r.logger.Errorn("failed to setup WH Manager", obskit.Error(err)) + continue } sh := schema.New( r.db, diff --git a/warehouse/schema/schema_test.go b/warehouse/schema/schema_test.go index ef0c22e686..1639f1c38f 100644 --- a/warehouse/schema/schema_test.go +++ b/warehouse/schema/schema_test.go @@ -26,6 +26,7 @@ func (m *mockStagingFileRepo) GetSchemasByIDs(context.Context, []int64) ([]model } return m.schemas, nil } + func TestSchema_TableSchemaDiff(t *testing.T) { testCases := []struct { name string