hashgraph / hedera-json-rpc-relay

Implementation of Ethereum JSON-RPC APIs for Hedera
Apache License 2.0
68 stars 72 forks source link

test: added e2e test for EXTENDED and PRIVILEGED tier users #3147

Closed quiet-node closed 3 weeks ago

quiet-node commented 4 weeks ago

Description: This PR added e2e tests to cover usage for both EXTENDED and PRIVILEGED tier users.

Related issue(s):

Fixes #3066 Fixes #3067

Notes for reviewer:

Checklist

github-actions[bot] commented 4 weeks ago

🚨 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: 27,575.1 ms

Heap Statistics (before vs after executing the test):

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

Recommendations

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

github-actions[bot] commented 4 weeks ago

Tests

βŸβ€„β€ˆβŸβ€„βŸβ€„4 filesβ€„β€ƒβŸβ€„β€ˆ404 suites   18s :stopwatch: 1β€ˆ429 tests 1β€ˆ428 :heavy_check_mark: 1 :zzz: 0 :x: 1β€ˆ438 runs  1β€ˆ437 :heavy_check_mark: 1 :zzz: 0 :x:

Results for commit ab2d3038.

github-actions[bot] commented 4 weeks ago

Acceptance Tests

βŸβ€„17 files  227 suites   30m 30s :stopwatch: 605 tests 600 :heavy_check_mark: 4 :zzz: 1 :x: 620 runs  615 :heavy_check_mark: 4 :zzz: 1 :x:

Results for commit ab2d3038.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 3 weeks ago

Test Results

 21 files  + 1  284 suites  +1   36m 19s :stopwatch: Β±0s 607 tests + 7  593 :white_check_mark: + 2  4 :zzz: Β±0  10 :x: +5  747 runsβ€Š  -β€Š20  732 :white_check_mark:  -β€Š23  5 :zzz: Β±0  10 :x: +3 

For more details on these failures, see this check.

Results for commit 1fe3e9b0. ± Comparison against base commit 5ca6f631.

This pull request removes 1 and adds 8 tests. Note that renamed tests count towards both. ``` "before all" hook for "should execute "eth_getCode" for hts token" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-2 RPC Server Acceptance Tests eth_getCode "before all" hook for "should execute "eth_getCode" for hts token" ``` ``` "before all" hook in "@api-batch-2 RPC Server Acceptance Tests" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-2 RPC Server Acceptance Tests "before all" hook in "@api-batch-2 RPC Server Acceptance Tests" "before each" hook for "Should increase the amount spent of the spending plan by the transaction cost" ‑ RPC Server Acceptance Tests Acceptance tests @hbarlimiter HBAR Limiter Acceptance Tests HBAR Rate Limit Tests HBAR Rate Limit For Different Spending Plan Tiers Preconfigured Tiers PRIVILEGED Tier "before each" hook for "Should increase the amount spent of the spending plan by the transaction cost" "before each" hook for "should execute "eth_getStorageAt" request to get old state with passing specific block" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-2 RPC Server Acceptance Tests "before each" hook for "should execute "eth_getStorageAt" request to get old state with passing specific block" Should eventually exhaust the hbar limit for EXTENDED user ‑ RPC Server Acceptance Tests Acceptance tests @hbarlimiter HBAR Limiter Acceptance Tests HBAR Rate Limit Tests HBAR Rate Limit For Different Spending Plan Tiers Preconfigured Tiers EXTENDED Tier Should eventually exhaust the hbar limit for EXTENDED user Should eventually exhaust the hbar limit for PRIVILEGED user ‑ RPC Server Acceptance Tests Acceptance tests @hbarlimiter HBAR Limiter Acceptance Tests HBAR Rate Limit Tests HBAR Rate Limit For Different Spending Plan Tiers Preconfigured Tiers PRIVILEGED Tier Should eventually exhaust the hbar limit for PRIVILEGED user Should increase the amount spent of the spending plan by the transaction cost ‑ RPC Server Acceptance Tests Acceptance tests @hbarlimiter HBAR Limiter Acceptance Tests HBAR Rate Limit Tests HBAR Rate Limit For Different Spending Plan Tiers Preconfigured Tiers EXTENDED Tier Should increase the amount spent of the spending plan by the transaction cost Should increase the amount spent of the spending plan by the transaction cost ‑ RPC Server Acceptance Tests Acceptance tests @hbarlimiter HBAR Limiter Acceptance Tests HBAR Rate Limit Tests HBAR Rate Limit For Different Spending Plan Tiers Preconfigured Tiers PRIVILEGED Tier Should increase the amount spent of the spending plan by the transaction cost Should successfully populate all pre-configured spending plans ‑ RPC Server Acceptance Tests Acceptance tests @hbarlimiter HBAR Limiter Acceptance Tests HBAR Rate Limit Tests HBAR Rate Limit For Different Spending Plan Tiers Preconfigured Tiers given a valid JSON file with pre-configured spending plans Should successfully populate all pre-configured spending plans ```

:recycle: This comment has been updated with latest results.

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
7 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.46%. Comparing base (5ca6f63) to head (1fe3e9b). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3147 +/- ## ========================================== - Coverage 83.26% 82.46% -0.80% ========================================== Files 66 69 +3 Lines 4254 4415 +161 Branches 829 867 +38 ========================================== + Hits 3542 3641 +99 - Misses 471 527 +56 - Partials 241 247 +6 ``` | [Flag](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3147/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | Coverage Ξ” | | |---|---|---| | [config-service](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3147/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `98.14% <ΓΈ> (ΓΈ)` | | | [relay](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3147/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `85.45% <ΓΈ> (ΓΈ)` | | | [server](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3147/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `83.52% <ΓΈ> (ΓΈ)` | | | [ws-server](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3147/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `36.87% <ΓΈ> (ΓΈ)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3147?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | Coverage Ξ” | | |---|---|---| | [...s/relay/src/lib/services/hbarLimitService/index.ts](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3147?src=pr&el=tree&filepath=packages%2Frelay%2Fsrc%2Flib%2Fservices%2FhbarLimitService%2Findex.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGFja2FnZXMvcmVsYXkvc3JjL2xpYi9zZXJ2aWNlcy9oYmFyTGltaXRTZXJ2aWNlL2luZGV4LnRz) | `96.66% <ΓΈ> (ΓΈ)` | | ... and [14 files with indirect coverage changes](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3147/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph)