neo icon indicating copy to clipboard operation
neo copied to clipboard

[Neo Plugin UT] Rpcserver unit test on node

Open Jim8y opened this issue 1 year ago • 3 comments

Description

This is the second pr that focus on adding unit tests for rpcservers.

Fixes # https://github.com/neo-project/neo/issues/3350

Type of change

  • [x] Optimization (the change is only an optimization)
  • [ ] Style (the change is only a code style for better maintenance or standard purpose)
  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

How Has This Been Tested?

Here is the list of method names extracted from the provided code:

  1. TestGetVersion
  2. TestSendRawTransaction_Normal
  3. TestSendRawTransaction_InvalidTransactionFormat
  4. TestSendRawTransaction_InsufficientBalance
  5. TestSendRawTransaction_InvalidSignature
  6. TestSendRawTransaction_InvalidScript
  7. TestSendRawTransaction_InvalidAttribute
  8. TestSendRawTransaction_Oversized
  9. TestSendRawTransaction_Expired
  10. TestSendRawTransaction_PolicyFailed
  11. TestSendRawTransaction_AlreadyInPool
  12. TestSendRawTransaction_AlreadyInBlockchain
  13. TestSendRawTransaction_MemoryPoolFull
  14. TestSubmitBlock_Normal
  15. TestSubmitBlock_InvalidBlockFormat
  16. TestSubmitBlock_AlreadyExists
  17. TestSubmitBlock_InvalidBlock
  18. TestSendRawTransaction_NullInput
  19. TestSendRawTransaction_EmptyInput
  20. TestSubmitBlock_NullInput
  21. TestSubmitBlock_EmptyInput

Test Configuration:

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
  • [ ] 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

Jim8y avatar Jun 24 '24 00:06 Jim8y

Coverage is not working and some verification are failing, Jimmy.

vncoelho avatar Jun 26 '24 10:06 vncoelho

Coverage is not working and some verification are failing, Jimmy.

i.know, i will fix that, i changed testing utils and that caused some test fail

Jim8y avatar Jun 26 '24 11:06 Jim8y

Coverage is not working and some verification are failing, Jimmy.

i.know, i will fix that, i changed testing utils and that caused some test fail

Sure, as soon as fixed I will review here again.

I just verified something related to Debug for the method clear of mempool. What is the real use of this on the UTs themself?

vncoelho avatar Jun 26 '24 11:06 vncoelho

@cschuchardt88 @shargon @superboyiii

Jim8y avatar Jul 05 '24 00:07 Jim8y

Have to update some existing tests cause i updated the timestamp of the test block since it was the same as genesis block.

Jim8y avatar Jul 05 '24 00:07 Jim8y

@superboyiii

Jim8y avatar Jul 06 '24 16:07 Jim8y