Skip to content

Commit 8107b1e

Browse files
committed
Add Travis config details
1 parent fb25e74 commit 8107b1e

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ install:
4141

4242
script:
4343
- composer phpunit
44-
- composer behat
44+
- composer behat || composer behat-rerun
4545

4646
jobs:
4747
include:

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,39 @@ WP_CLI_BIN_DIR=~/wp-cli composer behat
113113

114114
### Setting up the tests in Travis CI
115115

116-
116+
Basic rules for setting up the test framework with Travis CI:
117+
118+
* `composer prepare-tests` needs to be called once per environment.
119+
* `linting and sniffing` is a static analysis, so it shouldn't depend on any specific environment. You should do this only once, as a separate stage, instead of per environment.
120+
* `composer behat || composer behat-rerun` causes the Behat tests to run in their entirety first, and in case their were failed scenarios, a second run is done with only the failed scenarios. This usually gets around intermittent issues like timeouts or similar.
121+
122+
Here's a basic setup of how you can configure Travis CI to work with the test framework (extract):
123+
```yml
124+
install:
125+
- composer install
126+
- composer prepare-tests
127+
128+
script:
129+
- composer phpunit
130+
- composer behat || composer behat-rerun
131+
132+
jobs:
133+
include:
134+
- stage: sniff
135+
script:
136+
- composer lint
137+
- composer phpcs
138+
env: BUILD=sniff
139+
- stage: test
140+
php: 7.2
141+
env: WP_VERSION=latest
142+
- stage: test
143+
php: 7.2
144+
env: WP_VERSION=3.7.11
145+
- stage: test
146+
php: 7.2
147+
env: WP_VERSION=trunk
148+
```
117149
118150
#### WP-CLI version
119151

0 commit comments

Comments
 (0)