Skip to content

Commit

Permalink
tune coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalyisaev2 committed Dec 29, 2023
1 parent ee3938a commit 28239d0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ jobs:
./fq-connector-go-tests -projectPath=$(pwd) -test.coverprofile=coverage_integratoin_tests.out
- name: Union coverage
run: |
cat coverage* | grep -v pb.go | grep -v mock.go > coverage.out
cat coverage_unit_tests.out | grep -v 'pb.go\|mock.go\|library' > coverage.out
cat coverage_integration_tests.out | grep -v 'atomic\|pb.go\|mock.go\|library' >> coverage.out
go tool cover -func=coverage.out
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4-beta
with:
Expand Down
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
PROJECT_PATH = $(shell pwd)

build:
go build -o fq-connector-go ./app

Expand All @@ -10,14 +12,21 @@ lint:
unit_test:
go test -v ./app/...

PROJECT_PATH = $(shell pwd)
integration_test: integration_test_clean
docker-compose -f ./tests/infra/datasource/docker-compose.yaml up -d
integration_test: integration_test_env
go test -c -o fq-connector-go-tests ./tests
./fq-connector-go-tests -projectPath=$(PROJECT_PATH)

integration_test_clean:
integration_test_env:
docker-compose -f ./tests/infra/datasource/docker-compose.yaml rm -f -v
docker-compose -f ./tests/infra/datasource/docker-compose.yaml up -d

test_coverage: integration_test_env
go test -coverpkg=./... -coverprofile=coverage_unit_tests.out -covermode=atomic ./app/...
go test -c -o fq-connector-go-tests -coverpkg=./... -covermode=atomic ./tests
./fq-connector-go-tests -projectPath=$(PROJECT_PATH) -test.coverprofile=coverage_integration_tests.out
cat coverage_unit_tests.out | grep -v 'pb.go\|mock.go\|library' > coverage.out
cat coverage_integration_tests.out | grep -v 'atomic\|pb.go\|mock.go\|library' >> coverage.out
go tool cover -func=coverage.out

build_image_base:
docker build -t ghcr.io/ydb-platform/fq-connector-go:base -f ./Dockerfile.base .
1 change: 0 additions & 1 deletion app/server/streaming/streamer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ func (tc testCaseStreaming) messageParams() (sentMessages, rowsInLastMessage int

func (tc testCaseStreaming) execute(t *testing.T) {
logger := utils.NewTestLogger(t)
request := &api_service_protos.TReadSplitsRequest{}
split := utils.MakeTestSplit()

ctx, cancel := context.WithCancel(context.Background())
Expand Down

0 comments on commit 28239d0

Please sign in to comment.