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: upgrade testing automation #1389

Merged
merged 27 commits into from
May 5, 2022
Merged

test: upgrade testing automation #1389

merged 27 commits into from
May 5, 2022

Conversation

czarcas7ic
Copy link
Member

@czarcas7ic czarcas7ic commented May 2, 2022

Closes: #1333 , #1235

What is the purpose of the change

This pull request follows the methodology laid out in #1333 to complete the minimum viable product needed for #1235

Process

  • Modified the v7 init docker image to reduce the vote time to 30 seconds
  • Checks out a v7 init docker image from dockerhub and initializes the genesis and config files
  • Checks out a v7 osmosis image from dockerhub and utilizes the initialized genesis and config to spin up two separate chains, along with a hermes image that connects the two chains via IBC
  • Submits a v8 upgrade prop, funds, and votes for it on both chains
  • Ensures upgrade height is reached and then no longer hits blocks
  • Stops all containers and replaces them with the locally compiled v8 image
  • Ensures blocks are hit on both chains
  • Proceeds with remaining tests

Testing and Verifying

This change is already covered by existing e2e test suite. This was tested locally and through github CI

Here is an example of the test output

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes? yes
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? no
  • How is the feature or change documented? none

Notes / Next Steps

From here, we can create an environment variable that allows us to skip upgrade testing and instead only compile locally and go though the chain tests. This will save us time instead of having to go through the upgrade process for every commit.

Another important note, I removed the locally compile osmosis-init-image step here since it is not needed at the moment. When we introduce the environment variable addressed above, we will need to re-add this to compile the v8 init image instead of compiling with the v7 init image from docker hub. We should split these into two separate make tests so that way we are only compiling the docker images we absolutely need. The full upgrade testing takes only 8 minutes though.

Another note, I need to backport the config changes to v7.x that changes the gov voting period

Last note, we need to change the test.yml because if you can make a commit that does not pass the e2e-test at first, but if you do a second commit that does not trigger this enc.GIT_DIFF, it will skip the test despite actually not passing it. cc @daniel-farina if you know how to go about fixing this. I know it will run on a PR which is all that really matters, but in my mind I feel if it fails once instead of just skipping it the second time it should show "still fails" if that makes sense.

Makefile Outdated Show resolved Hide resolved
tests/e2e/chain/config.go Outdated Show resolved Hide resolved
tests/e2e/scripts/osmosis_upgrade.sh Outdated Show resolved Hide resolved
Copy link
Member

@p0mvn p0mvn left a comment

Choose a reason for hiding this comment

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

Nice work, left some comments. Please take a look

tests/e2e/Dockerfile Outdated Show resolved Hide resolved
tests/e2e/e2e_test.go Outdated Show resolved Hide resolved
tests/e2e/chain/config.go Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented May 4, 2022

Codecov Report

Merging #1389 (c8f8f59) into main (f56fbe5) will decrease coverage by 0.28%.
The diff coverage is 17.22%.

@@            Coverage Diff             @@
##             main    #1389      +/-   ##
==========================================
- Coverage   19.82%   19.53%   -0.29%     
==========================================
  Files         202      226      +24     
  Lines       27685    30953    +3268     
==========================================
+ Hits         5489     6048     +559     
- Misses      21175    23800    +2625     
- Partials     1021     1105      +84     
Impacted Files Coverage Δ
x/epochs/client/cli/query.go 0.00% <ø> (ø)
x/gamm/client/cli/query.go 36.74% <0.00%> (-0.36%) ⬇️
x/gamm/pool-models/stableswap/amm.go 40.27% <0.00%> (-15.50%) ⬇️
x/gamm/pool-models/stableswap/msgs.go 0.00% <0.00%> (ø)
x/gamm/pool-models/stableswap/pool.go 0.00% <0.00%> (ø)
x/gamm/pool-models/stableswap/stableswap_pool.go 0.00% <0.00%> (ø)
.../gamm/pool-models/stableswap/stableswap_pool.pb.go 0.58% <0.00%> (-0.09%) ⬇️
x/gamm/types/pool.go 0.00% <ø> (ø)
x/incentives/client/cli/query.go 0.00% <ø> (ø)
x/incentives/keeper/distribute.go 61.00% <0.00%> (ø)
... and 49 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 5166db4...c8f8f59. Read the comment docs.

