Skip to content

Commit 1a5ef8b

Browse files
authored
Add gitlab-ci example for acceptance tests (#317)
* Add gitlab-ci example for acceptance tests * Fix typo in expire artifacts
1 parent f512c79 commit 1a5ef8b

1 file changed

Lines changed: 39 additions & 2 deletions

File tree

docs/12-ContinuousIntegration.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,44 @@ test:
164164

165165
![report](http://codeception.com/images/gitlab/build.png)
166166

167-
For acceptance testing you can use `codeception/codeception` docker image as base.
167+
For acceptance testing you can use `codeception/codeception` docker image as base. See example below:
168+
169+
{% highlight yaml %}
170+
171+
172+
image:
173+
name: codeception/codeception
174+
# clear image entrypoint to make bash being available
175+
entrypoint: [""]
176+
177+
# run selenium chrome as a local service (put "host: 'selenium__standalone-chrome'" in environment configuration)
178+
services:
179+
- selenium/standalone-chrome:latest
180+
181+
# Select what we should cache
182+
cache:
183+
paths:
184+
- vendor/
185+
186+
before_script:
187+
# Install all project dependencies
188+
- composer install
189+
190+
# Test
191+
test:
192+
script:
193+
- vendor/bin/codecept run acceptance --xml --html
194+
artifacts:
195+
when: always
196+
expire_in: 1 week
197+
paths:
198+
- tests/_output
199+
# make the report available in Gitlab UI. see https://docs.gitlab.com/ee/ci/unit_test_reports.html
200+
reports:
201+
junit: tests/_output/report.xml
202+
203+
{% endhighlight %}
204+
168205

169206
## Conclusion
170207

@@ -174,4 +211,4 @@ It is highly recommended to use Continuous Integration system in development. Co
174211

175212

176213
* **Next Chapter: [ParallelExecution >](/docs/12-ParallelExecution)**
177-
* **Previous Chapter: [< Codecoverage](/docs/11-Codecoverage)**
214+
* **Previous Chapter: [< Codecoverage](/docs/11-Codecoverage)**

0 commit comments

Comments
 (0)