Skip to content

Commit

Permalink
site: fix some typos and other things in existing pages
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbobbio committed Jan 14, 2024
1 parent e85ea82 commit 2dc2cb1
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 38 deletions.
4 changes: 2 additions & 2 deletions site/src/cargo_maelstrom.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# cargo-maelstrom

cargo-maelstrom is a replacement for `cargo test` which will run tests as jobs on a
distributed clustered job runner. Each test runs in a lightweight container
cargo-maelstrom is a replacement for `cargo test` which will run tests as jobs
on a distributed clustered job runner. Each test runs in a lightweight container
where it is isolated from computer it is running on and other tests.

Running your tests using it can be as simple as running `cargo maelstrom run`
Expand Down
9 changes: 5 additions & 4 deletions site/src/cargo_maelstrom/filtering_tests.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Filtering Tests

When running `cargo-maelstrom` without any arguments it runs all the tests it finds
as part of your project. If you wish to run only a subset of tests a filter can
be applied via the command line.
When running `cargo-maelstrom` without any arguments it runs all the tests it
finds as part of your project. If you wish to run only a subset of tests a
filter can be applied via the command line.

The means of filtering is a DSL (domain specific language) that specifies some
subset of the tests in your project. See [Test Pattern
DSL](./test_pattern_dsl.md) for details of how that works.