@czarcas7ic czarcas7ic requested a review from a team May 4, 2022 02:20
Co-authored-by: Roman <roman@osmosis.team>
Copy link
Member Author

@czarcas7ic czarcas7ic left a comment

Choose a reason for hiding this comment

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

Thanks for the review, resolved everything that I added in the following commit. Just had a few clarifying questions.

tests/e2e/chain/config.go Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Show resolved Hide resolved
@czarcas7ic czarcas7ic requested review from p0mvn and alexanderbez May 4, 2022 19:35
Comment on lines 22 to 24
telemetryEnabled bool
telemetryRetentionTime int64
prometheusEnabled bool
Copy link
Member

Choose a reason for hiding this comment

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

Why would we ever need these in a CI job?

@@ -249,7 +266,7 @@ func initNodes(c *internalChain) error {
return nil
}

func initValidatorConfigs(c *internalChain) error {
func initValidatorConfigs(c *internalChain, pruning string, pruningKeepRecent string, pruningInterval string, snapshotInterval uint64, snapshotKeepRecent uint32, telemetryEnabled bool, telemetryRetentionTime int64, prometheusEnabled bool) error {
Copy link
Member

@p0mvn p0mvn May 5, 2022

Choose a reason for hiding this comment

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

I think these configs should instead be per-validator. Can we do this in a separate PR?

I think we should limit the scope of this one to just the upgrade and keep adding on top of it after. Otherwise, we might have to keep iterating on this large PR for some time. Let me know your thoughts

Copy link
Member

@p0mvn p0mvn left a comment

Choose a reason for hiding this comment

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

Great work on the updates. Left some comments, let me know what you think. Also, already DMed you about potentially moving chain parameters to a separate PR if that's not too much trouble

tests/e2e/e2e_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Show resolved Hide resolved
Closes: #1277

## What is the purpose of the change

This PR adds scaling factors to current stable swap implementation. 

For context on why scaling factors are needed: Suppose 1000 stablecoin1 equals 1 dollars, 100 stablecoin2 equals 2 dollars due to precision difference. Currently we compare each pool assets without considering these differences in precisions in `calcOutAmtGivenIn`, `calcInAmtGivenOut`, `SpotPrice`. 

This PR adds a field of scaling factors for each pool asset so that when internally calculating in `amm.go`, we compare two different assets upon same precision points. We do this by feeding the internal functions assets / scaling factors.

## Brief change log

- Adds scaling factor to stableswap
*(for example:)*
 
  - *The metadata is stored in the blob store on job creation time as a persistent artifact*
  - *Deployments RPC transmits only the blob storage reference*
  - *Daemons retrieve the RPC data from the blob cache*


## Testing and Verifying

This change is a trivial rework / code cleanup without any test coverage.


## Documentation and Release Note

  - Does this pull request introduce a new feature or user-facing behavior changes? yes
  - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? no
  - How is the feature or change documented? not applicable
@github-actions github-actions bot added the C:x/gamm Changes, features and bugs related to the gamm module. label May 5, 2022
Copy link
Member

@p0mvn p0mvn left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot removed the C:x/gamm Changes, features and bugs related to the gamm module. label May 5, 2022
@czarcas7ic czarcas7ic merged commit 94caf2b into main May 5, 2022
@czarcas7ic czarcas7ic deleted the adam/e2e-upgrade branch May 5, 2022 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[E2E - Upgrade Testing] logic for testing upgrade process
6 participants