Skip to content

test: codecov for WasmHostFuncWrapper.cpp #5601

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

Open
wants to merge 17 commits into
base: ripple/smart-escrow
Choose a base branch
from

Conversation

mvadari
Copy link
Collaborator

@mvadari mvadari commented Jul 23, 2025

High Level Overview of Change

This PR adds WASM tests to get 100% codecov on WasmHostFuncWrapper.cpp

Context of Change

better testing

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

Test Plan

Added WASM tests to cover all the code.

Rust code is here: ripple/craft#111

@mvadari mvadari marked this pull request as ready for review July 23, 2025 16:57
@mvadari mvadari force-pushed the wrapper-unittest branch 3 times, most recently from e895a97 to 41c4225 Compare July 23, 2025 21:11
Copy link

codecov bot commented Jul 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.8%. Comparing base (ece3a8d) to head (4eb9251).
⚠️ Report is 36 commits behind head on ripple/smart-escrow.

Additional details and impacted files

Impacted file tree graph

@@                  Coverage Diff                  @@
##           ripple/smart-escrow   #5601     +/-   ##
=====================================================
+ Coverage                 78.7%   78.8%   +0.1%     
=====================================================
  Files                      825     823      -2     
  Lines                    73098   72962    -136     
  Branches                  8548    8539      -9     
=====================================================
- Hits                     57553   57503     -50     
+ Misses                   15545   15459     -86     
Files with missing lines Coverage Δ
src/xrpld/app/misc/WasmHostFuncWrapper.cpp 100.0% <100.0%> (+51.3%) ⬆️

... and 115 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mvadari mvadari force-pushed the ripple/smart-escrow branch from 61b2dcc to 98b8986 Compare July 24, 2025 13:21
@mvadari mvadari force-pushed the wrapper-unittest branch from e04bb6b to e9563a4 Compare July 24, 2025 13:22
@mvadari mvadari requested a review from oleks-rip July 24, 2025 13:26
@oleks-rip
Copy link
Collaborator

To many changes with just refactoring which distract from actual work. Please move all the renames / refactoring to the different PR

@@ -1102,133 +1237,4 @@ class MockInstanceWrapper
}
};

namespace test {
bool
testGetDataIncrement()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is it moved?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed it, since the existing tests now give us full code coverage.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Which test check for correct index increment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Several of the tests would fail if the index increment was wrong.

Copy link
Collaborator

@oleks-rip oleks-rip Jul 25, 2025

Choose a reason for hiding this comment

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

As from our previous experience this error will be hard to find from just test failed. Better leave it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, brought it back but excluded it from codecov

@mvadari mvadari force-pushed the wrapper-unittest branch from e9563a4 to fe7e924 Compare July 24, 2025 16:45
@mvadari
Copy link
Collaborator Author

mvadari commented Jul 24, 2025

To many changes with just refactoring which distract from actual work. Please move all the renames / refactoring to the different PR

moved to #5609

{
return Bytes(accountID_.begin(), accountID_.end());
}
}
uint8_t const a[] = {0x2b, 0x6a, 0x23, 0x2a, 0xa4, 0xc4, 0xbe, 0x41,
Copy link
Collaborator

Choose a reason for hiding this comment

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

How were these test data values created?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think that was @oleks-rip. Either way, IMO out of scope of this PR.

Copy link
Collaborator

@intelliot intelliot left a comment

Choose a reason for hiding this comment

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

Awesome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants