Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ concurrency:
jobs:
Lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: rpc
steps:

- name: Check out code
Expand All @@ -32,17 +35,21 @@ jobs:
uses: golangci/golangci-lint-action@v8
with:
version: latest
working-directory: rpc

Unit-Test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: rpc
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache-dependency-path: 'go.sum'
cache-dependency-path: 'rpc/go.sum'

- name: Setup Protobuf
uses: ./.github/actions/setup-protobuf
Expand All @@ -60,17 +67,15 @@ jobs:

- name: gRPC Golang Tests
run: |
cd gRPC_sinks
go generate ./sinks/pb
go test -timeout 20m -failfast -v -coverprofile=profile.cov ./...

- name: gRPC Python Tests
run: |
cd gRPC_sinks
python3 -m grpc_tools.protoc -I sinks/pb --python_out=cmd/pyiceberg_receiver --grpc_python_out=cmd/pyiceberg_receiver sinks/pb/pgwatch.proto
pytest

- name: Coveralls
uses: coverallsapp/github-action@v2
with:
file: profile.cov
file: rpc/profile.cov
9 changes: 5 additions & 4 deletions rpc/cmd/gcp_pubsub_receiver/pubsub_receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,17 @@ func TestPubsubReceiver(t *testing.T) {
a.NotNil(psr)

t.Run("Test Pub/Sub Receiver UpdateMeasurements()", func(t *testing.T) {
// To read the published message from the Pub/Sub server.
sub, err := CreateSubscription(psr)
a.NoError(err)

msg := testutils.GetTestMeasurementEnvelope()
reply, err := psr.UpdateMeasurements(context.Background(), msg)
psr.publisher.Flush()

a.NoError(err)
a.Equal(reply.GetLogmsg(), "Message published.")

// Try read the published message from the Pub/Sub server.
sub, err := CreateSubscription(psr)
a.NoError(err)

ctx, cancel := context.WithCancel(context.Background())
err = sub.Receive(ctx, func(ctx context.Context, m *pubsub.Message) {
var recvd_msg map[string]any
Expand Down
4 changes: 2 additions & 2 deletions rpc/cmd/llama_receiver/llama_receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func TestLLamaReceiver(t *testing.T) {
})

t.Run("Update Measurements Multiple", func(t *testing.T) {
for range 10 {
for range 3 {
_, err := recv.UpdateMeasurements(ctx, msg)
assert.NoError(t, err, "error encountered while updating measurements")
}
Expand All @@ -151,7 +151,7 @@ func TestLLamaReceiver(t *testing.T) {
err := conn.QueryRow(recv.Ctx, "SELECT COUNT(*) FROM insights;").Scan(&newInsightsCount)

assert.NoError(t, err)
assert.Greater(t, newInsightsCount, 1, "No new entries inserted in insights table")
assert.GreaterOrEqual(t, newInsightsCount, 1, "No new entries inserted in insights table")
})

t.Run("LLama SyncMetricHandler", func(t *testing.T) {
Expand Down
Loading