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: integration test x/mint #1791

Merged
merged 41 commits into from
May 31, 2023
Merged

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented May 18, 2023

Closes #1790

@rootulp rootulp added the testing items that are strictly related to adding or extending test coverage label May 18, 2023
@rootulp rootulp added this to the Mainnet milestone May 18, 2023
@rootulp rootulp self-assigned this May 18, 2023
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

besides testing for the year thing, it's very likely overkill, but we might also want to test that the funds are actually going where we think they are, so querying for the validator account (named "validator" in the keyring) which has some stake already delegated (or creating a new account and staking), and then looking at the module account that holds the community funds

x/mint/test/mint_test.go Outdated Show resolved Hide resolved
x/mint/types/constants.go Outdated Show resolved Hide resolved
x/mint/test/mint_test.go Outdated Show resolved Hide resolved
x/mint/test/mint_test.go Outdated Show resolved Hide resolved
x/mint/test/mint_test.go Outdated Show resolved Hide resolved
rootulp and others added 2 commits May 22, 2023 12:58
Co-authored-by: Evan Forbes <42654277+evan-forbes@users.noreply.github.com>
rootulp added 10 commits May 22, 2023 13:09
    --- FAIL: TestIntegrationTestSuite/TestTotalSupplyIncreasesOverTime (1.00s)
        /Users/rootulp/git/rootulp/celestia/celestia-app/x/mint/test/suite.go:87: test panicked: runtime error: invalid memory address or nil pointer dereference
            goroutine 2012 [running]:
            runtime/debug.Stack()
            	/opt/homebrew/Cellar/go/1.20.4/libexec/src/runtime/debug/stack.go:24 +0x64
            github.com/stretchr/testify/suite.failOnPanic(0x140047a96c0, {0x104a639a0, 0x105ecebd0})
            	/Users/rootulp/go/pkg/mod/github.com/stretchr/testify@v1.8.2/suite/suite.go:87 +0x34
            github.com/stretchr/testify/suite.Run.func1.1()
            	/Users/rootulp/go/pkg/mod/github.com/stretchr/testify@v1.8.2/suite/suite.go:183 +0x1f4
            panic({0x104a639a0, 0x105ecebd0})
            	/opt/homebrew/Cellar/go/1.20.4/libexec/src/runtime/panic.go:884 +0x204
            github.com/celestiaorg/celestia-app/x/mint/test.(*IntegrationTestSuite).GetTotalSupply(0x140001c1900, 0x0?)
            	/Users/rootulp/git/rootulp/celestia/celestia-app/x/mint/test/mint_test.go:106 +0xdc
            github.com/celestiaorg/celestia-app/x/mint/test.(*IntegrationTestSuite).TestTotalSupplyIncreasesOverTime(0x140001c1900)
            	/Users/rootulp/git/rootulp/celestia/celestia-app/x/mint/test/mint_test.go:62 +0x68
            reflect.Value.call({0x14000df8ac0?, 0x14000d2c928?, 0x140044e2d01?}, {0x103e6a8b7, 0x4}, {0x14000db8e68, 0x1, 0x103e393f0?})
            	/opt/homebrew/Cellar/go/1.20.4/libexec/src/reflect/value.go:586 +0x87c
            reflect.Value.Call({0x14000df8ac0?, 0x14000d2c928?, 0x140001c1900?}, {0x14000db8e68?, 0x1052e1d48?, 0x3d?})
            	/opt/homebrew/Cellar/go/1.20.4/libexec/src/reflect/value.go:370 +0x90
            github.com/stretchr/testify/suite.Run.func1(0x140047a96c0)
            	/Users/rootulp/go/pkg/mod/github.com/stretchr/testify@v1.8.2/suite/suite.go:197 +0x3f0
            testing.tRunner(0x140047a96c0, 0x14004bbed80)
            	/opt/homebrew/Cellar/go/1.20.4/libexec/src/testing/testing.go:1576 +0x10c
            created by testing.(*T).Run
            	/opt/homebrew/Cellar/go/1.20.4/libexec/src/testing/testing.go:1629 +0x368
    /Users/rootulp/git/rootulp/celestia/celestia-app/x/mint/test/full_node.go:226: tearing down testnode
timestamps don't appear to be advancing by 10 days per block:

latestTimestamp 2023-05-24 16:25:25.810474 -0400 EDT
latestTimestamp 2023-05-24 16:25:27.009179 -0400 EDT
latestTimestamp 2023-05-24 16:25:27.906415 -0400 EDT
latestTimestamp 2023-05-24 16:25:28.804406 -0400 EDT
latestTimestamp 2023-05-24 16:25:29.713275 -0400 EDT
latestTimestamp 2023-05-24 16:25:30.910224 -0400 EDT
latestTimestamp 2023-05-24 16:25:31.804267 -0400 EDT
latestTimestamp 2023-05-24 16:25:33.028104 -0400 EDT
latestTimestamp 2023-05-24 16:25:33.917395 -0400 EDT
latestTimestamp 2023-05-24 16:25:34.807346 -0400 EDT
latestTimestamp 2023-05-24 16:25:36.011127 -0400 EDT
latestTimestamp 2023-05-24 16:25:36.910078 -0400 EDT
latestTimestamp 2023-05-24 16:25:37.805972 -0400 EDT
latestTimestamp 2023-05-24 16:25:39.009305 -0400 EDT
latestTimestamp 2023-05-24 16:25:39.907823 -0400 EDT
latestTimestamp 2023-05-24 16:25:40.811224 -0400 EDT
latestTimestamp 2023-05-24 16:25:42.007382 -0400 EDT
latestTimestamp 2023-05-24 16:25:42.913254 -0400 EDT
latestTimestamp 2023-05-24 16:25:43.806334 -0400 EDT
latestTimestamp 2023-05-24 16:25:44.708312 -0400 EDT
@codecov-commenter
Copy link

