Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add updated coverage report #31

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,32 @@ update:; forge update
test :; forge test -vvv --no-match-contract DeploymentsGasLimits
test-contract :; forge test --match-contract ${filter} -vvv
test-watch :; forge test --watch -vvv --no-match-contract DeploymentsGasLimits
coverage :; forge coverage --report lcov && \
lcov --remove ./lcov.info -o ./lcov.info.p \
'scripts/*' \
'tests/*' \
'src/deployments/*' \
'src/periphery/contracts/v3-config-engine/*' \
'src/periphery/contracts/treasury/*' \
'src/periphery/contracts/dependencies/openzeppelin/ReentrancyGuard.sol' \
'src/periphery/contracts/misc/UiIncentiveDataProviderV3.sol' \
'src/periphery/contracts/misc/UiPoolDataProviderV3.sol' \
'src/periphery/contracts/misc/WalletBalanceProvider.sol' \
'src/periphery/contracts/mocks/*' \
'src/core/contracts/mocks/*' \
'src/core/contracts/dependencies/*' \
'src/core/contracts/misc/AaveProtocolDataProvider.sol' \
'src/core/contracts/protocol/libraries/configuration/*' \
'src/core/contracts/protocol/libraries/logic/GenericLogic.sol' \
'src/core/contracts/protocol/libraries/logic/ReserveLogic.sol' \
&& genhtml ./lcov.info.p -o report --branch-coverage \
&& coverage=$$(awk -F '[<>]' '/headerCovTableEntryHi/{print $3}' ./report/index.html | sed 's/[^0-9.]//g' | head -n 1); \
wget -O ./report/coverage.svg "https://img.shields.io/badge/coverage-$${coverage}%25-brightgreen"

# Coverage
coverage-base :; forge coverage --report lcov --no-match-coverage "(scripts|tests|deployments|mocks)"
coverage-clean :; lcov --rc derive_function_end_line=0 --remove ./lcov.info -o ./lcov.info.p \
'src/contracts/extensions/v3-config-engine/*' \
'src/contracts/treasury/*' \
'src/contracts/dependencies/openzeppelin/ReentrancyGuard.sol' \
'src/contracts/helpers/UiIncentiveDataProviderV3.sol' \
'src/contracts/helpers/UiPoolDataProviderV3.sol' \
'src/contracts/helpers/WalletBalanceProvider.sol' \
'src/contracts/dependencies/*' \
'src/contracts/helpers/AaveProtocolDataProvider.sol' \
'src/contracts/protocol/libraries/configuration/*' \
'src/contracts/protocol/libraries/logic/GenericLogic.sol' \
'src/contracts/protocol/libraries/logic/ReserveLogic.sol'
coverage-report :; genhtml ./lcov.info.p -o report --branch-coverage --rc derive_function_end_line=0 --parallel
coverage-badge :; coverage=$$(awk -F '[<>]' '/headerCovTableEntryHi/{print $3}' ./report/index.html | sed 's/[^0-9.]//g' | head -n 1); \
wget -O ./report/coverage.svg "https://img.shields.io/badge/coverage-$${coverage}%25-brightgreen"
coverage :
make coverage-base
make coverage-clean
make coverage-report
make coverage-badge
# Utilities
download :; cast etherscan-source --chain ${chain} -d src/etherscan/${chain}_${address} ${address}
git-diff :
@mkdir -p diffs
@npx prettier ${before} ${after} --write
@printf '%s\n%s\n%s\n' "\`\`\`diff" "$$(git diff --no-index --ignore-space-at-eol ${before} ${after})" "\`\`\`" > diffs/${out}.md

2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ script = 'scripts'
optimizer = true
optimizer_runs = 200
solc = '0.8.20'
evm_version = 'paris'
evm_version = 'shanghai'
bytecode_hash = 'none'
ignored_warnings_from = ["src/periphery/contracts/treasury/RevenueSplitter.sol"]
out = 'out'
Expand Down
2 changes: 1 addition & 1 deletion report/cmd_line
Original file line number Diff line number Diff line change
@@ -1 +1 @@
genhtml ./lcov.info.p -o report --branch-coverage
genhtml ./lcov.info.p -o report --branch-coverage --rc derive_function_end_line=0 --parallel

This file was deleted.

Loading