Skip to content

Commit

Permalink
Fix Codecov and add integration tests coverage (#1020)
Browse files Browse the repository at this point in the history
* add : gocovmerge support

* fix : minor fix

* add : dependancy for codecov

* fix : dependancy

* fix : codecov upload/download artifact

* fix : fix unable to find cover.out file

* fix : rename integration_cover.out

* chg : codecov-action from v1 to v3
  • Loading branch information
0xsharma authored Oct 13, 2023
1 parent a5d53af commit db1562b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ jobs:

- name: Test
run: make test

- uses: actions/upload-artifact@v2
with:
name: unitTest-coverage
path: cover.out

#- name: Data race tests
# run: make test-race
Expand Down Expand Up @@ -153,17 +158,25 @@ jobs:
- name: test-integration
run: make test-integration

- uses: actions/upload-artifact@v2
with:
name: integrationTest-coverage
path: cover.out

codecov:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy:
matrix:
os: [ ubuntu-20.04 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}
needs: [unit-tests, integration-tests]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./cover.out
uses: codecov/codecov-action@v3

e2e-tests:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ test-txpool-race:

test-race:
$(GOTEST) --timeout 15m -race -shuffle=on $(TESTALL)

gocovmerge-deps:
$(GOBUILD) -o $(GOBIN)/gocovmerge github.com/wadey/gocovmerge

test-integration:
$(GOTEST) --timeout 60m -tags integration $(TESTE2E)
$(GOTEST) --timeout 60m -cover -coverprofile=cover.out -covermode=atomic -tags integration $(TESTE2E)

escape:
cd $(path) && go test -gcflags "-m -m" -run none -bench=BenchmarkJumpdest* -benchmem -memprofile mem.out
Expand Down

0 comments on commit db1562b

Please sign in to comment.