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

Add Ledger app unit tests to the Namada CI #4140

Merged
merged 6 commits into from
Dec 7, 2024

Conversation

murisi
Copy link
Collaborator

@murisi murisi commented Dec 3, 2024

Describe your changes

An attempt to add Ledger app unit tests to the Namada CI. These tests were created to complement the Ledger app E2E tests already in the CI at test-e2e-with-device-automation. Whereas the E2E tests comprehensively cover testing hardware wallet signing for a few cases, these unit tests focus on covering hardware wallet printing for hundreds of cases. More specifically, the following changes have been made:

  • Made the CI automatically generate random transaction test vectors using the Namada client
    • Doing this has the side benefit of preventing code rot in the test vector generation code
  • The CI then runs the Ledger app unit test code on the generated test vectors
    • Doing this helps automatically detect compatibility breaking changes in the transaction serializations
  • Fixed regressions in the test vector generation code

See an example run of this new job here: https://github.com/murisi/namada/actions/runs/12143664343/job/33861086521?pr=2

Checklist before merging

  • If this PR has some consensus breaking changes, I added the corresponding breaking:: labels
    • This will require 2 reviewers to approve the changes
  • If this PR requires changes to the docs or specs, a corresponding PR is opened in the namada-docs repo
    • Relevant PR if applies:
  • If this PR affects services such as namada-indexer or namada-masp-indexer, a corresponding PR is opened in that repo
    • Relevant PR if applies:

@murisi murisi force-pushed the murisi/ledger-namada-unit-tests-ci branch from dc0a4c3 to 74e0a37 Compare December 3, 2024 15:51
@murisi murisi force-pushed the murisi/ledger-namada-unit-tests-ci branch from 74e0a37 to f2db3ba Compare December 3, 2024 16:09
chain_id in arb_chain_id(),
expiration in option::of(arb_date_time_utc()),
timestamp in arb_date_time_utc(),
batch in arb_tx_commitments(1..10),
batch in arb_tx_commitments(cmt_count),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one here 👍🏻 , we were previously generating up to 10 headers and the other arb_transaction generators were only appending data for a single inner tx which was strange

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 1.78571% with 55 lines in your changes missing coverage. Please review.

Project coverage is 74.54%. Comparing base (f027584) to head (490e616).
Report is 36 commits behind head on main.

Files with missing lines Patch % Lines
crates/sdk/src/signing.rs 0.00% 55 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4140      +/-   ##
==========================================
- Coverage   74.56%   74.54%   -0.03%     
==========================================
  Files         341      341              
  Lines      107502   107549      +47     
==========================================
+ Hits        80160    80173      +13     
- Misses      27342    27376      +34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Fraccaman
Copy link
Member

Thanks murisi! I just want to make a couple of changes to the CI workflow before merging

@murisi murisi added the merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass label Dec 7, 2024
mergify bot added a commit that referenced this pull request Dec 7, 2024
@mergify mergify bot merged commit c68cb4b into main Dec 7, 2024
21 of 24 checks passed
@mergify mergify bot deleted the murisi/ledger-namada-unit-tests-ci branch December 7, 2024 15:03
@tzemanovic tzemanovic added the backport-libs-0.47 Backport libraries to 0.47 maintenance branch label Dec 11, 2024
mergify bot added a commit that referenced this pull request Dec 11, 2024
Add Ledger app unit tests to the Namada CI (backport #4140)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-libs-0.47 Backport libraries to 0.47 maintenance branch CI merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants