osmosis-labs / osmosis

The AMM Laboratory
https://app.osmosis.zone
Apache License 2.0
885 stars 580 forks source link

Add E2E testing for stargate enabled queries #4631

Open mattverse opened 1 year ago

mattverse commented 1 year ago

Background

One of the core purposes of e2e testing is to test that nothing from the new changes include state breaking changes. Right now, we allow stargate queries via whitelist. Although we are managing the whitelist for better security, we still need additional check on whether none of the stargate registered query changes are state-breaking.

E.g) Imagine a query that was registered in stargate whitelist. Now, let's suppose that in a new PR, we introduce a change in the query logic. Although this PR may not seem state breaking as they are simple "query changes", they actually would be, since they are registered in stargate.

Suggested Design

To solve the problem mentioned above, the proposal is to add e2e testing for all the queries registered in stargate whitelist, and test that they are not state breaking.

p0mvn commented 1 year ago

@mattverse how are you proposing to test whether new changes to queries are state-breaking?

I agree that this would be a valuable change but I'm unsure of how to approach this in e2e

mattverse commented 1 year ago

@p0mvn Srry for the late reply on this, the proposed method is querying and saving results in variables for the queries that are included as stargate queries, and then doing an upgrade to the current branch, then checking if the query results are same. If they are included as a part of stargate queires, they should always have the same results (responses)