Skip to content

Commit

Permalink
Add docs and CHANGELOG entry.
Browse files Browse the repository at this point in the history
  • Loading branch information
alysbrooks committed Apr 6, 2022
1 parent 77ca091 commit 24dde18
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Added

- You can now parallelize tests by enabling the `:parallel` key or
the `--parallel` flag. This is still a beta feature, but works on a variety
of code bases.

## Fixed

## Changed
Expand Down Expand Up @@ -847,4 +851,4 @@ namespace.
- The configuration format has changed, you should now start with the `#kaocha
{}` tagged reader literal in `tests.edn` to provide defaults. If you want more
control then overwrite `tests.edn` with the output of `--print-config` and
tweak.
tweak.
25 changes: 25 additions & 0 deletions doc/04_running_kaocha_cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,31 @@ unhelpful output in a particular scenario, you can turn it off using the

![Terminal screenshot showing an expected value of "{:expected-key 1}" and an actual value. ":unexpected-key 1" is in green because it is an extra key not expected and "expected-key 1" is in red because it was expected but not present.](./deep-diff.png)

## Parallelization

Kaocha allows you to run tests in parallel using the `:parallel` key or
`--parallel` flag. This is primarily useful for I/O heavy tests, but could also
be useful for CPU-bound tests.

Before enabling parallelization, be sure to test it. Consider using a tool like
`bench` or `hyperfine`. While Kaocha's built-in profiling tools are great for
identifying specific slow tests, but don't repeatedly measure your entire test suite
to account for variation and noise. If you want to test it on CI, test it for CI
specifically. CI runners are often lower powered than even a middle-of-the-road laptop.

`test.check` tests consist of repeatedly testing a property against random data.
In principle, these tests would be an excellent use case for parallelization.
Because this repeated testing happens within `test.check`, Kaocha sees it as a
single test. If you have many property-based tests that take a similar amount of
time, parallelization is a great fit. However, if you have one or two
property-based tests that take the bulk of the time, parallelization may not
make a significant difference because the work cannot be split up.

If you want to disable parallelization that's enabled in your configuration, you can
pass `--no-parallel`. If you find yourself frequently reaching for this flag,
it's probably worth reconsidering your configuration---having to frequently
disable parallelization might be negating any time saved by parallelization.

## Debug information

`--version` prints version information, whereas `--test-help` will print the
Expand Down

0 comments on commit 24dde18

Please sign in to comment.