Cargo-nextest:比 cargo test 快 3 倍,支持单项测试隔离,一流的持续集成体验
Cargo-nextest: 3x faster than cargo test, per-test isolation, first-class CI

原始链接: https://nexte.st/

**cargo-nextest** 是一款专为 Rust 设计的高性能下一代测试运行器。它的运行速度比 `cargo test` 快达 3 倍,并通过现代化、直观的界面以及强大的“每个测试独立进程”隔离机制,有效提升了开发者的工作效率。 主要特性包括: * **高级控制:** 使用强大的过滤器 DSL 精确选择测试,并可针对每个测试进行自定义设置,包括超时、重试和资源限制。 * **CI/CD 优化:** 专为大规模工程设计,支持跨多个工作节点进行测试分区和分片,并提供 JUnit 输出和构建存档功能。 * **可靠性与调试:** 具备“记录与重放”功能,支持压力测试以识别不稳定的测试用例,并可集成 Perfetto 等工具进行深度性能分析。 * **可扩展生态:** 可与覆盖率工具、调试器及变异测试套件无缝集成。 `cargo-nextest` 具备跨平台特性且备受信赖,为 Rust 开发带来了基础设施级别的可靠性。虽然目前仍需通过单独的 `cargo test --doc` 步骤来运行文档测试,但它已成为标准测试工作流中稳健且可投入生产的替代方案。如需开始使用,只需安装二进制文件并运行 `cargo nextest run` 即可。

抱歉。
相关文章

原文
Skip to content

A next-generation test runner for Rust

Up to 3× faster than cargo test, with a modern interface, per-test isolation, and first-class CI support.

  • Clean, beautiful user interface

    See which tests passed and failed at a glance.

    Running tests

  • Powerful test selection

    Use a sophisticated expression language to select exactly the tests you need. Filter by name, binary, platform, or any combination.

    Filtersets

  • Setup scripts

    Run setup scripts before tests start with per-test scoping. Initialize databases, start services, and prepare fixtures.

    Setup scripts

  • Open source, widely trusted

    Powers Rust development at every scale, from independent open source projects to the world's largest tech companies.

    License (Apache 2.0)

Quick start

Install cargo-nextest using the pre-built binaries, then run:

cargo nextest run

Note

Doctests are currently not supported because of limitations in stable Rust. For now, run doctests in a separate step with cargo test --doc.

联系我们 contact @ memedata.com