switch to codecov-action@v3 for uploading code coverage (#334)

This commit is contained in:
Dmitry Holodov
2023-02-28 08:22:45 -06:00
committed by GitHub
parent b097cbbba4
commit 250a041703
5 changed files with 18 additions and 8 deletions

View File

@@ -61,5 +61,8 @@ jobs:
ETH_MAINNET_ENDPOINT: ${{ secrets.ETH_MAINNET_ENDPOINT }}
run: ./scripts/run-unit-tests.sh
- name: Run coverage
run: bash <(curl -s https://codecov.io/bash)
- name: Upload code coverage
uses: codecov/codecov-action@v3
with:
verbose: true
fail_ci_if_error: true

2
.gitignore vendored
View File

@@ -16,7 +16,7 @@
*.test
# Output of the go coverage tool
/coverage.out
/coverage.txt
/coverage.html
# Logs from make targets

7
codecov.yml Normal file
View File

@@ -0,0 +1,7 @@
# Don't calculate code coverage percentages on generated abigen files
ignore:
- ethereum/swap_factory.go
- ethereum/aggregator_v3_interface.go
- ethereum/erc20_mock.go
- ethereum/ierc20.go
- ethereum/block/ut_contract_test.go

View File

@@ -10,12 +10,12 @@ start-ganache
# run unit tests
echo "running unit tests..."
rm -f coverage.out
go test ./... -v -short -timeout=30m -count=1 -covermode=atomic -coverprofile=coverage.out
rm -f coverage.txt
go test ./... -v -short -timeout=30m -count=1 -covermode=atomic -coverprofile=coverage.txt
OK=$?
if [[ -e coverage.out ]]; then
go tool cover -html=coverage.out -o coverage.html
if [[ -e coverage.txt ]]; then
go tool cover -html=coverage.txt -o coverage.html
fi
stop-monerod-regtest

View File

@@ -560,7 +560,7 @@ func (s *IntegrationTestSuite) testAbortXMRTakerCancels(asset types.EthAsset) {
// namespace (the namespace for swapd hosts providing XMR offers). We need
// to wait a little extra before Alice calls Discover to ensure that the
// advertisement went out.
common.SleepWithContext(ctx, time.Millisecond*500)
common.SleepWithContext(ctx, time.Second)
peerIDs, err := ac.Discover(string(coins.ProvidesXMR), defaultDiscoverTimeout)
require.NoError(s.T(), err)