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

test: create e2e tests for basic spending plan limit #3079

Open
wants to merge 68 commits into
base: main
Choose a base branch
from

Conversation

konstantinabl
Copy link
Collaborator

Description:

This PR adds acceptance tests to verify the scenarios listed in the issue that is linked

Related issue(s):

Fixes #3065

Notes for reviewer:

Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Some queries like getAccountInfo, getBalanceInfo, FileContentsQuery, etc. also add expense to remainingBalance but don't necessarily need to have an originalCaller (ethAddress).

Therefore, addExpense can accept nullable ethAddress value.

Only when ethAddress or ipAddress is valid, utilize spendingPlan logic. Otherwise, skip completely.

Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
…and IExecuteQueryEventPayload

Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
This reverts commit 3a20364.

Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
This reverts commit fd9e119 and updated related tests

Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
This reverts commit e45c321.

Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
quiet-node and others added 14 commits October 7, 2024 15:24
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
This reverts commit fd9e119 and updated related tests

Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
This reverts commit e45c321.

Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Copy link

github-actions bot commented Oct 9, 2024

Acceptance Tests

  19 files  244 suites   33m 15s ⏱️
603 tests 593 ✔️ 4 💤 6
675 runs  662 ✔️ 4 💤 9

Results for commit 4e8124d.

♻️ This comment has been updated with latest results.

Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Copy link

github-actions bot commented Oct 10, 2024

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled validates enforcement of request id. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact
Cost: 22,784.8 ms

Heap Statistics (before vs after executing the test):

  • Total Heap Size: increased with 1.72 MB
  • Total Heap Size Executable: no changes
  • Total Physical Size: decreased with 344.06 KB
  • Total Available Size: increased with 1.38 MB
  • Total Global Handles Size: no changes
  • Used Global Handles Size: decreased with 64.00 bytes
  • Used Heap Size: decreased with 3.28 MB
  • Heap Size Limit: no changes
  • Malloced Memory: no changes
  • External Memory: no changes
  • Peak Malloced Memory: no changes

Heap Space Statistics (before vs after executing the test):

  • Old Space:

    • Space Size: increased with 2.10 MB
    • Space Used Size: increased with 2.08 MB
    • Space Available Size: decreased with 1.05 MB
    • Physical Space Size: increased with 2.10 MB
  • Large Object Space:

    • Space Size: increased with 835.58 KB
    • Space Used Size: increased with 813.50 KB
    • Space Available Size: no changes
    • Physical Space Size: increased with 835.58 KB

Recommendations

Please investigate the memory allocations in this test, focusing on objects that are not being properly deallocated.

Copy link

github-actions bot commented Oct 10, 2024

Tests

       3 files     300 suites   19s ⏱️
1 343 tests 1 342 ✔️ 1 💤 0
1 352 runs  1 351 ✔️ 1 💤 0

Results for commit 4e8124d.

♻️ This comment has been updated with latest results.

Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Copy link

sonarcloud bot commented Oct 10, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 3 lines in your changes missing coverage. Please review.

Project coverage is 84.55%. Comparing base (4a69be9) to head (4e8124d).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
packages/relay/src/lib/clients/sdkClient.ts 90.90% 1 Missing ⚠️
packages/relay/src/lib/constants.ts 66.66% 0 Missing and 1 partial ⚠️
packages/relay/src/lib/relay.ts 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3079      +/-   ##
==========================================
- Coverage   84.88%   84.55%   -0.33%     
==========================================
  Files          43       58      +15     
  Lines        3216     3886     +670     
  Branches      649      779     +130     
==========================================
+ Hits         2730     3286     +556     
- Misses        283      362      +79     
- Partials      203      238      +35     
Flag Coverage Δ
relay 84.60% <94.11%> (-0.29%) ⬇️
server 83.43% <ø> (?)
ws-server 97.87% <ø> (?)

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

Files with missing lines Coverage Δ
.../relay/src/lib/services/hapiService/hapiService.ts 80.00% <100.00%> (+2.22%) ⬆️
...s/relay/src/lib/services/hbarLimitService/index.ts 95.72% <100.00%> (-1.71%) ⬇️
...ay/src/lib/services/metricService/metricService.ts 92.68% <100.00%> (+0.18%) ⬆️
packages/relay/src/utils.ts 100.00% <100.00%> (ø)
packages/relay/src/lib/clients/sdkClient.ts 58.22% <90.90%> (-0.19%) ⬇️
packages/relay/src/lib/constants.ts 90.56% <66.66%> (-1.44%) ⬇️
packages/relay/src/lib/relay.ts 85.71% <92.85%> (+1.78%) ⬆️

... and 16 files with indirect coverage changes

@konstantinabl konstantinabl marked this pull request as ready for review October 10, 2024 15:04
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.

[HBAR Rate Limit Redesign] Create e2e tests for basic spending plan limit
2 participants