- Git Triggers w/ Rainforest-CLI
Rainforest is the simplest way of doing integration testing. Since integration tests play such a big role in assuring the quality of your software, it is important to run these tests on a regular basis.
The best way to achieve this is to integrate Rainforest with your existing continuous integration system or with your deployment system.
We've built a tool that should let you achieve this in minutes.
To integrate Rainforest with any CI server or deployment tool, we wrote a Command Line Interface that triggers a run of your tests from any script. This tool is called rainforest-cli and is compatible with all build systems.
It's easy to install (requires Ruby 1.9 or newer):
gem install rainforest-cli
You can then run all of your tests using the following command:
rainforest run --token <YOUR API TOKEN> --fg --fail-fast --description "CI automatic run" all
You can find your API token in the Settings pane of your account in the Integrations section.
The '--fg' option ensures that the command only returns when the run is complete. If you do not specify it, the tool will trigger the run, but will then exit immediately.
The `--fail-fast` option makes the rainforest tool return immediately after the first failure.
The `--description` option adds an arbitrary description to the run.
For a comprehensive list of options, refer to the Github page of the tool.
Git Triggers w/ Rainforest-CLI
Rainforest's CLI client supports triggering based on the contents of a git commit message. This is useful if you have Rainforest integrated into your CI server, but want to have more control over what is tested.
To enable this feature, add --git-trigger to the command line options you're passing to Rainforest.
With this flag enabled the cli client will do nothing unless the last commit message for your project contains @rainforest and one or more hashtags. For example, if the last commit was;
- "Fixed the login button" - we will not trigger rainforest
- "Fixed the login button. @rainforest #login" - we will start a rainforest run with anything tagged login.
The most common and suggested use of git-trigger is to enable teams to test specific subsets of their Rainforest suites on feature branches for speed before their work is merged into a release branch where a full suite runs. For more details on how to get started with this workflow, please get in touch.