DEV Community

Cover image for Use Grillon to test your Rust HTTP API! 0.5.0-alpha.1 is out!
theredfish for Owl Duty

Posted on • Edited on

Use Grillon to test your Rust HTTP API! 0.5.0-alpha.1 is out!

Hey Rustaceans!

Many of you develop or maintain HTTP APIs in Rust. But writing and maintaining their tests can be a tedious task right?

With the pre-release 0.5.0-alpha.1, you can preview the built-in functions to test json path values for equality and validity with a json schema. Your feedback is important so we can better shape what you need! Give it a try by following the instructions in the Readme.

⭐ Consider to give it a star to support the project! Thanks!

GitHub logo theredfish / grillon

🦗 Grillon, an elegant and natural way to approach API testing in Rust.

Grillon

Crates.io docs.rs GitHub Workflow Status Check Links

Grillon offers an elegant and natural way to approach API testing in Rust.

  • Elegant, intuitive and expressive API
  • Built-in testing functions
  • Extensible

Please note that the API is subject to a lot of changes until the v1.0.0.

Documentation

Getting started

You need Tokio as asynchronous runtime. Generally, testing libs are used in unit or integration tests so let's declare grillon as a dev-dependency.

Add grillon to Cargo.toml

[dev-dependencies]
grillon = "0.5.0-alpha.1"
tokio = { version = "1", features = ["macros"] }
Enter fullscreen mode Exit fullscreen mode

Then use grillon :

use grillon::{dsl::*, dsl::http::*, json, Grillon, StatusCode, Result};
use grillon::header::{HeaderValue, CONTENT_LENGTH, CONTENT_TYPE};
#[tokio::test]
async
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Instrument, monitor, fix: a hands-on debugging session

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️