codecov-commenter commented May 24, 2023

Codecov Report

Merging #1791 (1452079) into main (db15dcb) will decrease coverage by 0.03%.
The diff coverage is 19.67%.

@@            Coverage Diff             @@
##             main    #1791      +/-   ##
==========================================
- Coverage   21.82%   21.80%   -0.03%     
==========================================
  Files         116      117       +1     
  Lines       13247    13306      +59     
==========================================
+ Hits         2891     2901      +10     
- Misses      10065    10114      +49     
  Partials      291      291              
Impacted Files Coverage Δ
test/util/testnode/node_interaction_api.go 0.00% <0.00%> (ø)
x/mint/types/constants.go 100.00% <100.00%> (ø)
x/mint/types/minter.go 71.11% <100.00%> (+2.81%) ⬆️

initial supply: 100000001145805461utia
initial timestamp: 100000001145805461utia
wantAsFloat: 8
latestTimestamp 2023-05-27 22:51:42.033432 +0000 UTC
later supply: 100000001449542529utia
later timestamp: 2023-05-27 22:51:42.033432 +0000 UTC
wantAsFloat: 7.2
latestTimestamp 2023-05-27 22:51:42.935906 +0000 UTC
latestTimestamp 2023-05-27 22:51:43.838663 +0000 UTC
latestTimestamp 2023-05-27 22:51:45.03145 +0000 UTC
latestTimestamp 2023-05-27 22:51:45.93342 +0000 UTC
latestTimestamp 2023-05-27 22:51:46.835305 +0000 UTC
latestTimestamp 2023-05-27 22:51:48.037924 +0000 UTC
latestTimestamp 2023-05-27 22:51:48.934952 +0000 UTC
latestTimestamp 2023-05-27 22:51:49.837673 +0000 UTC
latestTimestamp 2023-05-27 22:51:51.03862 +0000 UTC
latestTimestamp 2023-05-27 22:51:51.934761 +0000 UTC
latestTimestamp 2023-05-27 22:51:52.832512 +0000 UTC
latestTimestamp 2023-05-27 22:51:54.041073 +0000 UTC
latestTimestamp 2023-05-27 22:51:54.938937 +0000 UTC
latestTimestamp 2023-05-27 22:51:55.834115 +0000 UTC
latestTimestamp 2023-05-27 22:51:57.036927 +0000 UTC
latestTimestamp 2023-05-27 22:51:57.937073 +0000 UTC
latestTimestamp 2023-05-27 22:51:58.837436 +0000 UTC
latestTimestamp 2023-05-27 22:52:00.044855 +0000 UTC
latestTimestamp 2023-05-27 22:52:00.93712 +0000 UTC
latestTimestamp 2023-05-27 22:52:01.841579 +0000 UTC
wantAsFloat: 8
inflationRate 0.081714102022966438
startTimestamp 2024-05-28 09:08:16.58339 +0000 UTC, endTimestamp: 2025-05-28 14:57:28.58339 +0000 UTC
startHeight: 38, endHeight: 75
wantAsFloat: 7.2
inflationRate 0.075374835778984813
@rootulp rootulp requested a review from evan-forbes May 29, 2023 04:19
@rootulp rootulp marked this pull request as ready for review May 29, 2023 04:22
@rootulp rootulp requested a review from cmwaters as a code owner May 29, 2023 04:22
cmwaters
cmwaters previously approved these changes May 30, 2023
Copy link
Contributor

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

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

LGTM. Few comments, but nothing blocking

x/mint/test/mint_test.go Outdated Show resolved Hide resolved
x/mint/test/mint_test.go Outdated Show resolved Hide resolved
@rootulp rootulp requested a review from cmwaters May 30, 2023 17:14
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

nice, no blocking comments or really that much more than the initial review!

x/mint/test/mint_test.go Outdated Show resolved Hide resolved
x/mint/test/mint_test.go Outdated Show resolved Hide resolved
x/mint/test/mint_test.go Show resolved Hide resolved
evan-forbes
evan-forbes previously approved these changes May 30, 2023
Co-authored-by: Evan Forbes <42654277+evan-forbes@users.noreply.github.com>
evan-forbes
evan-forbes previously approved these changes May 30, 2023
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

apruuve 👍

@MSevey MSevey requested a review from a team May 31, 2023 18:25
@evan-forbes evan-forbes requested review from rach-id and removed request for a team May 31, 2023 18:25
@rootulp rootulp enabled auto-merge (squash) May 31, 2023 20:03
@rootulp rootulp merged commit 9780f96 into celestiaorg:main May 31, 2023
15 checks passed
@rootulp rootulp deleted the rp/test-inflation branch June 1, 2023 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing items that are strictly related to adding or extending test coverage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integration test x/mint module
5 participants