From 5d322713c5aea70778b131931052d1cf157e05d4 Mon Sep 17 00:00:00 2001 From: Tymoteusz Motylewski Date: Tue, 25 Aug 2020 17:18:46 +0200 Subject: [PATCH 1/2] Add gitlab-ci example for acceptance tests --- docs/12-ContinuousIntegration.md | 41 ++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/docs/12-ContinuousIntegration.md b/docs/12-ContinuousIntegration.md index 1f3e8ee70..249ce4e42 100644 --- a/docs/12-ContinuousIntegration.md +++ b/docs/12-ContinuousIntegration.md @@ -164,7 +164,44 @@ test: ![report](http://codeception.com/images/gitlab/build.png) -For acceptance testing you can use `codeception/codeception` docker image as base. +For acceptance testing you can use `codeception/codeception` docker image as base. See example below: + +{% highlight yaml %} + + +image: + name: codeception/codeception + # clear image entrypoint to make bash being available + entrypoint: [""] + +# run selenium chrome as a local service (put "host: 'selenium__standalone-chrome'" in environment configuration) +services: + - selenium/standalone-chrome:latest + +# Select what we should cache +cache: + paths: + - vendor/ + +before_script: +# Install all project dependencies +- composer install + +# Test +test: + script: + - vendor/bin/codecept run acceptance --xml --html + artifacts: + when: always + expire: 1 week + paths: + - tests/_output + # make the report available in Gitlab UI. see https://docs.gitlab.com/ee/ci/unit_test_reports.html + reports: + junit: tests/_output/report.xml + +{% endhighlight %} + ## Conclusion @@ -174,4 +211,4 @@ It is highly recommended to use Continuous Integration system in development. Co * **Next Chapter: [ParallelExecution >](/docs/12-ParallelExecution)** -* **Previous Chapter: [< Codecoverage](/docs/11-Codecoverage)** \ No newline at end of file +* **Previous Chapter: [< Codecoverage](/docs/11-Codecoverage)** From 45b382c11e07ab704e82a509bb7a63640b2ff3ed Mon Sep 17 00:00:00 2001 From: Tymoteusz Motylewski Date: Tue, 25 Aug 2020 17:45:09 +0200 Subject: [PATCH 2/2] Fix typo in expire artifacts --- docs/12-ContinuousIntegration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/12-ContinuousIntegration.md b/docs/12-ContinuousIntegration.md index 249ce4e42..4fc546c28 100644 --- a/docs/12-ContinuousIntegration.md +++ b/docs/12-ContinuousIntegration.md @@ -193,7 +193,7 @@ test: - vendor/bin/codecept run acceptance --xml --html artifacts: when: always - expire: 1 week + expire_in: 1 week paths: - tests/_output # make the report available in Gitlab UI. see https://docs.gitlab.com/ee/ci/unit_test_reports.html