iotex-core icon indicating copy to clipboard operation
iotex-core copied to clipboard

[ioctl] Build Execution unittest

Open LuckyPigeon opened this issue 2 years ago • 6 comments

Description

Build Execute unittest for action command

refer to #3444 & #3472

Type of change

Please delete options that are not relevant.

  • [x] Code refactor or improvement

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [x] make test
  • [x] TestExecute

Test Configuration:

  • Firmware version: Windows 10 (WSL Version: Ubuntu 18.04)
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [x] Any dependent changes have been merged and published in downstream modules

LuckyPigeon avatar Sep 07 '22 16:09 LuckyPigeon

Codecov Report

Merging #3631 (dfaa321) into master (e9732a1) will decrease coverage by 0.14%. The diff coverage is 83.00%.

:exclamation: Current head dfaa321 differs from pull request most recent head ad84eb4. Consider uploading reports for the commit ad84eb4 to get more accurate results

@@            Coverage Diff             @@
##           master    #3631      +/-   ##
==========================================
- Coverage   74.95%   74.80%   -0.15%     
==========================================
  Files         269      266       -3     
  Lines       23819    23763      -56     
==========================================
- Hits        17854    17777      -77     
- Misses       5039     5061      +22     
+ Partials      926      925       -1     
Impacted Files Coverage Δ
db/config.go 100.00% <ø> (ø)
db/trie/mptrie/node.go 100.00% <ø> (ø)
ioctl/newcmd/action/action.go 89.09% <ø> (+9.55%) :arrow_up:
ioctl/newcmd/node/nodedelegate.go 70.19% <0.00%> (-0.95%) :arrow_down:
ioctl/newcmd/node/nodeprobationlist.go 90.90% <0.00%> (-4.33%) :arrow_down:
action/protocol/execution/evm/evm.go 44.57% <26.66%> (-0.86%) :arrow_down:
db/trie/mptrie/hashnode.go 36.36% <41.17%> (-54.55%) :arrow_down:
db/trie/mptrie/merklepatriciatrie.go 78.73% <46.80%> (-12.70%) :arrow_down:
db/db_bolt.go 72.13% <50.00%> (-0.39%) :arrow_down:
db/trie/mptrie/leafiterator.go 62.06% <50.00%> (ø)
... and 22 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Sep 07 '22 16:09 codecov[bot]

plz fix the code smells and security hotspots

huangzhiran avatar Sep 08 '22 12:09 huangzhiran

@huangzhiran The security hotspots is about fake test account configuration, only use in this test case and will be destroyed, seems just the naming issue, not an actually security hotspots. It can still be removed and inline into each code section, but in my opinion, which will increase too much redundant code.

LuckyPigeon avatar Sep 08 '22 12:09 LuckyPigeon

L251~L253 and L357~L358 also shouldn't be a code smell, it's weird and confused for suddenly shows up an _failedToGetNonce constant in test description.

LuckyPigeon avatar Sep 08 '22 13:09 LuckyPigeon

@huangzhiran Done!

LuckyPigeon avatar Sep 10 '22 00:09 LuckyPigeon

@LuckyPigeon please resolve conflict, thx.

huof6829 avatar Sep 30 '22 10:09 huof6829

@huof6829 Done!

LuckyPigeon avatar Sep 30 '22 10:09 LuckyPigeon

@huof6829

Thx!

huof6829 avatar Sep 30 '22 14:09 huof6829

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 2 Code Smells

No Coverage information No Coverage information
3.7% 3.7% Duplication

sonarqubecloud[bot] avatar Oct 13 '22 02:10 sonarqubecloud[bot]