7 API Testing Tools That Support gRPC

7 API Testing Tools That Support gRPC

Posted in

gRPC is becoming increasingly popular, and for a good reason. It’s incredibly fast, for one thing, clocking in at up to 12x the speed of REST APIs. It’s also great for microservice environments and streaming data.

In case you’re not yet familiar with gRPC, it stands for Google Remote Procedure Call. Think of a remote procedure call (RPC) as a function that can be invoked on a separate system. The Google-developed approach to remote procedure calls is quite a robust solution with significant backing in the industry. That being said, gRPC is relatively newer compared to something like REST or SOAP, and as such, the development of tooling for gRPC testing is still ongoing.

With gRPC adoption on the rise, there’s an increasing need for gRPC testing to accompany the surge in interest. gRPC testing lets you ensure your gRPC APIs are performing as they should. It’s also an important component of a CI/CD pipeline as you need to monitor to ensure every component is working as it should.

With that in mind, we’ve evaluated seven API testing tools that now support gRPC. Some of these tools are more general, while others are more specific, but they all present an interesting potential for any developer wanting to implement more robust testing regiments upon their gRPC codebases.

1. Postman

Postman is one of the most popular and widely-used API management platforms. And as of Postman v9.7.1, gRPC is supported through an open beta implementation.

Using Postman for gRPC testing is ideal as it can be easily integrated into your existing API testing workflow. Postman’s popularity means you won’t have to learn a whole new tool to automate your gRPC testing, as an additional benefit. Given your API development team is likely already familiar with Postman, they won’t have to expend time looking for monitoring tools, output, or documentation.

Postman utilizes the Protobuf definition to parse the complete approach and implementation of the gRPC instance and unlock rapid testing and iteration. Notably, it also allows for saving the Protobuf definition to the Postman cloud, a collaborative cloud offering.

Postman notes the following features in its blog post announcing support:

  • Call unary, client-streaming, server-streaming, and bidirectional-streaming gRPC methods
  • Enjoy autocomplete while composing messages (powered by the Protobuf definition being used)
  • Client-side type-checking and type annotations (Pro tip: while composing your message, hover over a field name to see its Protobuf type)
  • Load services using gRPC server reflection
  • Automatically generate example messages with a single click
  • Send metadata, and view incoming metadata
  • Cancel a gRPC method at any time
  • Variable interpolation using environments
  • Advanced streaming features, such as searching and filtering streamed messages
  • Import, author, share, and inspect Protobuf definitions with syntax highlighting and autocomplete
  • Synchronize the proto files in your API with your repository on Github, Bitbucket, Gitlab, or Azure Repos

Utilizing Postman for gRPC testing is pretty simple. In the left-hand sidebar, select “New” and select “gRPC Request.” From here, you insert the address to the gRPC server, upload the Protobuf file, and then select the service and method. Once you click “Invoke,” your Protobuf is parsed and merged into your Postman testing view.

Benefits of Using Postman for gRPC Testing:

  • Easy to use
  • Familiarity
  • Easily integrates into your existing API testing workflow
  • No additional installations
  • Robust community support
  • Speed and accuracy

2. Insomnia

Kong’s Insomnia is another popular API testing platform thanks to its open-source format and support for various API specifications. Now Kong Insomnia is even more useful with its adoption of gRPC testing.

Insomnia is a good pick for gRPC testing for many of the same reasons as Postman. It’s popular, so many developers already know how to use it and have it installed. It also makes it easy to include your gRPC testing alongside your existing API testing workflow. Insomnia also supports all four gRPC types — unary, client streaming, server streaming, and bidirectional streaming. This makes it useful for testing streaming environments and projects. Last but not least, Insomnia lets you convert between SSL and TLS. They have plans to implement custom certificates for gRPC testing in the near future, as one final benefit.

Insomnia supports gRPC in a similar way, allowing the uploading of a Protobuf file (or a director of Protobuf files) for parsing. There are some notable differences from the Postman implementation, a fact that Insomnia acknowledges in its limitations documentation (which we’ll get into in just a second).

Insomnia supports a wide array of features, including:

  • Support for unary, server streaming, client streaming, and bidirectional streaming RPC.
  • Request canceling, as well as individual request cancellation in the case of concurrent requests.
  • TLS/SSL, with a custom certification system currently in development (but not live in production).
  • Support for environment variables and template tags.

Insomnia does note that its implementation currently has a few limitations that can affect the testing experience of a gRPC developer. As of version 2021.1, gRPC in Insomnia does not include:

  • Support for running gRPC requests in unit tests
  • Support for request chaining
  • Support for gRPC deadlines
  • Persistence of request/responses and history
  • Moving gRPC requests between workspaces
  • If a folder that contains a gRPC request is moved to a different workspace, the request will be moved, but the proto file will not.

To test gRPC with Insomnia, simply click “New Request” in the sidebar, select gRPC as the method, and click “Create.” From here, you click “Add Proto File” and upload your Protobuf. Next, click “Save.” Finally, click “Select Method” in the sidebar request area, and you should see the services defined in your Protobuf ready to test.

Benefits of Insomnia for gRPC Testing:

  • Popular
  • Easy to use
  • Familiar
  • Supports all four gRPC types
  • SSL/TLS conversion
  • Custom certifications support in the works

3. Kreya App

Kreya is a dedicated app for API testing. This means that it’s available across multiple platforms, for one thing. It also makes it easy to deploy automated gRPC testing using Kreya right out of the box, as it handles many of the technicalities for you. It’s also got a slick interface, making it easy to use and understand for those a little less technically proficient.

Kreya is a robust API testing platform in its own right. In addition to gRPC, Kreya supports API testing for the other most popular API specifications, from REST to GraphQL, so it’s easy to implement alongside your gRPC testing. Kreya was developed after Postman had already risen to popularity, allowing it to address some of its shortcomings. It’s more streamlined than Postman, for starters. You’re also able to reuse authentication without making several calls. This can make your gRPC testing much faster, more efficient, and consume fewer resources.

The implementation and support are pretty straightforward. Kreya functions like any other desktop application, so once it’s installed, the process of adding a gRPC collection is relatively easy. You can use either the project setup screen on first boot or the importer function to import a Protobuf, which will be parsed and available for testing through the Project management pane.

The main argument in favor of Kreya is that it is entirely built around a GUI tooling approach that reduces the barrier to entry for developers. Packaging the testing flow into a single, easy-to-use application with support for Linux, Windows, and Mac makes it much easier to support testing gRPC functions. This lends itself quite readily to novice developers.

That said, not everyone will want a GUI-heavy testing implementation, especially when using a very thin client better suited for a web testing environment. Additionally, Kreya is not open source. This might not be a dealbreaker but is worth noting.

Benefits of Kreya App for gRPC Testing:

  • Cross-platform
  • Slick interface
  • Easy to use
  • Streamlined and efficient
  • Reuse authentication
  • Supports multiple API specifications
  • Easily integrate gRPC testing alongside existing API test workflows

4. gRPC UI

gRPC UI can be run from the command line, making it an ideal choice if you want to do everything from the CLI. Once you run gRPC UI, its GUI is accessible via a web browser, serving as a graphical extension of grpcurl. This makes it an ideal choice for portable gRPC testing.

gRPC UI only supports gRPC, however, unlike the other API testing solutions we’ve looked at so far. If you’re looking for an all-in-one solution for all of your API testing, look elsewhere. If you’re just looking for a lightweight, portable, and efficient environment solely for gRPC, gRPC UI is worth a look.

Benefits of gRPC UI for gRPC Testing:

  • Lightweight, gRPC-specific testing
  • Run from the command line
  • Web-based GUI
  • Portable

5. Wombat

Wombat is another tool in the general family of GUI-specific implementations, offering a Mac, Linux, and Windows executable. Just like Kreya, Wombat carries with it some particular caveats when it comes to GUI interfaces. Still, it is important to note that it carries an Arch Linux implementation which may reduce the overall demand of the application-centric approach.

