-
Notifications
You must be signed in to change notification settings - Fork 241
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
Write test cases for getting chain data #42
Comments
@RiccardoM Can we reference in test case in cosmos-sdj or you have some idea on testing? |
@HarleyAppleChoi Currently I see two types of tests that could be done. 1. Unit testsThe first thing we could do is increment the coverage by testing the handlers and the other parts that are not tested right now. This can be done by creating a mocked database and then using that to verify the calls are made properly. This is the fastest way to increment the test coverage, but it relies on the fact that the database layer needs to be tested properly. 2. Integration testsThese are the harder one to realize. They are based on a dummy chain that is started and then they listen to the data that is sent to it. The problem with these tests is that they are very complex to setup. Particularly, we would need to:
Honestly, this is very hard to do and can take up even months to be setup properly. ConclusionsWhat I suggest we do is increment the current test coverage by writing the missing unit tests. This means testing the workings of handlers as well as periodic operations. When we have a 84% or more test coverage we can assure that our code is stable. Also, I would add more tests to the database layer trying to push the boundaries to make sure that we test all the limit cases. An example could be passing a I would leave out the testing of the integration with a chain right now since that is also something that should be tested inside Juno as we rely on it for that part. |
Feature description
There should be some function on test cases in the cosmos SDK which we can do test cases on a dummy chain maybe?
The text was updated successfully, but these errors were encountered: