Documentation ¶
Overview ¶
The Ginkgo CLI
The Ginkgo CLI is fully documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli)
To install:
go install github.com/onsi/ginkgo/ginkgo
To run tests:
ginkgo
To run tests in all subdirectories:
ginkgo -r
To run tests in particular packages:
ginkgo <flags> /path/to/package /path/to/another/package
To run tests in parallel
ginkgo -nodes=N
where N is the number of nodes. By default the Ginkgo CLI will spin up a server that the individual test processes send test output to. The CLI aggregates this output and then presents coherent test output, one test at a time, as each test completes. An alternative is to have the parallel nodes run and stream interleaved output back. This useful for debugging, particularly in contexts where tests hang/fail to start. To get this interleaved output:
ginkgo -nodes=N -stream=true
On windows, the default value for stream is true.
By default, when running multiple tests (with -r or a list of packages) Ginkgo will abort when a test fails. To have Ginkgo run subsequent test suites instead you can:
ginkgo -keepGoing
To monitor packages and rerun tests when changes occur:
ginkgo -watch <-r> </path/to/package>
passing `ginkgo -watch` the `-r` flag will recursively detect all test suites under the current directory and monitor them. `-watch` does not detect *new* packages. Moreover, changes in package X only rerun the tests for package X, tests for packages that depend on X are not rerun.
[OSX only] To receive (desktop) notifications when a test run completes:
ginkgo -notify
this is particularly useful with `ginkgo -watch`. Notifications are currently only supported on OS X and require that you `brew install terminal-notifier`
Sometimes (to suss out race conditions/flakey tests, for example) you want to keep running a test suite until it fails. You can do this with:
ginkgo -untilItFails
To bootstrap a test suite:
ginkgo bootstrap
To generate a test file:
ginkgo generate <test_file_name>
To unfocus tests:
ginkgo unfocus
To print out Ginkgo's version:
ginkgo version
To get more help:
ginkgo help
Directories ¶
Path | Synopsis |
---|---|
Aggregator is a reporter used by the Ginkgo CLI to aggregate and present parallel test output as one coherent stream.
|
Aggregator is a reporter used by the Ginkgo CLI to aggregate and present parallel test output as one coherent stream. |
support
|
|
fsnotify
Package fsnotify implements filesystem notification.
|
Package fsnotify implements filesystem notification. |