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

Coverage for facade #5237

Merged
merged 3 commits into from May 16, 2023
Merged

Coverage for facade #5237

merged 3 commits into from May 16, 2023

Conversation

sstanculeanu
Copy link
Contributor

Reasoning behind the pull request

  • increase code coverage

Proposed changes

  • added unit tests on facade package

Testing procedure

  • tests only

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

nf, _ := NewNodeFacade(arg)
arg := createMockArguments()
arg.Node = &mock.NodeStub{
GetAccountCalled: func(address string, _ api.AccountQueryOptions) (api.AccountResponse, api.BlockInfo, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

the address isn't used either

t.Parallel()

nf, _ := NewNodeFacade(createMockArguments())
require.NoError(t, nf.Close())
Copy link
Contributor

Choose a reason for hiding this comment

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

it seems like the context created on the constructor isn't used anywhere. might remove it and the cancel function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

indeed, fixed

@codecov
Copy link

codecov bot commented May 11, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.13 ⚠️

Comparison is base (ffd2cb0) 79.59% compared to head (6465c4b) 79.47%.

❗ Current head 6465c4b differs from pull request most recent head cafae33. Consider uploading reports for the commit cafae33 to get more accurate results

Additional details and impacted files
@@              Coverage Diff              @@
##           rc/v1.6.0    #5237      +/-   ##
=============================================
- Coverage      79.59%   79.47%   -0.13%     
=============================================
  Files            680      680              
  Lines          88012    88010       -2     
=============================================
- Hits           70053    69944     -109     
- Misses         12837    12912      +75     
- Partials        5122     5154      +32     
Impacted Files Coverage Δ
facade/nodeFacade.go 97.25% <ø> (+18.77%) ⬆️

... and 18 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@iulianpascalau iulianpascalau self-requested a review May 11, 2023 14:43
@@ -68,8 +68,6 @@ type nodeFacade struct {
accountsState state.AccountsAdapter
peerState state.AccountsAdapter
blockchain chainData.ChainHandler
ctx context.Context
Copy link
Contributor

Choose a reason for hiding this comment

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

👍
golang says: we should not store contexts

Copy link
Collaborator

@gabi-vuls gabi-vuls left a comment

Choose a reason for hiding this comment

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

System test passed.
@@ Log scanner @@

facade_tests

================================================================================

  • Known Warnings 10
  • New Warnings 3
  • Known Errors 1
  • New Errors 1
  • Panics 0
    ================================================================================
  • block hash does not match 11250
  • wrong nonce in block 4000
  • miniblocks does not match 0
  • num miniblocks does not match 0
  • miniblock hash does not match 0
  • block bodies does not match 0
  • receipts hash missmatch 1
    ================================================================================
  • No jailed nodes on the testnet
    ================================================================================

@sstanculeanu sstanculeanu merged commit d6034af into rc/v1.6.0 May 16, 2023
5 checks passed
@sstanculeanu sstanculeanu deleted the facade_tests branch May 16, 2023 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants