Skip to content

Commit

Permalink
chore: tests coverage (#3349)
Browse files Browse the repository at this point in the history
  • Loading branch information
achettyiitr authored May 19, 2023
1 parent 6fd8552 commit d3a5b02
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ jobs:
SNOWFLAKE_RBAC_INTEGRATION_TEST_CREDENTIALS: ${{ secrets.SNOWFLAKE_RBAC_INTEGRATION_TEST_CREDENTIALS }}
RSERVER_WAREHOUSE_POSTGRES_USE_LEGACY: ${{ matrix.useLegacy }}
RSERVER_WAREHOUSE_DELTALAKE_USE_NATIVE: ${{ matrix.useNative }}
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.destination }}
path: coverage.txt

unit:
name: Unit
Expand All @@ -117,6 +122,30 @@ jobs:
TEST_S3_DATALAKE_CREDENTIALS: ${{ secrets.TEST_S3_DATALAKE_CREDENTIALS }}
BIGQUERY_INTEGRATION_TEST_CREDENTIALS: ${{ secrets.BIGQUERY_INTEGRATION_TEST_CREDENTIALS }}
run: make test
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: unit
path: coverage.txt

coverage:
needs: [warehouse-integration, unit]
runs-on: 'ubuntu-20.04'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '~1.20.3'
check-latest: true
- name: Download coverage reports
uses: actions/download-artifact@v3
- name: Merge Coverage
run: |
go install github.com/wadey/gocovmerge@latest
gocovmerge */coverage.txt > coverage.txt
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: ./coverage.txt
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ test: install-tools test-run test-teardown
test-run: ## Run all unit tests
ifeq ($(filter 1,$(debug) $(RUNNER_DEBUG)),)
$(eval TEST_CMD = SLOW=0 gotestsum --format pkgname-and-test-fails --)
$(eval TEST_OPTIONS = -p=1 -v -failfast -shuffle=on -coverprofile=profile.out -covermode=count -coverpkg=./... -vet=all --timeout=15m)
$(eval TEST_OPTIONS = -p=1 -v -failfast -shuffle=on -coverprofile=profile.out -covermode=atomic -coverpkg=./... -vet=all --timeout=15m)
else
$(eval TEST_CMD = SLOW=0 go test)
$(eval TEST_OPTIONS = -p=1 -v -failfast -shuffle=on -coverprofile=profile.out -covermode=count -coverpkg=./... -vet=all --timeout=15m)
$(eval TEST_OPTIONS = -p=1 -v -failfast -shuffle=on -coverprofile=profile.out -covermode=atomic -coverpkg=./... -vet=all --timeout=15m)
endif
ifdef package
$(TEST_CMD) $(TEST_OPTIONS) $(package) && touch $(TESTFILE) || true
Expand Down

0 comments on commit d3a5b02

Please sign in to comment.