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: add simulation tests #98

Merged
merged 35 commits into from
Sep 14, 2021

Conversation

jaybxyz
Copy link
Contributor

@jaybxyz jaybxyz commented Sep 8, 2021

Description

This PR is contiunation of #83 that include simulation tests for both public and private plans.

closes: #64 #88

Actions

  • add simulation tests for private plans (store decoders, randomized genesis and params, random weighted operations)
  • add simulation tests for public plans (random proposal contents)
  • add verification for duplicate plan name for private plans Add public and private plan creation #11

Further improvements

We need to come up with better ways to simulate public plan proposals. Currently, only basic logics are written.

And after genesis functionality with F1 logic is implemented, we plan to add below simulations

  • add simulation test for running runsim to test import and export simulation
  • add simulation test for running runsim to test simulation after import

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Appropriate labels applied
  • Targeted PR against correct branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

jaybxyz added 20 commits August 18, 2021 23:25
* master:
  fix: solve module, sdk issues
  test: improve code coverage
  test: add cli integration tests
  test: add integration cli test for ratio plan, stake, and unstake
  refactor: update description and use string slice flag for harvest for better developer experience
  feat: add integration test for create fixed amount plan command-line interface
…64-simulation-test

* commit '6dea151437ce42ffd0b68c5486fa210195ce6696':
  feat: add genesis functionality (tendermint#87)
@jaybxyz jaybxyz added the test and simulation test and simulation label Sep 8, 2021
@jaybxyz jaybxyz self-assigned this Sep 8, 2021
@jaybxyz jaybxyz mentioned this pull request Sep 9, 2021
9 tasks
@jaybxyz jaybxyz changed the title test: add simulation test for public plan proposals test: add simulation tests Sep 9, 2021
@codecov
Copy link

codecov bot commented Sep 9, 2021

Codecov Report

Merging #98 (f6222e3) into master (566057d) will increase coverage by 9.26%.
The diff coverage is 83.19%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #98      +/-   ##
==========================================
+ Coverage   55.38%   64.64%   +9.26%     
==========================================
  Files          23       24       +1     
  Lines        1728     2062     +334     
==========================================
+ Hits          957     1333     +376     
+ Misses        662      598      -64     
- Partials      109      131      +22     
Impacted Files Coverage Δ
x/farming/keeper/genesis.go 76.31% <ø> (ø)
x/farming/keeper/proposal_handler.go 36.84% <0.00%> (-0.57%) ⬇️
x/farming/types/codec.go 0.00% <ø> (-4.77%) ⬇️
x/farming/types/genesis.go 49.12% <0.00%> (-2.67%) ⬇️
x/farming/types/proposal.go 3.61% <0.00%> (+0.04%) ⬆️
x/farming/module.go 53.84% <14.28%> (-1.90%) ⬇️
x/farming/simulation/proposals.go 80.67% <80.67%> (ø)
x/farming/types/plan.go 37.34% <81.81%> (+6.72%) ⬆️
x/farming/keeper/staking.go 90.47% <84.61%> (-0.23%) ⬇️
x/farming/simulation/operations.go 92.12% <89.63%> (+92.12%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 566057d...f6222e3. Read the comment docs.

- add request public plan proposal
- update request public plan proposal
- delete request public plan proposal
- comment TODO to improve public plans logic
@jaybxyz
Copy link
Contributor Author

jaybxyz commented Sep 10, 2021

Running runsim to test import/export simulation returns panic panic: expected PlanI, got <nil>.
This issue is related to #90. I will need to get back on this since there is more imminent issue to take care of.

* master:
  docs: update README.md
  build: bump sdk to v0.44.0
@dongsam dongsam self-assigned this Sep 10, 2021
@dongsam dongsam marked this pull request as ready for review September 13, 2021 12:28
@dongsam dongsam requested a review from hallazzang September 13, 2021 12:28
Copy link
Contributor Author

@jaybxyz jaybxyz left a comment

Choose a reason for hiding this comment

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

LGTM on simulation part. As you have stated offline, let's tackle this with other PR(s) since this PR is becoming huge.

@dongsam dongsam requested a review from hallazzang September 14, 2021 07:25
@dongsam dongsam merged commit 14db7b7 into tendermint:master Sep 14, 2021
@dongsam dongsam mentioned this pull request Sep 14, 2021
16 tasks
@dongsam dongsam linked an issue Sep 14, 2021 that may be closed by this pull request
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test and simulation test and simulation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement simulation for public proposal plans Add Simulation functions
3 participants