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

Fix overriding network config in tests #8756

Merged
merged 6 commits into from
Apr 14, 2021
Merged

Conversation

rkapka
Copy link
Contributor

@rkapka rkapka commented Apr 13, 2021

What type of PR is this?

Tests

What does this PR do? Why is it needed?

Overriding the network config in tests does not work properly. Config values are not being reset after the test, which may cause tests to fail if they're not in the correct order. The same issue does not occur for the beacon config.

This PR modifies the network config's setup to make it identical with the beacon config.

Which issues(s) does this PR fix?

N/A

Other notes for review

N/A

@rkapka rkapka requested a review from a team as a code owner April 13, 2021 13:51
@@ -42,7 +42,7 @@ func BeaconNetworkConfig() *NetworkConfig {
// OverrideBeaconNetworkConfig will override the network
// config with the added argument.
func OverrideBeaconNetworkConfig(cfg *NetworkConfig) {
networkConfig = cfg.Copy()
networkConfig = cfg
Copy link
Member

Choose a reason for hiding this comment

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

In your description it says it's only for tests but this is not used only for tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right... Now I am not so sure about the safety of this change. On the other hand this will align the network config's setup with the beacon config, so it doesn't look risky.

Copy link
Member

Choose a reason for hiding this comment

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

At the minimal we should test pyrmont or prater still works. Better see it breaking earlier than later

Copy link
Member

Choose a reason for hiding this comment

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

Lets leave it as it is, is there any reason a Copy needs to be removed ?

@codecov
Copy link

codecov bot commented Apr 14, 2021

Codecov Report

Merging #8756 (7b62af2) into develop (228033f) will increase coverage by 0.07%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop    #8756      +/-   ##
===========================================
+ Coverage    61.56%   61.63%   +0.07%     
===========================================
  Files          509      509              
  Lines        34803    34803              
===========================================
+ Hits         21426    21452      +26     
+ Misses       10208    10177      -31     
- Partials      3169     3174       +5     

@prylabs-bulldozer prylabs-bulldozer bot merged commit 902e3f4 into develop Apr 14, 2021
@delete-merged-branch delete-merged-branch bot deleted the test-config-override branch April 14, 2021 07:39
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.

4 participants