Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Finish the libtest json output experiment

Metadata
Point of contactEd Page
StatusProposed
FlagshipBuilding blocks
Tracking issuerust-lang/rust-project-goals#255
Zulip channelN/A (an existing stream can be re-used or new streams can be created on request)
Teamscargo, libs, testing-devex
Task owners(none)

Summary

Finish the libtest json experiment.

Motivation

libtest is the test harness used by default for tests in cargo projects. It provides the CLI that cargo calls into and enumerates and runs the tests discovered in that binary. It ships with rustup and has the same compatibility guarantees as the standard library.

Before 1.70, anyone could pass --format json despite it being unstable. When this was fixed to require nightly, this helped show how much people have come to rely on programmatic output.

Cargo could also benefit from programmatic test output to improve user interactions, including

Most of that involves shifting responsibilities from the test harness to the test runner which has the side effects of:

  • Allowing more powerful experiments with custom test runners (e.g. cargo nextest) as they’ll have more information to operate on
  • Lowering the barrier for custom test harnesses (like libtest-mimic) as UI responsibilities are shifted to the test runner (cargo test)

The status quo

The next 6 months

TaskOwner(s)Notes
Experiment with potential test harness featuresowner
Experiment with test reporting moving to Cargoowner
Putting forward a proposal for approvalowner

The “shiny future” we are working towards

  • Reporting shifts from test harnesses to Cargo
  • We run test harnesses in parallel

Team asks

TeamSupport levelNotes
cargoVibes
libsVibes
testing-devexSmallDesign discussions and review

Frequently asked questions