Skip to content

Commit

Permalink
Merge pull request dokku#4234 from dokku/use-bats-filter
Browse files Browse the repository at this point in the history
Switch to bats --filter for running a single test
  • Loading branch information
josegonzalez authored Dec 11, 2020
2 parents 775432c + f536a05 commit 2eeb006
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 79 deletions.
14 changes: 4 additions & 10 deletions docs/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,14 @@ bats tests/unit/10_apps.bats tests/unit/10_certs.bats

In order to increase testing velocity, a wrapper script around Bats is available that can be used to run a single test case within a suite.

Tests within a suite may be listed by specifying the suite as a parameter to the `tests/bats-exec-test-single` script.
Tests within a suite may be listed by specifying the suite as a parameter to `bats`.

```shell
tests/bats-exec-test-single tests/unit/10_apps.bats
```

A single test can be specified as a second parameter. The test is selected by fuzzy-match, and only the first match is executed.

```shell
tests/bats-exec-test-single tests/unit/10_apps.bats clone
bats tests/unit/10_apps.bats
```

Some special characters are translated in the test listing, specifically the characters `( ) :`, while others are not. The fuzzy matching happens on test names as listed by this script, so executing a test with a more specific name will work as expected.
A single test can be specified via the `--filter` argument. The tests are selected via regex match, and all matches are executed.

```shell
tests/bats-exec-test-single tests/unit/10_apps.bats clone_-2d-2dskip-2ddeploy
bats --filter clone tests/unit/10_apps.bats
```
69 changes: 0 additions & 69 deletions tests/bats-exec-test-single

This file was deleted.

0 comments on commit 2eeb006

Please sign in to comment.