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

Improve test coverage action [@coderabbit ignore] #790

Closed
wants to merge 40 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e4c5947
Add Permit2Proxy
ezynda3 Aug 22, 2024
797e772
Add Permit2Proxy
ezynda3 Aug 22, 2024
48b9703
forge install: Permit2
ezynda3 Aug 22, 2024
9795b16
Get basic test working...
ezynda3 Aug 23, 2024
745c5c7
Add more basic tests
ezynda3 Aug 26, 2024
e186436
Remove superfluous receiver param
ezynda3 Aug 26, 2024
143d4c2
Add utility method for getting a valid and working msgHash to sign
ezynda3 Aug 26, 2024
779bd8b
Change name to be more specific
ezynda3 Aug 26, 2024
f36a67e
Add Permit "v1" functionality
ezynda3 Aug 26, 2024
48de477
Add Permit "v1" tests
ezynda3 Aug 26, 2024
d119ca9
Add missing comments
ezynda3 Aug 26, 2024
484c918
Flesh out demo script
ezynda3 Aug 26, 2024
f582cbc
Finish demo script
ezynda3 Aug 27, 2024
9785369
Cleanup and comments
ezynda3 Aug 27, 2024
4cd03e0
Fix log
ezynda3 Aug 27, 2024
f18dab6
Remove extra files
ezynda3 Aug 27, 2024
0eaa7c8
Remove extra remapping
ezynda3 Aug 27, 2024
a3e6f5d
Remove unneeded lib
ezynda3 Aug 27, 2024
cfd1977
Add official Permit2 addresses
ezynda3 Aug 27, 2024
db2f0ff
Merge branch 'main' into gasless-revisited
ezynda3 Aug 28, 2024
e7395b2
Allow only signer to call using EIP2612
ezynda3 Aug 29, 2024
8364ac7
Merge branch 'gasless-revisited' of github.com:lifinance/contracts in…
ezynda3 Aug 29, 2024
5d772b0
Bind Permit2Proxy to a single diamond
ezynda3 Aug 29, 2024
2f8e953
Update deploy script
ezynda3 Aug 29, 2024
3d39c31
Implement non-gasless Permit2 flow
ezynda3 Aug 29, 2024
af38e51
Redeploy to staging and update demo script
ezynda3 Aug 29, 2024
056a8c2
Update comments and remove unneeded events/errors
ezynda3 Aug 30, 2024
1755f86
Add utility methods for determining the next valid nonce
ezynda3 Aug 30, 2024
17e5da3
Redeploy and update demo script
ezynda3 Aug 30, 2024
476ba04
Add documentation
ezynda3 Aug 30, 2024
10b6204
Fixes
ezynda3 Sep 2, 2024
f5f566d
Change witness type to be consistent with the rest of the codebase
ezynda3 Sep 3, 2024
be50801
Remove unneeded whitelist
ezynda3 Sep 3, 2024
e40f49a
Merge branch 'main' of github.com:lifinance/contracts into gasless-re…
0xDEnYO Sep 6, 2024
2202a50
test
0xDEnYO Sep 6, 2024
6f86400
test
0xDEnYO Sep 6, 2024
1aa3287
test
0xDEnYO Sep 6, 2024
c75b982
test
0xDEnYO Sep 6, 2024
b27f938
test
0xDEnYO Sep 6, 2024
26fa4ea
test
0xDEnYO Sep 6, 2024
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
Prev Previous commit
Next Next commit
test
  • Loading branch information
0xDEnYO committed Sep 6, 2024
commit c75b982d6cd2f7af7ec514adc2ef4fde0a79bb82
25 changes: 7 additions & 18 deletions .github/workflows/enforceTestCoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,15 @@ jobs:
esac

# Check if the file is in the list of modified files
if [[ " ${MODIFIED_FILES[@]} " =~ "$FILE_NAME" ]]; then
if [[ " ${MODIFIED_FILES[@]} " =~ " $FILE_NAME " ]]; then
# Calculate line coverage percentage for the current file
LINE_COVERAGE_PERCENTAGE=$(echo "scale=2; $FILE_LINES_HIT / $FILE_LINES_FOUND * 100" | bc)
FILE_COVERAGE_SUMMARY["$FILE_NAME"]="File: $FILE_NAME - Line Coverage: $LINE_COVERAGE_PERCENTAGE% ($FILE_LINES_HIT / $FILE_LINES_FOUND)"

# Sanitize file name to prevent any potential issues with bad subscripts
FILE_NAME_CLEAN=$(echo "$FILE_NAME" | tr -cd '[:alnum:]._')

# Update associative array with sanitized file name
FILE_COVERAGE_SUMMARY["$FILE_NAME_CLEAN"]="File: $FILE_NAME - Line Coverage: $LINE_COVERAGE_PERCENTAGE% ($FILE_LINES_HIT / $FILE_LINES_FOUND)"
fi

done < "$LCOV_FILE"
Expand Down Expand Up @@ -163,19 +168,3 @@ jobs:
for FILE in "${!FILE_COVERAGE_SUMMARY[@]}"; do
echo "${FILE_COVERAGE_SUMMARY[$FILE]}"
done > per_file_coverage_report.txt

- name: Comment with Coverage Summary in PR
uses: mshick/add-pr-comment@v2.8.2
with:
repo-token: ${{ secrets.GIT_ACTIONS_BOT_PAT_CLASSIC }}
message: |
## Test Coverage Report
${{ env.LINE_COVERAGE_REPORT }}
${{ env.FUNCTION_COVERAGE_REPORT }}
${{ env.BRANCH_COVERAGE_REPORT }}
${{ env.RESULT_COVERAGE_REPORT }}

### Per File Coverage:
```txt
$(cat per_file_coverage_report.txt)
```
Loading