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

Test that parsing an empty CLI option set results in a default config #1661

Merged
merged 23 commits into from
Oct 11, 2023

Conversation

amsanghi
Copy link
Contributor

No description provided.

@cla-bot cla-bot bot added the s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA. label May 23, 2023
@amsanghi amsanghi marked this pull request as ready for review May 23, 2023 18:01
@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Merging #1661 (92ccdb0) into master (6d85d4a) will increase coverage by 27.93%.
The diff coverage is 100.00%.

❗ Current head 92ccdb0 differs from pull request most recent head ed37574. Consider uploading reports for the commit ed37574 to get more accurate results

@@             Coverage Diff             @@
##           master    #1661       +/-   ##
===========================================
+ Coverage   28.38%   56.31%   +27.93%     
===========================================
  Files         219      217        -2     
  Lines       32906    32603      -303     
===========================================
+ Hits         9339    18361     +9022     
+ Misses      22499    12028    -10471     
- Partials     1068     2214     +1146     

err = confighelpers.EndCommonParse(k, &emptyCliNodeConfig)
Require(t, err)
if !reflect.DeepEqual(emptyCliNodeConfig, NodeConfigDefault) {
changelog, err := diff.Diff(emptyCliNodeConfig, NodeConfigDefault)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we use cmp.Diff elsewhere, which could also replace the reflect.DeepEqual call I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah actually initially i was using cmp.Diff only but i am running into this issue with it

cannot handle unexported field at {main.NodeConfig}.Node.BatchPoster.gasRefunder: "github.com/offchainlabs/nitro/arbnode".BatchPosterConfig consider using a custom Comparer; if you control the implementation of type, you can also consider using an Exporter, AllowUnexported, or cmpopts.IgnoreUnexported [recovered] panic: cannot handle unexported field at {main.NodeConfig}.Node.BatchPoster.gasRefunder: "github.com/offchainlabs/nitro/arbnode".BatchPosterConfig consider using a custom Comparer; if you control the implementation of type, you can also consider using an Exporter, AllowUnexported, or cmpopts.IgnoreUnexported

Wasn't sure how solve it in a generic manner so that it does not happen when add a new struct, hence moved to reflect.DeepEqual, let me know you have ideas on how to solve it. Thanks.

Copy link
Contributor

@ganeshvanahalli ganeshvanahalli left a comment

Choose a reason for hiding this comment

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

lgtm

@amsanghi amsanghi merged commit efacd68 into master Oct 11, 2023
8 checks passed
@amsanghi amsanghi deleted the test_empty_cli branch October 11, 2023 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants