Skip to content

Commit

Permalink
feat: kafka client and containers (#287)
Browse files Browse the repository at this point in the history
Co-authored-by: Akash Chetty <[email protected]>
  • Loading branch information
fracasula and achettyiitr authored Jan 30, 2024
1 parent 7385e0d commit 00cba9d
Show file tree
Hide file tree
Showing 53 changed files with 3,774 additions and 82 deletions.
35 changes: 33 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,36 @@ jobs:

- run: go version
- run: go mod download # Not required, used to segregate module download vs test times
- run: make test
- uses: codecov/codecov-action@v2
- run: make test exclude="(kafkaclient|testhelper)"
- uses: codecov/codecov-action@v3
test-package:
name: Test package
runs-on: 'ubuntu-20.04'
strategy:
fail-fast: false
matrix:
package:
- kafkaclient
- testhelper
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '~1.21'
check-latest: true
- run: go version
- run: go mod download
- name: Test package [ ${{ matrix.package }} ]
env:
TEST_KAFKA_CONFLUENT_CLOUD_HOST: ${{ secrets.TEST_KAFKA_CONFLUENT_CLOUD_HOST }}
TEST_KAFKA_CONFLUENT_CLOUD_KEY: ${{ secrets.TEST_KAFKA_CONFLUENT_CLOUD_KEY }}
TEST_KAFKA_CONFLUENT_CLOUD_SECRET: ${{ secrets.TEST_KAFKA_CONFLUENT_CLOUD_SECRET }}
TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_HOST: ${{ secrets.TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_HOST }}
TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_EVENTHUB_NAME: ${{ secrets.TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_EVENTHUB_NAME }}
TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_CONNECTION_STRING: ${{ secrets.TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_CONNECTION_STRING }}
run: make test exclude="${{ matrix.exclude }}" package=${{ matrix.package }}
- name: Sanitize name for Artifact
run: |
name=$(echo -n "${{ matrix.package }}" | sed -e 's/[ \t:\/\\"<>|*?]/-/g' -e 's/--*/-/g')
echo "ARTIFACT_NAME=$name" >> $GITHUB_ENV
- uses: codecov/codecov-action@v3
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ else
$(eval TEST_OPTIONS = -p=1 -v -failfast -shuffle=on -coverprofile=profile.out -covermode=count -coverpkg=./... -vet=all --timeout=15m)
endif
ifdef package
$(TEST_CMD) $(TEST_OPTIONS) $(package) && touch $(TESTFILE) || true
ifdef exclude
$(eval FILES = `go list ./$(package)/... | egrep -iv '$(exclude)'`)
$(TEST_CMD) -count=1 $(TEST_OPTIONS) $(FILES) && touch $(TESTFILE) || true
else
$(TEST_CMD) $(TEST_OPTIONS) ./$(package)/... && touch $(TESTFILE) || true
endif
else ifdef exclude
$(eval FILES = `go list ./... | egrep -iv '$(exclude)'`)
$(TEST_CMD) -count=1 $(TEST_OPTIONS) $(FILES) && touch $(TESTFILE) || true
else
$(TEST_CMD) -count=1 $(TEST_OPTIONS) ./... && touch $(TESTFILE) || true
endif
Expand Down
17 changes: 16 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@ require (
github.com/Azure/azure-storage-blob-go v0.15.0
github.com/aws/aws-sdk-go v1.49.24
github.com/cenkalti/backoff/v4 v4.2.1
github.com/confluentinc/confluent-kafka-go/v2 v2.3.0
github.com/fsnotify/fsnotify v1.7.0
github.com/go-chi/chi/v5 v5.0.11
github.com/go-redis/redis/v8 v8.11.5
github.com/golang/mock v1.6.0
github.com/joho/godotenv v1.5.1
github.com/json-iterator/go v1.1.12
github.com/lib/pq v1.10.9
github.com/linkedin/goavro/v2 v2.11.1
github.com/melbahja/goph v1.4.0
github.com/minio/minio-go/v7 v7.0.66
github.com/ory/dockertest/v3 v3.10.0
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5
github.com/prometheus/client_golang v1.18.0
github.com/prometheus/client_model v0.5.0
github.com/prometheus/common v0.46.0
github.com/samber/lo v1.39.0
github.com/segmentio/kafka-go v0.4.47
github.com/shirou/gopsutil/v3 v3.23.12
github.com/spf13/cast v1.6.0
github.com/spf13/viper v1.18.2
Expand All @@ -47,7 +51,18 @@ require (
)

require (
github.com/actgardner/gogen-avro/v10 v10.2.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/heetch/avro v0.4.4 // indirect
github.com/kr/fs v0.1.0 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/pierrec/lz4/v4 v4.1.17 // indirect
github.com/pkg/sftp v1.13.6 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect
)
Expand Down Expand Up @@ -125,7 +140,7 @@ require (
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/crypto v0.18.0
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
Expand Down
Loading

0 comments on commit 00cba9d

Please sign in to comment.