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

Unit tests for gRPC endpoints and CLI commands #1041

Open
4 tasks
ryanchristo opened this issue Apr 20, 2022 · 2 comments
Open
4 tasks

Unit tests for gRPC endpoints and CLI commands #1041

ryanchristo opened this issue Apr 20, 2022 · 2 comments

Comments

@ryanchristo
Copy link
Member

ryanchristo commented Apr 20, 2022

Summary

We are currently using the integration test suite for gRPC endpoints and CLI commands. This is redundant if we are also writing integration tests for the server implementation. This has also proven difficult to maintain and introduces nuances when checking the length of returned items from queries. Integration tests might not be the best route for gRPC and CLI commands but rather used only with the server implementation methods.

Problem Definition

The current client integration tests are redundant of the integration tests for the server implementation. How to write integration tests is not clear and the client integration tests are difficult to maintain and do not allow us to properly check the length of returned values.

Proposal

Update the client integration tests to unit tests, removing the use of the integration test suite.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@aaronc
Copy link
Member

aaronc commented Apr 20, 2022

I agree integration tests should mostly be focused on the server level using MsgClient/MsgServer directly - basically the level just above unit tests rather than all the way out to CLI.

I guess we could unit test CLI/gRPC with mocks?

I would note that one of my goals in the Cosmos SDK this year is to deprecate manually written CLI and gRPC query methods. Ideally all of that would be auto-generated by reflection on Msgs and ORM definitions in the .proto fiels.

@ryanchristo
Copy link
Member Author

Also relevant to cosmos/cosmos-sdk#12696

@ryanchristo ryanchristo removed the Scope: x/ecocredit Issues that update the x/ecocredit module label Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants