-
Notifications
You must be signed in to change notification settings - Fork 224
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
Add gRPC testing guide #1846
Add gRPC testing guide #1846
Conversation
Can't run the example without downloading the protobuf definition :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful write-up ❤️ Added some suggestions. Feel free to skip them!
docs/sources/k6/next/testing-guides/performance-testing-grpc-services.md
Outdated
Show resolved
Hide resolved
- [k6 gRPC Module API](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-net-grpc/) | ||
- [k6 QuickPizza: A demo service for gRPC](grpc-quickpizza.grafana.com:443) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With dots:
- [k6 gRPC Module API](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-net-grpc/) | |
- [k6 QuickPizza: A demo service for gRPC](grpc-quickpizza.grafana.com:443) | |
- [k6 gRPC Module API](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-net-grpc/). | |
- [k6 QuickPizza: A demo service for gRPC](grpc-quickpizza.grafana.com:443). |
|
||
### Create the test | ||
|
||
The gRPC module is a separate module, available from your test script as `k6/net/grpc`. Before you can use it, you first have to create an instance of the client. Instantiating the client, as well as the `.load` operation, is only available during test initialization, that is, directly in the global scope. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, we say ".load
operation", but below, we say ".load()
function". Should we keep them consistent, like .load()
function?
I also wonder if using a dot prefix is a common practice in our docs. I'd omit the dot for simplicity (i.e., load()
function). Or, it can be Client.load()
if we want to keep it verbose and explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point, I think we can just refer to it as load()
function.
const client = new grpc.Client(); | ||
``` | ||
|
||
Next, load a `.proto` definition applicable for the system under test. For the purpose of this article, you can use [QuickPizza](grpc-quickpizza.grafana.com:443). The `.load()` function takes two arguments, the first one being an array of paths to search for proto files, and the second being the name of the file to load. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clicking on the QuickPizza link won't work for every user. Should we add a notice?
docs/sources/k6/next/testing-guides/performance-testing-grpc-services.md
Outdated
Show resolved
Hide resolved
Co-authored-by: İnanç Gümüş <[email protected]>
docs/sources/k6/next/testing-guides/performance-testing-grpc-services.md
Outdated
Show resolved
Hide resolved
docs/sources/k6/next/testing-guides/performance-testing-grpc-services.md
Outdated
Show resolved
Hide resolved
|
||
### Create the test | ||
|
||
The gRPC module is a separate module, available from your test script as `k6/net/grpc`. Before you can use it, you first have to create an instance of the client. Instantiating the client, as well as the `.load` operation, is only available during test initialization, that is, directly in the global scope. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point, I think we can just refer to it as load()
function.
What?
Migrate the Performance testing gRPC services to the Testing guides section.
Checklist
npm start
command locally and verified that the changes look good.docs/sources/k6/next
folder of the documentation.docs/sources/k6/v{most_recent_release}
folder of the documentation.Related PR(s)/Issue(s)