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

chore: TokenUnpauseHandler increase unit test coverage #13364

Merged
merged 1 commit into from
May 20, 2024

Conversation

derektriley
Copy link
Contributor

Description:
Adds unit tests for pureChecks and calculateFees. Increases coverage to 100%.

Related issue(s):
#13356

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: Derek Riley <derek.riley@swirldslabs.com>
@derektriley derektriley requested review from a team as code owners May 16, 2024 18:17
@derektriley derektriley linked an issue May 16, 2024 that may be closed by this pull request
@derektriley derektriley requested a review from iwsimon May 16, 2024 18:17
Copy link

Node: HAPI Test (Node Death Reconnect) Results

2 tests   2 ✅  9m 23s ⏱️
2 suites  0 💤
2 files    0 ❌

Results for commit 412c5a1.

Copy link

Node: HAPI Test (Restart) Results

2 tests   2 ✅  8m 12s ⏱️
2 suites  0 💤
2 files    0 ❌

Results for commit 412c5a1.

Copy link

Node: Unit Test Results

  2 312 files  ±0    2 312 suites  ±0   3h 18m 15s ⏱️ - 2m 36s
119 030 tests +3  118 963 ✅ +3  67 💤 ±0  0 ❌ ±0 
127 591 runs  +3  127 524 ✅ +3  67 💤 ±0  0 ❌ ±0 

Results for commit 412c5a1. ± Comparison against base commit 73712b1.

This pull request removes 357 and adds 124 tests. Note that renamed tests count towards both.

  
             IssuerDN: CN=s-aaaa
            SubjectDN: CN=s-aaaa
           Final Date: Fri Jan 01 00:00:00 UTC 2100
           Public Key: RSA Public Key [2e:28:bc:1e:d3:83:25:92:8e:cb:98:b1:b6:84:06:9c:d5:d8:14:d5],[56:66:d1:a4]
           Start Date: Sat Jan 01 00:00:00 UTC 2000
         SerialNumber: 12482092706667292405
        modulus: c1a0ff5d2372b53d12d12bb87dd03f5…
   Address[id=0,nickname=37EhEcyE,selfName=aaaa,weight=1000,hostnameInternal=127.0.0.1,portInternalIpv4=47742,hostnameExternal=171.142.18.169,portExternalIpv4=47742,sigPublicKey=<null>,agreePublicKey=<null>,sigCert=com.swirlds.platform.crypto.SerializableX509Certificate@22431593,agreeCert=com.swirlds.platform.crypto.SerializableX509Certificate@50a7ace8,memo=LDJjWgdV],
…
com.hedera.node.app.grpc.impl.netty.GrpcServiceBuilderTest ‑ [4] 

com.hedera.node.app.grpc.impl.netty.GrpcServiceBuilderTest ‑ [6] 

com.hedera.node.app.grpc.impl.netty.GrpcServiceBuilderTest ‑ [7]   
  
com.hedera.node.app.service.token.impl.test.handlers.TokenUnpauseHandlerTest ‑ testCalculateFeesInvocations()
com.hedera.node.app.service.token.impl.test.handlers.TokenUnpauseHandlerTest ‑ testPureChecksDoesNotThrowExceptionWhenHasToken()
com.hedera.node.app.service.token.impl.test.handlers.TokenUnpauseHandlerTest ‑ testPureChecksThrowsExceptionWhenDoesNotHaveToken()
com.hedera.node.app.state.merkle.StateMetadataTest ‑ [11] 

com.hedera.node.app.state.merkle.StateMetadataTest ‑ [203] Some Legal Characters 

com.hedera.node.app.state.merkle.StateMetadataTest ‑ [395] 
 Some Legal Characters
com.swirlds.platform.crypto.KeysAndCertsTest ‑ [1] AddressBook {
   Address[id=0,nickname=etNz73t9,selfName=aaaa,weight=1000,hostnameInternal=127.0.0.1,portInternalIpv4=52381,hostnameExternal=243.152.122.243,portExternalIpv4=52381,sigPublicKey=<null>,agreePublicKey=<null>,sigCert=com.swirlds.platform.crypto.SerializableX509Certificate@3300893d,agreeCert=com.swirlds.platform.crypto.SerializableX509Certificate@2b4a3383,memo=y9k0vtIH],
   Address[id=2,nickname=dek11voO,selfName=aaab,weight=1000,hostnameInternal=127.0.0.1,portInternalIpv4=9079,hostnameExternal…, {0=KeysAndCerts[sigKeyPair=java.security.KeyPair@7e566ed5, agrKeyPair=java.security.KeyPair@59b3fbf9, sigCert=[
[
  Version: V3
  Subject: CN=s-aaaa
  Signature Algorithm: SHA384withRSA, OID = 1.2.840.113549.1.1.12

  Key:  Sun RSA public key, 3072 bits
  params: null
  modulus: 399359783971008386823194517591913909076180800663617430152293322362851354916562240539217992749052543798926670565779538052222399243364172487884744393106571360720093667481704909500324706084082081682560810453972293976421988390921489916…
…

Copy link

codecov bot commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.39%. Comparing base (73712b1) to head (412c5a1).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop   #13364   +/-   ##
==========================================
  Coverage      67.38%   67.39%           
- Complexity     36210    36213    +3     
==========================================
  Files           3700     3700           
  Lines         148964   148964           
  Branches       15499    15499           
==========================================
+ Hits          100378   100387    +9     
+ Misses         44223    44214    -9     
  Partials        4363     4363           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Node: HAPI Test (Token) Results

237 tests   235 ✅  24m 48s ⏱️
 17 suites    2 💤
 17 files      0 ❌

Results for commit 412c5a1.

Copy link

Node: HAPI Test (Crypto) Results

335 tests   335 ✅  37m 14s ⏱️
 25 suites    0 💤
 25 files      0 ❌

Results for commit 412c5a1.

Copy link

Node: HAPI Test (Misc) Results

468 tests   458 ✅  46m 8s ⏱️
 77 suites   10 💤
 77 files      0 ❌

Results for commit 412c5a1.

Copy link

Node: HAPI Test (Time Consuming) Results

21 tests   21 ✅  54m 23s ⏱️
 3 suites   0 💤
 3 files     0 ❌

Results for commit 412c5a1.

Copy link

Node: HAPI Test (Smart Contract) Results

604 tests   604 ✅  1h 9m 16s ⏱️
 63 suites    0 💤
 63 files      0 ❌

Results for commit 412c5a1.

Copy link
Contributor

@povolev15 povolev15 left a comment

Choose a reason for hiding this comment

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

LGTM TY @derektriley

@derektriley derektriley merged commit d128e30 into develop May 20, 2024
50 of 51 checks passed
@derektriley derektriley deleted the 13356-TokenUnpauseHandler-unittests branch May 20, 2024 14:59
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.

TokenUnpauseHandler [71.88 %]
2 participants