That being said, Wombat offers a variety of testing features, noting the following as its feature list:

  • Automatic parsing of proto definitions to render services and input messages
  • .proto file discovery
  • Selection of multiple services and methods
  • Configuration of TLS, including disabling TLS (plain text)
  • Input generation for all scalar types
  • Input generation for nested messages
  • Input generation for enums, including nested
  • Input generation for repeated fields
  • Input generation for oneof and map fields
  • Support for adding RPC metadata
  • Execute unary requests
  • Execute server streaming requests
  • Execute client streaming requests
  • Execute bidirectional requests
  • Cancel requests in-flight
  • Send EOF for client streaming and bi-directional streaming
  • View response messages
  • View RPC Header and Trailer
  • View full RPC statistics
  • MacOS build
  • Linux build
  • Windows build
  • Reflection API to determine RPC schema
  • Support for Google Well Known Types
  • Create multiple workspaces and workspace switching

6. gRPC-swagger

gRPC-swagger takes the much-loved Swagger toolset and expands it through the use of gRPC reflection, a protocol that allows for servers to create runtime constructions of requests without the need to precompile the stub information for the client. Essentially, the server is “reflected,” reducing the build load for testing and introducing a good amount of flexibility to the process. gRPC-swagger is an addendum to swagger-ui, offering this gRPC functionality in an easy-to-use integration that adds to its own benefits the massive usability and developer-friendly approach of Swagger.

gRPC-swagger offers the following stub as its feature list, but it should be remembered that, technically, implementing this requires the implementation of Swagger itself, adding both the pros and cons of that framework into the general consideration of this toolset:

  • Easy to use, just need enable reflection when starting the service, without modifying protos and related implementations.
  • Integrated with swagger-ui, you can see the definitions of gRPC methods and parameters conveniently.
  • Simple to call gRPC method.

Utilizing gRPC-swagger is quite simple. Here are the steps noted within its documentation:

  • Run gRPC-swagger, referring to Build and Run
  • Enable reflection when starting service. Below is a Java example:
add dependency to pom.xml:
<dependency>
    <groupId>io.grpc</groupId>
    <artifactId>grpc-services</artifactId>
    <version>${grpc.version}</version>
</dependency>
enable reflection:
Server server = ServerBuilder.forPort(SERVER_PORT)
    .addService(new HelloServiceImpl())
    .addService(ProtoReflectionService.newInstance())
    .build()
    .start();
  • Register endpoint. Open this page, input necessary message and click register button, gRPC-swagger will automatically scan available services and return successful registered services when finished. You can click service link jump to ui page.
  • Use swagger-ui to see gRPC services.
  • Click Try it out button to have a test on the gRPC method.

7. ghz

We’ll round things out with one final CLI tool for gRPC testing. ghz has a lot in common with gRPC UI but with a slightly slicker interface. It can be run from the command line, so it’s also good for portable gRPC testing. Its GUI is run in the web browser as well, so you can access your gRPC testing tools wherever you are. It even features a web app that lets you save, view, track, and analyze your results. The tool offers more flexibility in terms of reporting, too. You can view gRPC test results in CLI, CSV, HTML, JSON, or Influx Data.

Benefits of ghz for gRPC Testing:

  • Run from the command line
  • Web-based GUI
  • Web app for analysis
  • Flexible format outputs
  • Custom data for testing
  • Supports unary and streaming data

Final Thoughts on gRPC Testing

In many ways, our APIs are only as good as our API testing tools. This is just as true for gRPC as any other API specification, if not more so. Given that 85% of organizations are already using microservices, with more on the way, a lot of developers are going to be getting into gRPC in the near future.

As gRPC sees wider adoption and more implementations, the testing that has sprouted up around it has become more robust and powerful. gRPC offers a lot of functionality that mirrors RESTful applications from the perspective of the end user, so it’s great to see so many providers offering support for both REST and gRPC as a solution, enabling better support across more development paradigms.

gRPC testing also ensures that our gRPC tools perform the way we need them to. gRPC testing tools let us run our gRPC tools through the paces, simulating situations they might run into in the real world so you can make sure they’re ready for launch and able to serve our customers the way they deserve.

These solutions are great, though they often have specific caveats for their use case. Do you know of any other gRPC testing platforms? Let us know in the comments below!