-
Notifications
You must be signed in to change notification settings - Fork 373
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
feat: add r/sys/params + params genesis support #3003
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
I believe that Codecov has false negatives. It flags lines that are actually tested at least twice. |
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
@@ -59,6 +59,7 @@ func TestingNodeConfig(t TestingTS, gnoroot string, additionalTxs ...std.Tx) (*g | |||
|
|||
creator := crypto.MustAddressFromString(DefaultAccount_Address) // test1 | |||
|
|||
params := LoadDefaultGenesisParamFile(t, gnoroot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gfanton, I think there is a problem with Codecov. Can you check why this line isn't reported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it's only used by txtar
files in gno.land
, unfortunately, the gno.land
txtar
doesn't set up coverage yet. I suggest you ignore this for now. Ideally, I would like to take some time centralize the logic of txtar
from both gnovm
and gno.land
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you want to avoid losing too much coverage by taking advantage of txtar
. Let me see if I can find a shortcut.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just looking for my PR to be green, because I wrote tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it looks like your issue has nothing to do with txtar
.
By default, Go's test coverage tool only considers the packages that are directly imported by the package containing the tests. This means that if you have a package dependency chain like:
- Package A (contains tests) imports Package B
- Package B imports Package C
Coverage will be calculated for Package A and Package B, but Package C will not be included in the coverage report unless explicitly specified. This is because Go's default behavior is to only instrument the packages directly involved in the test run.
In your case:
- Package A is the package that holds the test file in
gno.land/cmd/gnoland
- Package B is
gno.land/pkg/integration
, and it's the package that will actually run thetxtar
- Package C is the package that contains
LoadDefaultGenesisParamFile
and will not be covered by your test
There are 2 possible fixes for this:
- The first one, more global, is to tell Go to test and cover all packages under
gno.land
using-coverpkg=github.com/gnolang/gno/gno.land/...
. This way, all packages and sub-package imports will be taken into consideration; it can be a good solution but at the expense of slower tests. - The second solution, more specific to your PR, is to reduce the chain dependency of your test. That means simply moving your
params.txtar
fromgno.land/cmd/gnoland/testadata
togno.land/pkg/integration/testdata
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in favor of option 1, unless "slower" means "way too much slower."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this: #3088?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this: #3088?
see my comment #3088 (comment)
Ready for review. The CI is red, but the new code is tested. |
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Closer to the current `// Realm:` output, and more git-friendly. Bigger example in #3003. Signed-off-by: moul <[email protected]>
r/sys/params
genesis/genesis_params.toml
Depends on #2920
Depends on #3003 (cherry-picked)
Blocking #2911