Skip to content

Commit

Permalink
Merge pull request #19 from pinax-network/fix/tests_actions
Browse files Browse the repository at this point in the history
add Github action, fix test cases
  • Loading branch information
fschoell authored Aug 29, 2024
2 parents 02ce807 + 66978ee commit 0c1d7b3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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 ./...
4 changes: 2 additions & 2 deletions db/operations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion db/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion sinker/sinker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 0c1d7b3

Please sign in to comment.