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 tests for grpc operations #6870

Closed
wants to merge 2 commits into from
Closed

test: add tests for grpc operations #6870

wants to merge 2 commits into from

Conversation

ihexxa
Copy link
Contributor

@ihexxa ihexxa commented Nov 24, 2023

Background

Originally it aimed to fix a grpc issue but ends up with adding tests. : \

Changes

  • test: add 2 cases for bidirectional and client side streaming

@ihexxa ihexxa self-assigned this Nov 24, 2023
@ihexxa ihexxa marked this pull request as draft November 24, 2023 10:13
@marckong
Copy link
Contributor

marckong commented Nov 27, 2023

Is this PR making style changes or actually adding or refactoring the changes?

nit:

Table driven tests are great when there are persistent and SIMPLE patterns for tests, but they are no longer great when such patterns break or done with complex patterns. I actually don't prefer table driven test approach at all for readability and difficulty to extend the test when it is needed.

In my opinion, tests should be so dumb that anyone reading a particular failed case can understand it easily. Table driven approach fails at this for me.

@ihexxa
Copy link
Contributor Author

ihexxa commented Nov 29, 2023

@marckong yes, I'm checking if I'm able to quickly fix one gRPC requirement for specifying headers.

Good point of table driven testing 👍 , ideally tests should provide great readability and cover as more as possible of code, while practically tests will become bloated quickly if we keep adding test cases. Then it would introduce another kind of readability problem in maintaining, for example, we may need to read and refactor each test case if one new step is added to the workflow, as it is not DRY.

But currently it is not a problem for grpc, let me rollback to the traditional style.

@ihexxa ihexxa changed the title test: make grpc tests driven by table fix: user can't modify headers before sending request Nov 29, 2023
@ihexxa ihexxa changed the title fix: user can't modify headers before sending request fix: user can't modify headers before sending grpc request Nov 29, 2023
@ihexxa ihexxa changed the title fix: user can't modify headers before sending grpc request test: add tests for grpc operations Jan 8, 2024
@ihexxa ihexxa marked this pull request as ready for review April 29, 2024 06:56
@ihexxa
Copy link
Contributor Author

ihexxa commented May 8, 2024

It might useful at sometime, closing this at the moment.

@ihexxa ihexxa closed this May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants