Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Vladishev <aleksander.vladishev@zabbix.com>2016-01-26 14:27:58 +0300
committerAlexander Vladishev <aleksander.vladishev@zabbix.com>2016-01-26 14:27:58 +0300
commitbdb3880204c37cedde1446fb4f17621bde3c2b1d (patch)
treeae043e4e71e1e4d53e07bd7455a456f442bddfc8 /build.xml
parent7a6fbacdec0e6f2dc1326a53b05326190e7a7bf3 (diff)
.......... [ZBXNEXT-686] updated Selenium tests
Diffstat (limited to 'build.xml')
-rw-r--r--build.xml288
1 files changed, 58 insertions, 230 deletions
diff --git a/build.xml b/build.xml
index 8e28483ce13..7411917d240 100644
--- a/build.xml
+++ b/build.xml
@@ -1,127 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="Zabbix" default="build" basedir=".">
- <property name="basedir" value="${WORKSPACE}"/>
- <property name="builddir" value="${BUILDDIR}"/>
- <property name="svn" value="${SVN}"/>
- <property name="dbenable" value="${DBENABLE}"/>
- <property name="dbtype" value="${DBTYPE}"/>
- <property name="dbhost" value="${DBHOST}"/>
- <property name="dbname" value="${DBNAME}"/>
- <property name="dbuser" value="${DBUSER}"/>
- <property name="dbpassword" value="${DBPASSWORD}"/>
- <property name="agentport" value="${AGENTPORT}"/>
- <property name="serverport" value="${SERVERPORT}"/>
- <property name="url" value="${URL}"/>
-
- <target name="buildagent">
- <!-- Build agent binaries -->
- <exec executable="./configure" dir="${builddir}" failonerror="on">
- <arg value="--enable-agent"/>
- <arg value="--with-libcurl"/>
- <arg value="--prefix=${builddir}"/>
- </exec>
- <exec executable="make" dir="${builddir}" failonerror="on">
- <arg value="-j4"/>
- <arg value="install"/>
- </exec>
- </target>
-
- <target name="buildserver">
- <!-- Build server binaries -->
- <exec executable="./configure" dir="${builddir}" failonerror="on">
- <arg value="--enable-server"/>
- <arg value="--with-${dbenable}"/>
- <arg value="--with-net-snmp"/>
- <arg value="--with-openipmi"/>
- <arg value="--with-ldap"/>
- <arg value="--with-ssh2"/>
- <arg value="--with-libcurl"/>
- <arg value="--with-jabber"/>
- <arg value="--prefix=${builddir}"/>
- </exec>
- <exec executable="make" dir="${builddir}" failonerror="on">
- <arg value="-j4"/>
- <arg value="install"/>
- </exec>
- </target>
-
- <target name="buildproxy">
- <!-- Build proxy binaries -->
- <exec executable="./configure" dir="${builddir}" failonerror="on">
- <arg value="--enable-proxy"/>
- <arg value="--with-${dbenable}"/>
- <arg value="--with-net-snmp"/>
- <arg value="--with-openipmi"/>
- <arg value="--with-ldap"/>
- <arg value="--with-ssh2"/>
- <arg value="--with-libcurl"/>
- <arg value="--with-jabber"/>
- <arg value="--prefix=${builddir}"/>
- </exec>
- <exec executable="make" dir="${builddir}" failonerror="on">
- <arg value="-j4"/>
- <arg value="install"/>
- </exec>
- </target>
-
<target name="init-common">
+ <!-- Delete build directories from the previous run -->
+ <delete dir="${basedir}/build/logs" failonerror="off"/>
<!-- Create the different build directories -->
<mkdir dir="${basedir}/build/logs" />
- <mkdir dir="${builddir}" />
- <exec executable="svn" dir="${basedir}/frontends/php/tests" failonerror="on">
- <arg line="checkout ${svn} ${builddir}"/>
- </exec>
- <exec executable="./bootstrap.sh" dir="${builddir}" failonerror="on"></exec>
- <exec executable="./configure" dir="${builddir}" failonerror="on"></exec>
- <exec executable="make" dir="${builddir}" failonerror="on">
- <arg line="dbschema"/>
- </exec>
- <exec executable="make" dir="${builddir}" failonerror="on">
- <arg value="-j4"/>
- <arg line="dist"/>
- </exec>
- <exec executable="sed" failonerror="on" output="${builddir}/frontends/php/tests/bootstrap.php">
- <arg line="'s/{URL}/${url}/' ${builddir}/frontends/php/tests/bootstrap.php.template"/>
- </exec>
</target>
- <target name="init-sqlite3" depends="init-common">
- <!-- Remove old SQLite3 database if exists -->
- <delete failonerror="off">
- <fileset dir="/tmp" includes="${dbname}.db" />
- </delete>
- <!-- Create SQLite3 database -->
- <exec executable="sqlite3" input="${builddir}/database/sqlite3/schema.sql" failonerror="on">
- <arg line="-init ${builddir}/tests/templates/sqlite3.init"/>
- <arg line="/tmp/${dbname}.db"/>
- </exec>
- <exec executable="chmod" dir="/tmp" failonerror="on">
- <arg line="go+rw"/>
- <arg line="/tmp/${dbname}.db"/>
- </exec>
- <exec executable="sqlite3" input="${builddir}/database/sqlite3/images.sql" failonerror="on">
- <arg line="-init ${builddir}/tests/templates/sqlite3.init"/>
- <arg line="/tmp/${dbname}.db"/>
- </exec>
- <exec executable="sqlite3" input="${builddir}/database/sqlite3/data.sql" failonerror="on">
- <arg line="-init ${builddir}/tests/templates/sqlite3.init"/>
- <arg line="/tmp/${dbname}.db"/>
- </exec>
- <exec executable="sqlite3" input="${builddir}/tests/data/data_test.sql" failonerror="on">
- <arg line="-init ${builddir}/tests/templates/sqlite3.init"/>
- <arg line="/tmp/${dbname}.db"/>
- </exec>
+ <target name="init-builbdir">
+ <property name="builddir" value="${BUILDDIR}"/>
+ <property name="svn" value="${SVN}"/>
+ <property name="dbtype" value="${DBTYPE}"/>
+ <property name="dbhost" value="${DBHOST}"/>
+ <property name="dbname" value="${DBNAME}"/>
+ <property name="dbuser" value="${DBUSER}"/>
+ <property name="dbpassword" value="${DBPASSWORD}"/>
+ <property name="url" value="${URL}"/>
- <!-- Create PHP config file -->
- <exec executable="sed" failonerror="on" output="${builddir}/frontends/php/conf/zabbix.conf.php">
- <arg line="'s/{DBNAME}/\/tmp\/${dbname}.db/' ${builddir}/tests/templates/zabbix.conf.php.sqlite3"/>
- </exec>
- <exec executable="sed" failonerror="on" output="${basedir}/frontends/php/conf/zabbix.conf.php">
- <arg line="'s/{DBNAME}/\/tmp\/${dbname}.db/' ${builddir}/tests/templates/zabbix.conf.php.sqlite3"/>
+ <delete dir="${builddir}" failonerror="off"/>
+
+ <exec executable="svn" failonerror="on">
+ <arg line="checkout ${svn} ${builddir}"/>
</exec>
</target>
- <target name="create-configs" depends="init-common">
+ <target name="create-configs" depends="init-common,init-builbdir">
+ <!-- Create bootstrap.php -->
+ <copy overwrite="true" file="${builddir}/frontends/php/tests/bootstrap.php.template" tofile="${builddir}/frontends/php/tests/bootstrap.php"/>
+ <replace file="${builddir}/frontends/php/tests/bootstrap.php" token="{URL}" value="${url}"/>
+
<!-- Create PHP config file -->
<copy overwrite="true" file="${builddir}/tests/templates/zabbix.conf.php" tofile="${builddir}/frontends/php/conf/zabbix.conf.php"/>
<replace file="${builddir}/frontends/php/conf/zabbix.conf.php" token="{DBTYPE}" value="${dbtype}"/>
@@ -129,122 +36,58 @@
<replace file="${builddir}/frontends/php/conf/zabbix.conf.php" token="{DBHOST}" value="${dbhost}"/>
<replace file="${builddir}/frontends/php/conf/zabbix.conf.php" token="{DBUSER}" value="${dbuser}"/>
<replace file="${builddir}/frontends/php/conf/zabbix.conf.php" token="{DBPASSWORD}" value="${dbpassword}"/>
- <!-- Create deamon config files -->
- <mkdir dir="${builddir}/etc"/>
- <mkdir dir="${builddir}/tmp"/>
- <copy overwrite="true" file="${builddir}/tests/templates/zabbix_agentd.conf" tofile="${builddir}/etc/zabbix_agentd.conf"/>
- <replace file="${builddir}/etc/zabbix_agentd.conf" token="{AGENTPORT}" value="${agentport}"/>
- <replace file="${builddir}/etc/zabbix_agentd.conf" token="{ROOTDIR}" value="${builddir}"/>
+ </target>
- <copy overwrite="true" file="${builddir}/tests/templates/zabbix_server.conf" tofile="${builddir}/etc/zabbix_server.conf"/>
- <replace file="${builddir}/etc/zabbix_server.conf" token="{SERVERPORT}" value="${serverport}"/>
- <replace file="${builddir}/etc/zabbix_server.conf" token="{ROOTDIR}" value="${builddir}"/>
- <replace file="${builddir}/etc/zabbix_server.conf" token="{DBNAME}" value="${dbname}"/>
- <replace file="${builddir}/etc/zabbix_server.conf" token="{DBHOST}" value="${dbhost}"/>
- <replace file="${builddir}/etc/zabbix_server.conf" token="{DBUSER}" value="${dbuser}"/>
- <replace file="${builddir}/etc/zabbix_server.conf" token="{DBPASSWORD}" value="${dbpassword}"/>
+ <target name="make-dbschema" depends="init-builbdir">
+ <!-- Create database schema -->
+ <exec executable="./bootstrap.sh" dir="${builddir}" failonerror="on"></exec>
+ <exec executable="./configure" dir="${builddir}" failonerror="on"></exec>
+ <exec executable="make" dir="${builddir}" failonerror="on">
+ <arg line="dbschema"/>
+ </exec>
</target>
- <target name="init-postgresql" depends="create-configs">
+ <target name="init-postgresql" depends="create-configs,make-dbschema">
<!-- Create PostgreSQL database -->
<exec executable="psql" failonerror="on">
- <arg line="-h ${dbhost}"/>
- <arg line="-1"/>
+ <arg line="--host=${dbhost}"/>
+ <arg line="--username=${dbuser}"/>
<arg line="--set ON_ERROR_STOP=1"/>
- <arg line="-c 'drop database if exists ${dbname};'"/>
- <arg line="template1 ${dbuser}"/>
+ <arg line="--command 'drop database if exists ${dbname}'"/>
</exec>
<exec executable="psql" failonerror="on">
- <arg line="-h ${dbhost}"/>
- <arg line="-1"/>
+ <arg line="--host=${dbhost}"/>
+ <arg line="--username=${dbuser}"/>
<arg line="--set ON_ERROR_STOP=1"/>
- <arg line="-c 'create database ${dbname};'"/>
- <arg line="template1 ${dbuser}"/>
+ <arg line="-c 'create database ${dbname}'"/>
</exec>
<exec executable="psql" input="${builddir}/database/postgresql/schema.sql" failonerror="on">
- <arg line="-h ${dbhost}"/>
- <arg line="-1"/>
+ <arg line="--host=${dbhost}"/>
+ <arg line="--username=${dbuser}"/>
<arg line="--set ON_ERROR_STOP=1"/>
- <arg line="${dbname} ${dbuser}"/>
+ <arg line="${dbname}"/>
</exec>
<exec executable="psql" input="${builddir}/database/postgresql/images.sql" failonerror="on">
- <arg line="-h ${dbhost}"/>
- <arg line="-1"/>
+ <arg line="--host=${dbhost}"/>
+ <arg line="--username=${dbuser}"/>
<arg line="--set ON_ERROR_STOP=1"/>
- <arg line="${dbname} ${dbuser}"/>
+ <arg line="${dbname}"/>
</exec>
<exec executable="psql" input="${builddir}/database/postgresql/data.sql" failonerror="on">
- <arg line="-h ${dbhost}"/>
- <arg line="-1"/>
+ <arg line="--host=${dbhost}"/>
+ <arg line="--username=${dbuser}"/>
<arg line="--set ON_ERROR_STOP=1"/>
- <arg line="${dbname} ${dbuser}"/>
+ <arg line="${dbname}"/>
</exec>
<exec executable="psql" input="${builddir}/tests/data/data_test.sql" failonerror="on">
- <arg line="-h ${dbhost}"/>
- <arg line="-1"/>
+ <arg line="--host=${dbhost}"/>
+ <arg line="--username=${dbuser}"/>
<arg line="--set ON_ERROR_STOP=1"/>
- <arg line="${dbname} ${dbuser}"/>
- </exec>
- </target>
-
- <target name="killagent">
- <!-- Kill previously running agent -->
- <exec executable="bash">
- <arg value="-c"/>
- <arg value="kill `ps -fu hudson|grep -v grep|grep ${builddir}/etc/zabbix_agentd.conf|head -1|awk '{print $2}'`"/>
- </exec>
- <!-- Sleep for 2 seconds -->
- <exec executable="sleep" failonerror="off">
- <arg line="2"/>
- </exec>
- </target>
-
- <target name="sleep5m">
- <!-- Sleep for 5 minutes -->
- <exec executable="sleep" failonerror="off">
- <arg line="300"/>
- </exec>
- </target>
-
- <target name="killdaemons">
- <!-- Kill previously running server -->
- <exec executable="bash">
- <arg value="-c"/>
- <arg value="kill `ps -fu hudson|grep -v grep|grep ${builddir}/etc/zabbix_server.conf|head -1|awk '{print $2}'`"/>
- </exec>
- <exec executable="bash">
- <arg value="-c"/>
- <arg value="kill `ps -fu hudson|grep -v grep|grep ${builddir}/etc/zabbix_agentd.conf|head -1|awk '{print $2}'`"/>
- </exec>
- </target>
-
- <target name="killserver">
- <!-- Kill previously running server -->
- <exec executable="bash">
- <arg value="-c"/>
- <arg value="kill `ps -fu hudson|grep -v grep|grep ${builddir}/etc/zabbix_server.conf|head -1|awk '{print $2}'`"/>
- </exec>
- <!-- Sleep for 2 seconds -->
- <exec executable="sleep" failonerror="off">
- <arg line="2"/>
- </exec>
- </target>
-
- <target name="runserver" depends="buildserver">
- <!-- Execute Server -->
- <exec executable="${builddir}/sbin/zabbix_server" dir="${builddir}/sbin" failonerror="on">
- <arg line="--config=${builddir}/etc/zabbix_server.conf"/>
- </exec>
- </target>
-
- <target name="runagent" depends="buildagent">
- <!-- Execute Agent -->
- <exec executable="${builddir}/sbin/zabbix_agentd" dir="${builddir}/sbin" failonerror="on">
- <arg line="--config=${builddir}/etc/zabbix_agentd.conf"/>
+ <arg line="${dbname}"/>
</exec>
</target>
- <target name="init-mysql" depends="create-configs">
+ <target name="init-mysql" depends="create-configs,make-dbschema">
<!-- Create MySQL database -->
<exec executable="mysql" failonerror="on">
<arg line="-h ${dbhost}"/>
@@ -272,38 +115,23 @@
</exec>
</target>
- <target name="clean">
- <!-- Delete build directories from the previous run -->
- <delete failonerror="off">
- <fileset dir="${basedir}/build/logs" includes="**.*" />
- </delete>
- <delete dir="${builddir}" failonerror="off"/>
+ <target name="test-phpunit" depends="init-common">
+ <exec executable="phpunit" dir="${basedir}/frontends/php/tests/unit" failonerror="on">
+ <arg line="--log-junit=${basedir}/build/logs/phpunit.xml"/>
+ <arg line="include/"/>
+ </exec>
</target>
<target name="test-frontend">
- <exec executable="phpunit" dir="${builddir}/frontends/php/tests" failonerror="off">
+ <exec executable="phpunit" dir="${builddir}/frontends/php/tests" failonerror="on">
<arg line="--log-junit=${basedir}/build/logs/phpunit.xml --bootstrap=${builddir}/frontends/php/tests/bootstrap.php frontend.php"/>
</exec>
</target>
- <target name="test-agent" depends="clean,init-common,buildagent,runagent">
- <!-- Create PHP config file. It is needed because PHP test classes depend on it. -->
- <exec executable="sed" failonerror="on" output="${builddir}/frontends/php/conf/zabbix.conf.php">
- <arg line="'s/{DBNAME}/${dbname}/' ${builddir}/tests/templates/zabbix.conf.php.postgresql"/>
- </exec>
- <exec executable="sed" failonerror="on" output="${basedir}/frontends/php/conf/zabbix.conf.php">
- <arg line="'s/{DBNAME}/${dbname}/' ${builddir}/tests/templates/zabbix.conf.php.postgresql"/>
- </exec>
- <exec executable="phpunit" dir="${basedir}/frontends/php/tests" failonerror="off">
- <arg line="--log-junit=${basedir}/build/logs/phpunit.xml --bootstrap=${builddir}/frontends/php/tests/bootstrap.php agent.php"/>
- </exec>
- </target>
-
- <target name="build-mysql" depends="clean,killserver,init-mysql,runagent,runserver,buildproxy,sleep5m,killdaemons,test-frontend" />
- <target name="build-postgresql" depends="clean,killserver,init-postgresql,runagent,runserver,buildproxy,sleep5m,killdaemons,test-frontend" />
- <target name="build-sqlite3" depends="clean,init-sqlite3,buildagent,buildproxy,buildserver,test-frontend" />
+ <target name="build-phpunit" depends="test-phpunit"/>
+ <target name="build-mysql" depends="init-mysql,test-frontend"/>
+ <target name="build-postgresql" depends="init-postgresql,test-frontend"/>
<!-- Default target -->
- <target name="build" depends="build-mysql,build-postgresql" />
-
+ <target name="build" depends="build-phpunit,build-mysql,build-postgresql"/>
</project>