8 releases

0.2.1 Aug 1, 2024
0.2.0 Jun 30, 2024
0.1.5 Mar 26, 2024
0.1.3 Jan 25, 2024
0.1.1 Oct 11, 2023

#1043 in Command line utilities

Download history 210/week @ 2024-08-18 177/week @ 2024-08-25 172/week @ 2024-09-01 201/week @ 2024-09-08 251/week @ 2024-09-15 268/week @ 2024-09-22 512/week @ 2024-09-29 436/week @ 2024-10-06 287/week @ 2024-10-13 272/week @ 2024-10-20 229/week @ 2024-10-27 214/week @ 2024-11-03 205/week @ 2024-11-10 194/week @ 2024-11-17 199/week @ 2024-11-24 129/week @ 2024-12-01

750 downloads per month

Apache-2.0 OR MIT

255KB
685 lines

wr

A Rust workshop runner

demo

wr is a CLI to drive test-driven workshops written in Rust.
It is designed to be used in conjunction with a workshop repository, which contains a series of exercises to be solved by the workshop participants.

[!NOTE] This workshop runner has been developed by Mainmatter to support our hands-on Rust workshops. Check out our landing page if you're looking for Rust consulting or training!

How it works

What I cannot create, I do not understand.

Richard Feynman

A test-driven workshop is structured as a series of exercises.
Each exercise is a Rust project with a set of tests that verify the correctness of the solution.

wr will run the tests for the current exercise and, if they pass, allow you to move on to the next exercise while keeping track of what you have solved so far.

You can see it in action in the rust-telemetry-workshop.

Installation

cargo install workshop-runner

Check that it has been installed correctly:

wr --help

Usage

Run

wr

from the top-level folder of a workshop repository to verify the solution for the current exercise and move forward in the workshop.

You can also navigate to a specific exercise and then run wr check from inside its directory to verify its solution, regardless of what the current exercise is.

Continuous checking

You can combine wr with cargo-watch to re-check your solution every time you make a change to the code:

cargo watch -- wr

Folder structure

wr expects the following structure for the workshop repository:

.
├── exercises
│  ├── 00_<collection name>
│  │  ├── 00_<exercise name>
│  │  │  ..
│  │  ├── 0n_<exercise name>
│  │  ..
│  ├── 0n_<collection name>
│  │  ├── 00_<exercise name>
│  │  │  ..
│  │  ├── 0n_<exercise name>

Each xx_<exercise name> folder must be a Rust project with its own Cargo.toml file.

You can choose a different top-level folder name by either passing the --exercises-dir flag when invoking wr or by creating a top-level wr.toml file with the following content:

exercises-dir = "my-top-level-folder"

You can refer to rust-telemetry-workshop as an example.

Dependencies

~30MB
~557K SLoC