This DSL is used via the [`-i` and `-x` Flags](./i_and_x_flags.md)
This DSL is used via the [`--include` and `--exclude`
Flags](./include_and_exclude_flags.md)
18 changes: 10 additions & 8 deletions site/src/cargo_maelstrom/include_and_exclude_flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,24 @@ this more explicitly it is something like
```

## Working with Workspaces
When you specify a filter a package, `cargo-maelstrom` will only build the matching
packages. This can be a useful tip to remember when trying to run a single test.
When you specify a filter with a package, `cargo-maelstrom` will only build the
matching packages. This can be a useful tip to remember when trying to run a
single test.

If we were to run something like
```bash
cargo maelstrom run -i "name.equals(foobar)"
```

`cargo-maelstrom` would run any test which has the name "foobar". A test with this
name could be found in any of the packages in the workspace, so it is forced to
build all of them. But if I happened to know that only one package has this
test, the `baz` package, I would be better off running the following instead.
`cargo-maelstrom` would run any test which has the name "foobar". A test with
this name could be found in any of the packages in the workspace, so it is
forced to build all of them. But if we happened to know that only one package has
this test, the `baz` package, we would be better off running the following
instead.

```bash
cargo maelstrom run -i "package.equals(baz) && name.equals(foobar)"
```

Now since I specified that I only care about the "baz" package, `cargo-maelstrom`
will only bother to build that package.
Now since we specified that we only care about the "baz" package,
`cargo-maelstrom` will only bother to build that package.
30 changes: 15 additions & 15 deletions site/src/cargo_maelstrom/running_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Runner](../install/clustered_job_runner.md))
Also ensure you've installed `cargo-maelstrom` (See [Installing
cargo-maelstrom](../install/cargo_maelstrom.md).)

We need to provide the address of the broker to cargo-maelstrom. This can be done
via the command line by passing `--broker`, but since you have to provide it
every time it is easer to provide it via the configuration file.
We need to provide the address of the broker to cargo-maelstrom. This can be
done via the command line by passing `--broker`. Since this is required every
time the command is run, it is easier to provide it via the configuration file.

Create a file in `.config/cargo-maelstrom.toml` and put the following contents

Expand All @@ -24,28 +24,28 @@ the `--port` CLI option. (In the book we chose port 9001 for this)
Now we should be able to build and run tests just by running `cargo maelstrom
run`

With no arguments it attempt to run all the tests in your project.
With no other arguments it will attempt to run all the tests in your project.

The first time you run it you may notice that the progress bar is not all that
useful, this is because it has no way of predicting how many tests will run.
This should be improved with subsequent invocations. See [Test
Listing](#test-listing)

# Terminal Output
By default `cargo-maelstrom` prints the name of the tests that have been completed
to stdout. It also displays four progress bars indicating the state of jobs. See
[Job States](../clustered_job_runner_management/job_states.md).
By default `cargo-maelstrom` prints the name of the tests that have been
completed to stdout. It also displays four progress bars indicating the state of
jobs. See [Job States](../clustered_job_runner_management/job_states.md).

When tests fail, their stderr is printed out after the name (also to stdout.)

Before the progress bars there is a "spinner" which provides insight into what
the test job enqueuing thread is doing. It disappears once all tests are
enqueued.

Before running tests, `cargo-maelstrom` always runs invokes `cargo` to build the
Before running tests, `cargo-maelstrom` always invokes `cargo` to build the
tests before running them. This happens in parallel with enqueuing the tests to
run. If the build fails for some reason, `cargo-maelstrom` will abruptly stop and
print out the build output.
run. If the build fails for some reason, `cargo-maelstrom` will abruptly stop
and print out the build output.

Providing the `--quiet` flag will show only a single progress bar and provide no
other output.
Expand All @@ -54,8 +54,8 @@ If stdout isn't a TTY, no progress bars are displayed, and color is disabled.

# Caching

`cargo-maelstrom` caches some things in the `target/` directory, these things are
covered below. It also caches some things related to containers (not in the
`cargo-maelstrom` caches some things in the `target/` directory, these things
are covered below. It also caches some things related to containers (not in the
`target/` directory) and that is covered in [Using Container
Images](../cargo_maelstrom/using_container_images.md).

Expand All @@ -66,9 +66,9 @@ build artifacts that `cargo` produces. At the moment nothing cleans up stale
ones.

## Test Listing
A listing of all the tests in your project that `cargo-maelstrom` found is stored
in `target/maelstrom-test-listing.toml` file. This listing is used to predict the
amount of tests that will be run with subsequent invocations.
A listing of all the tests in your project that `cargo-maelstrom` found is
stored in `target/maelstrom-test-listing.toml`. This listing is used to predict
the amount of tests that will be run with subsequent invocations.

## File Digests
Files uploaded to the broker are identified via a hash of the file contents.
Expand Down
7 changes: 4 additions & 3 deletions site/src/cargo_maelstrom/test_pattern_dsl.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Test Pattern DSL

This domain-specific language has been designed specifically for `cargo-maelstrom`
to let users easily describe a set of tests to run.
This domain-specific language has been designed specifically for
`cargo-maelstrom` to let users easily describe a set of tests to run.

If you are a fan of formal explanations check out the
[BNF](./test_pattern_dsl/bnf.md). Otherwise, this page will attempt to give a
Expand Down Expand Up @@ -62,7 +62,8 @@ Here are some examples

- `!name.equals(foobar)` only tests not named foobar
- `package.equals(foo) && name.equals(bar)` test(s) named bar in package foo
- `package.equals(foo) - name.equals(bar)` tests in package foo except ones named bar
- `package.equals(foo) - name.equals(bar)` tests in package foo except ones
named bar

When combining multiple operators, parenthesis are allowed to control the
precedence.
Expand Down
4 changes: 2 additions & 2 deletions site/src/installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Installation
This is split up into two different installations processes. One for the
clustered job runner, and another for cargo-maelstrom
This is split up into two different installation processes. One for the
clustered job runner, and another for `cargo-maelstrom`

- [Clustered Job Runner](./install/clustered_job_runner.md)
- [cargo-maelstrom](./install/cargo_maelstrom.md)
8 changes: 4 additions & 4 deletions site/src/introduction.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# What is Maelstrom?
Maelstrom is a Rust test runner build on top of a general-purpose clustered job
Maelstrom is a Rust test runner built on top of a general-purpose clustered job
runner.

It can be used as an alternate way to run tests for your Rust project that uses
Expand All @@ -17,15 +17,15 @@ Maelstrom itself is split up into a few different pieces of software.
the actual job (or test.)
- **The Client**. There are one or many instances of these. This is what
connects to the broker and submits jobs.
- **cargo-maelstrom**. This is our cargo replacement which submits tests as jobs by
acting as a client.
- **`cargo-maelstrom`**. This is our cargo test replacement which submits tests
as jobs by acting as a client.

# What will this book cover?
This guide will attempt to cover the following topics:

- Basic Install. How do you install and configure this for your own projects.
Both setting up the clustered job runner and using cargo-maelstrom
- cargo-maelstrom configuration. Sometimes extra configuration is needed to make
- `cargo-maelstrom` configuration. Sometimes extra configuration is needed to make
tests run successfully, this will cover how to do that.
- Clustered job runner management. How clustered job runner works and how to get
insight into the job running process.

0 comments on commit 2dc2cb1

Please sign in to comment.