Skip to content

Add Ledger app unit tests to the Namada CI#4140

Merged
mergify[bot] merged 6 commits intomainfrom
murisi/ledger-namada-unit-tests-ci
Dec 7, 2024
Merged

Add Ledger app unit tests to the Namada CI#4140
mergify[bot] merged 6 commits intomainfrom
murisi/ledger-namada-unit-tests-ci

Conversation

@murisi
Copy link
Copy Markdown
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
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
Copy Markdown
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

@codecov
Copy link
Copy Markdown

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
Copy Markdown
Collaborator

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
@mergify mergify bot deleted the murisi/ledger-namada-unit-tests-ci branch December 7, 2024 15:03
@tzemanovic tzemanovic added the backport-libs-0.251 Backport libraries to 0.251 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.251 Backport libraries to 0.251 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