Skip to content

Conversation

@simzzz
Copy link
Contributor

@simzzz simzzz commented Jul 10, 2025

Description:
This PR introduces new unit tests to increase coverage across several key areas of the relay, focusing on error handling, rate limiting, and data formatting.

  • RedisRateLimitStore.ts: Added tests for the constructor to ensure proper initialization and handling of client states.
  • SDKClientError.ts: Implemented tests for error classification methods like isGrpcTimeout() and validating properties such as statusCode and nodeAccountId.
  • JsonRpcError.ts: Added coverage for the newWithRequestId static method to ensure request IDs are correctly appended to error messages for better traceability.
  • formatters.ts: Introduced tests for various data formatting utilities, including the decodeErrorMessage function, to ensure consistent output.
  • hbarSpendingPlan.ts: Added tests for the core logic of creating and managing spending plans, ensuring limits are enforced correctly over time.
  • FilterService.ts: Implemented new tests to validate the distinct error handling paths in newFilter (using genericErrorHandler) and newBlockFilter.

Related issue(s):

closes #3910, closes #3911, closes #3912, closes #3913, closes #3914, closes #3915, closes #3916

@github-actions
Copy link

github-actions bot commented Jul 10, 2025

Test Results

 20 files  ±0  277 suites  ±0   17m 54s ⏱️ -3s
702 tests  - 1  697 ✅ ±0  5 💤 ±0  0 ❌  - 1 
718 runs  ±0  713 ✅ +1  5 💤 ±0  0 ❌  - 1 

Results for commit 029c6de. ± Comparison against base commit f82f220.

This pull request removes 1 test.
"after all" hook in "@web-socket-batch-1 eth_call" ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-1 eth_call "after all" hook in "@web-socket-batch-1 eth_call"

♻️ This comment has been updated with latest results.

@simzzz simzzz self-assigned this Jul 10, 2025
@simzzz simzzz added the enhancement New feature or request label Jul 10, 2025
@simzzz simzzz added this to the 0.70.0 milestone Jul 10, 2025
@simzzz simzzz changed the title added extended test coverage feat: adds additional test coverage to multiple files Jul 10, 2025
@simzzz simzzz marked this pull request as ready for review July 11, 2025 10:03
@simzzz simzzz requested review from a team as code owners July 11, 2025 10:03
@simzzz simzzz requested a review from quiet-node July 11, 2025 10:03
quiet-node
quiet-node previously approved these changes Jul 14, 2025
Copy link
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

Good catch on the missing tests and great set of new tests!

acuarica
acuarica previously approved these changes Jul 14, 2025
@simzzz simzzz dismissed stale reviews from acuarica and quiet-node via 14a0a84 July 15, 2025 07:46
@simzzz simzzz requested review from acuarica and quiet-node July 15, 2025 08:09
simzzz added 10 commits July 15, 2025 13:18
Signed-off-by: Simeon Nakov <[email protected]>
Signed-off-by: Simeon Nakov <[email protected]>
Signed-off-by: Simeon Nakov <[email protected]>
Signed-off-by: Simeon Nakov <[email protected]>
Signed-off-by: Simeon Nakov <[email protected]>
Signed-off-by: Simeon Nakov <[email protected]>
Signed-off-by: Simeon Nakov <[email protected]>
Signed-off-by: Simeon Nakov <[email protected]>
@simzzz simzzz force-pushed the 3901-simo-increase-test-coverage branch from 74106a5 to 62ab4d8 Compare July 15, 2025 10:25
quiet-node
quiet-node previously approved these changes Jul 15, 2025
Copy link
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

LGTM great work as always!

acuarica
acuarica previously approved these changes Jul 15, 2025
@simzzz simzzz dismissed stale reviews from acuarica and quiet-node via f4f4cf5 July 16, 2025 11:45
Signed-off-by: Simeon Nakov <[email protected]>
Copy link
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

LGTM

@simzzz simzzz merged commit 9c98c93 into main Jul 17, 2025
46 checks passed
@simzzz simzzz deleted the 3901-simo-increase-test-coverage branch July 17, 2025 14:06
@codecov
Copy link

codecov bot commented Jul 17, 2025

Codecov Report

Attention: Patch coverage is 82.50000% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...vices/ethService/ethFilterService/FilterService.ts 82.50% 0 Missing and 7 partials ⚠️
@@            Coverage Diff             @@
##             main    #3920      +/-   ##
==========================================
+ Coverage   86.86%   87.39%   +0.53%     
==========================================
  Files          87       87              
  Lines        5039     5047       +8     
  Branches     1020     1018       -2     
==========================================
+ Hits         4377     4411      +34     
+ Misses        400      384      -16     
+ Partials      262      252      -10     
Flag Coverage Δ
config-service 95.78% <ø> (ø)
relay 82.48% <80.00%> (+1.21%) ⬆️
server 80.81% <ø> (ø)
ws-server 61.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...vices/ethService/ethFilterService/FilterService.ts 80.68% <82.50%> (+6.93%) ⬆️

... and 8 files with indirect coverage changes

🚀 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

5 participants