diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..46fbe7b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,32 @@ +name: Build and Test + +on: + push: + branches: + - main + - develop + pull_request: + branches: + - "**" + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + go-version: [ 1.22.x ] + os: [ ubuntu-latest ] + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + + - name: Build + run: go build ./... + + - name: Run Tests + run: go test -v ./... diff --git a/db/operations_test.go b/db/operations_test.go index 7fde5b0..6d0f49c 100644 --- a/db/operations_test.go +++ b/db/operations_test.go @@ -19,7 +19,7 @@ func TestEscapeColumns(t *testing.T) { t.Skip(`PG_DSN not set, please specify PG_DSN to run this test, example: PG_DSN="psql://dev-node:insecure-change-me-in-prod@localhost:5432/dev-node?enable_incremental_sort=off&sslmode=disable"`) } - dbLoader, err := NewLoader(dsn, 0, OnModuleHashMismatchIgnore, nil, zlog, tracer) + dbLoader, err := NewLoader(dsn, 1, 1, 1, "cursors", OnModuleHashMismatchIgnore, nil, zlog, tracer) require.NoError(t, err) tx, err := dbLoader.DB.Begin() @@ -68,7 +68,7 @@ func TestEscapeValues(t *testing.T) { t.Skip(`PG_DSN not set, please specify PG_DSN to run this test, example: PG_DSN="psql://dev-node:insecure-change-me-in-prod@localhost:5432/dev-node?enable_incremental_sort=off&sslmode=disable"`) } - dbLoader, err := NewLoader(dsn, 0, OnModuleHashMismatchIgnore, nil, zlog, tracer) + dbLoader, err := NewLoader(dsn, 1, 1, 1, "cursors", OnModuleHashMismatchIgnore, nil, zlog, tracer) require.NoError(t, err) tx, err := dbLoader.DB.Begin() diff --git a/db/testing.go b/db/testing.go index f96db5f..83ba6f5 100644 --- a/db/testing.go +++ b/db/testing.go @@ -15,7 +15,7 @@ func NewTestLoader( tables map[string]*TableInfo, ) (*Loader, *TestTx) { - loader, err := NewLoader("psql://x:5432/x", 0, 0, 0, "cursors", OnModuleHashMismatchIgnore, nil, zlog, tracer) + loader, err := NewLoader("psql://x:5432/x", 1, 1, 1, "cursors", OnModuleHashMismatchIgnore, nil, zlog, tracer) if err != nil { panic(err) } diff --git a/sinker/sinker_test.go b/sinker/sinker_test.go index a60459e..0564206 100644 --- a/sinker/sinker_test.go +++ b/sinker/sinker_test.go @@ -214,7 +214,7 @@ func TestInserts(t *testing.T) { "testschema", db.TestTables("testschema"), ) - s, err := sink.New(sink.SubstreamsModeDevelopment, testPackage, testPackage.Modules.Modules[0], []byte("unused"), testClientConfig, logger, nil) + s, err := sink.New(sink.SubstreamsModeDevelopment, false, testPackage, testPackage.Modules.Modules[0], []byte("unused"), testClientConfig, logger, nil) require.NoError(t, err) sinker, _ := New(s, l, logger, nil)