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: factory/data, factory/core, factory/crypto #5145

Merged
merged 14 commits into from
Apr 25, 2023

Conversation

sstanculeanu
Copy link
Collaborator

@sstanculeanu sstanculeanu commented Apr 3, 2023

Reasoning behind the pull request

  • increase code coverage

Proposed changes

  • added unittests for factory/core, factory/crypto, factory/data + small fixes

Testing procedure

  • standard system test

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?

@codecov
Copy link

codecov bot commented Apr 3, 2023

Codecov Report

Patch coverage: 88.01% and project coverage change: +6.84 🎉

Comparison is base (70b58fe) 70.90% compared to head (162d55e) 77.75%.

❗ Current head 162d55e differs from pull request most recent head 73948ec. Consider uploading reports for the commit 73948ec to get more accurate results

Additional details and impacted files
@@              Coverage Diff              @@
##           rc/v1.6.0    #5145      +/-   ##
=============================================
+ Coverage      70.90%   77.75%   +6.84%     
=============================================
  Files            675      680       +5     
  Lines          87793    88348     +555     
=============================================
+ Hits           62251    68694    +6443     
+ Misses         20864    14313    -6551     
- Partials        4678     5341     +663     
Impacted Files Coverage Δ
common/channels.go 100.00% <ø> (ø)
common/configParser.go 21.59% <0.00%> (-1.03%) ⬇️
factory/bootstrap/bootstrapComponentsHandler.go 57.89% <0.00%> (+57.89%) ⬆️
factory/crypto/cryptoComponents.go 79.69% <ø> (+20.14%) ⬆️
factory/processing/processComponents.go 65.52% <0.00%> (+65.52%) ⬆️
process/economics/builtInFunctionsCost.go 55.33% <0.00%> (-3.43%) ⬇️
process/peer/process.go 72.88% <ø> (ø)
.../rewardTransaction/interceptedRewardTransaction.go 94.02% <ø> (+4.02%) ⬆️
process/smartContract/builtInFunctions/factory.go 83.33% <ø> (-2.64%) ⬇️
process/smartContract/hooks/blockChainHook.go 95.63% <ø> (+0.01%) ⬆️
... and 59 more

... and 32 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@sstanculeanu sstanculeanu changed the title More factory tests Coverage for: factory/data, factory/core, factory/crypto Apr 3, 2023
@sstanculeanu sstanculeanu marked this pull request as ready for review April 3, 2023 15:39
@sstanculeanu sstanculeanu changed the title Coverage for: factory/data, factory/core, factory/crypto [DO NOT MERGE YET] Coverage for: factory/data, factory/core, factory/crypto Apr 3, 2023
@iulianpascalau iulianpascalau self-requested a review April 3, 2023 15:48
factory/core/coreComponentsHandler_test.go Outdated Show resolved Hide resolved
factory/core/coreComponentsHandler_test.go Show resolved Hide resolved
factory/core/coreComponentsHandler_test.go Outdated Show resolved Hide resolved
factory/core/coreComponentsHandler_test.go Outdated Show resolved Hide resolved
factory/core/coreComponentsHandler_test.go Show resolved Hide resolved
factory/data/dataComponentsHandler_test.go Outdated Show resolved Hide resolved
factory/data/dataComponentsHandler_test.go Show resolved Hide resolved
factory/data/dataComponentsHandler_test.go Outdated Show resolved Hide resolved
factory/data/dataComponents_test.go Outdated Show resolved Hide resolved
Comment on lines 251 to 256
func TestCoreComponentsFactory_CreateCoreComponentsInvalidGasScheduleShouldErr(t *testing.T) {
t.Parallel()

args := componentsMock.GetCoreArgs()
args.EpochConfig = config.EpochConfig{}
ccf, _ := coreComp.NewCoreComponentsFactory(args)
Copy link
Contributor

Choose a reason for hiding this comment

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

change test name? invalidEpochConfig?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

gabi-vuls
gabi-vuls previously approved these changes Apr 18, 2023
Copy link
Contributor

@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 @@

more_factory_tests

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

  • Known Warnings 9
  • New Warnings 1
  • Known Errors 0
  • New Errors 1
  • Panics 0
    ================================================================================
  • block hash does not match 2444
  • wrong nonce in block 1010
  • 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 0
    ================================================================================
  • No jailed nodes on the testnet
    ================================================================================

ssd04
ssd04 previously approved these changes Apr 24, 2023
@sstanculeanu sstanculeanu changed the base branch from rc/v1.5.0 to rc/v1.6.0 April 24, 2023 15:22
@sstanculeanu sstanculeanu dismissed stale reviews from gabi-vuls and ssd04 April 24, 2023 15:22

The base branch was changed.

@sstanculeanu sstanculeanu changed the title [DO NOT MERGE YET] Coverage for: factory/data, factory/core, factory/crypto Coverage for: factory/data, factory/core, factory/crypto Apr 24, 2023
…into more_factory_tests

# Conflicts:
#	factory/crypto/cryptoComponents.go
#	factory/crypto/cryptoComponentsHandler_test.go
#	factory/data/dataComponents.go
#	factory/data/dataComponents_test.go
#	factory/mock/cryptoComponentsMock.go
#	integrationTests/mock/cryptoComponentsStub.go
#	integrationTests/testProcessorNode.go
#	node/mock/factory/cryptoComponentsStub.go
#	node/nodeTesting_test.go
require.NoError(t, err)
require.Nil(t, managedCoreComponents.CheckSubcomponents())
}
func TestManagedCoreComponents_Close(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

add empty line on L138

@@ -357,11 +356,6 @@ func (ccf *cryptoComponentsFactory) readCryptoParams(keygen crypto.KeyGenerator)
return nil, err
}

cp.privateKeyBytes, err = cp.privateKey.ToByteArray()
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

ssd04
ssd04 previously approved these changes Apr 25, 2023
…into more_factory_tests

# Conflicts:
#	factory/bootstrap/bootstrapComponentsHandler_test.go
#	factory/bootstrap/bootstrapComponents_test.go
@sstanculeanu sstanculeanu merged commit 8799c5b into rc/v1.6.0 Apr 25, 2023
@sstanculeanu sstanculeanu deleted the more_factory_tests branch April 25, 2023 08:41
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.

4 participants