Skip to content

Commit 945fc6d

Browse files
author
davert
committed
new CI post
1 parent 512536f commit 945fc6d

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

_posts/2013-05-24-jenkins-ci-practice.markdown

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ date: 2013-05-24 22:03:50
66

77
*Another blogpost from Ragazzo containing some practical information. If you ever wanted to ask how to set up a Continuous Integration with Codeception, you can read it here. He shares some useful tips you should be aware of.*
88

9-
It is very good to automate maximum of the things you can. Once we automated testing process, build should be automated too. I use [Jenkins](http://jenkins-ci.org/) as my primary continuous integration server. It can be installed and executed on all popular operating systems with Java enabled.
10-
11-
12-
<img src="http://jenkins-ci.org/sites/default/files/images/headshot.png" style="float: right;" />
9+
<img src="http://jenkins-ci.org/sites/default/files/images/headshot.png" style="float: left;" />
1310

11+
It is very good to automate maximum of the things you can. Once we automated testing process, build should be automated too. I use [Jenkins](http://jenkins-ci.org/) as my primary continuous integration server. It can be installed and executed on all popular operating systems with Java enabled.
1412

1513
As for PHPUnit I use JUnit format for error reports and some **Jenkins** plugins to make it work with Code Coverage. For **Behat** and **Codeception** I also use JUnit output log format and [Jenkins PHPUnit Plugin](http://jenkins-php.org/).
1614

@@ -27,7 +25,7 @@ And of course one job for bulding packages for demo and for developer:
2725

2826
I scheduled jobs to run one by one so the first goes `Unit`, then it triggers `Func`, then `Func` triggers `Func_Web` and so on. `Build` is not triggered automatically, I start it by myself.
2927

30-
#### COnfiguring Builds
28+
#### Configuring Builds
3129

3230
Lets pay attention on two of them that include Codeception. I'm using **Ant** build tool to execute them.
3331
Bascially for JUnit output you need nothing more then running codeception with `--xml` option. Like this:
@@ -39,16 +37,16 @@ codecept.phar --xml run functional
3937
This will produce the `report.xml` file in `tests/_log` directory, which will be analyzed by Jenkins. In my Ant task I'm also clearing a _log directory before running tests.
4038

4139
{% highlight xml %}
42-
<project name="{SomeMyProject}_Testing_Func_Web" default="build" basedir=".">
40+
<project name="MyProject_Testing_Func_Web" default="build" basedir=".">
4341
<target name="clean">
44-
<delete dir="${basedir}/build/src/protected/tests/codeception/tests/_log" includes="**/*" />
42+
<delete dir="${basedir}/build/src/protected/tests/codeception/tests/_log" includes="**/*" />
43+
</target>
44+
<target name="codeception">
45+
<exec dir="${basedir}/build/src/protected/tests/codeception" executable="php" failonerror="true">
46+
<arg line="codecept.phar --xml run functional" />
47+
</exec>
4548
</target>
46-
<target name="codeception">
47-
<exec dir="${basedir}/build/src/protected/tests/codeception" executable="php" failonerror="true">
48-
<arg line="codecept.phar --xml run functional" />
49-
</exec>
50-
</target>
51-
<target name="build" depends="clean, codeception"/>
49+
<target name="build" depends="clean, codeception"/>
5250
</project>
5351
{% endhighlight %}
5452

0 commit comments

Comments
 (0)