Skip to main content
Version: Nightly

Unit Test

Introduction

Unit tests are embedded into the codebase, usually placed next to the logic being tested. They are written using Rust's #[test] attribute. GreptimeDB uses cargo-nextest as its primary Rust test runner.

Install it with:

cargo install cargo-nextest --locked

Run the package you changed first:

cargo nextest run -p <package>

Use a test name or nextest filter to narrow the run further while developing. Before submitting a change with broad effects, run the full workspace suite:

make test

Coverage

CI reports unit-test coverage. Add tests for changed behavior and failure cases that could otherwise regress; coverage percentage alone is not the goal.