diff options
author | Alexander Vladishev <aleksander.vladishev@zabbix.com> | 2020-08-14 17:26:05 +0300 |
---|---|---|
committer | Alexander Vladishev <aleksander.vladishev@zabbix.com> | 2020-08-14 17:26:05 +0300 |
commit | ec4267508e171396fb6d0c1c0f4af5999d3e3e61 (patch) | |
tree | c06fb2e26d30dffee33a486053bed5c034c7cef0 /build.xml | |
parent | a0a9a460522f2f096c57c3c70b94792d4e31615f (diff) |
.......... [ZBXNEXT-686] added "drop database" after api tests finished
Diffstat (limited to 'build.xml')
-rw-r--r-- | build.xml | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/build.xml b/build.xml index 537869c2a65..31830acc775 100644 --- a/build.xml +++ b/build.xml @@ -126,8 +126,8 @@ </exec> </target> - <target name="init-server-postgresql" depends=""> - <!-- Create PostgreSQL database --> + <target name="drop-db-postgresql"> + <!-- Drop PostgreSQL database --> <exec executable="psql" failonerror="on"> <env key="PGPASSWORD" value="${dbpassword}"/> <arg line="-q"/> @@ -136,6 +136,10 @@ <arg line="--set ON_ERROR_STOP=1"/> <arg line="-c 'drop database if exists ${dbname}'"/> </exec> + </target> + + <target name="create-db-postgresql" depends="drop-db-postgresql"> + <!-- Create PostgreSQL database --> <exec executable="psql" failonerror="on"> <env key="PGPASSWORD" value="${dbpassword}"/> <arg line="-q"/> @@ -202,7 +206,7 @@ </exec> </target> - <target name="init-frontend-postgresql" depends="create-configs,create-saml-configs,make-dbschema,make-gettext,init-server-postgresql,init-frontend-modules"> + <target name="init-frontend-postgresql" depends="create-configs,create-saml-configs,make-dbschema,make-gettext,create-db-postgresql,init-frontend-modules"> <exec executable="psql" input="ui/tests/selenium/data/data_test.sql" failonerror="on"> <env key="PGPASSWORD" value="${dbpassword}"/> <arg line="-q"/> @@ -214,7 +218,7 @@ </exec> </target> - <target name="init-api-postgresql" depends="create-configs,make-dbschema,init-server-postgresql"> + <target name="init-api-postgresql" depends="create-configs,make-dbschema,create-db-postgresql"> <exec executable="psql" input="ui/tests/api_json/data/data_test.sql" failonerror="on"> <env key="PGPASSWORD" value="${dbpassword}"/> <arg line="-q"/> @@ -226,7 +230,7 @@ </exec> </target> - <target name="init-integration-postgresql" depends="create-configs,init-integration,make-binaries-postgresql,init-server-postgresql,init-proxy-postgresql"> + <target name="init-integration-postgresql" depends="create-configs,init-integration,make-binaries-postgresql,create-db-postgresql,init-proxy-postgresql"> <exec executable="psql" input="ui/tests/integration/data/data_test.sql" failonerror="on"> <env key="PGPASSWORD" value="${dbpassword}"/> <arg line="-q"/> @@ -262,14 +266,18 @@ </exec> </target> - <target name="init-server-mysql" depends=""> - <!-- Create MySQL database --> + <target name="drop-db-mysql"> + <!-- Drop MySQL database --> <exec executable="mysql" failonerror="on"> <arg line="--host=${dbhost}"/> <arg line="--user=${dbuser}"/> <arg line="--password=${dbpassword}"/> <arg line="--execute='drop database if exists ${dbname}'"/> </exec> + </target> + + <target name="create-db-mysql" depends="drop-db-mysql"> + <!-- Create MySQL database --> <exec executable="mysql" failonerror="on"> <arg line="--host=${dbhost}"/> <arg line="--user=${dbuser}"/> @@ -318,7 +326,7 @@ </exec> </target> - <target name="init-frontend-mysql" depends="create-configs,create-saml-configs,make-dbschema,make-gettext,init-server-mysql,init-frontend-modules"> + <target name="init-frontend-mysql" depends="create-configs,create-saml-configs,make-dbschema,make-gettext,create-db-mysql,init-frontend-modules"> <exec executable="mysql" input="ui/tests/selenium/data/data_test.sql" failonerror="on"> <arg line="--host=${dbhost}"/> <arg line="--user=${dbuser}"/> @@ -327,7 +335,7 @@ </exec> </target> - <target name="init-api-mysql" depends="create-configs,make-dbschema,init-server-mysql"> + <target name="init-api-mysql" depends="create-configs,make-dbschema,create-db-mysql"> <exec executable="mysql" input="ui/tests/api_json/data/data_test.sql" failonerror="on"> <arg line="--host=${dbhost}"/> <arg line="--user=${dbuser}"/> @@ -336,7 +344,7 @@ </exec> </target> - <target name="init-integration-mysql" depends="create-configs,init-integration,make-binaries-mysql,init-server-mysql,init-proxy-mysql"> + <target name="init-integration-mysql" depends="create-configs,init-integration,make-binaries-mysql,create-db-mysql,init-proxy-mysql"> <exec executable="mysql" input="ui/tests/integration/data/data_test.sql" failonerror="on"> <arg line="--host=${dbhost}"/> <arg line="--user=${dbuser}"/> @@ -383,8 +391,8 @@ <target name="build-phpunit" depends="test-phpunit"/> <target name="build-mysql" depends="init-frontend-mysql,test-frontend"/> <target name="build-postgresql" depends="init-frontend-postgresql,test-frontend"/> - <target name="build-api-mysql" depends="init-api-mysql,test-api"/> - <target name="build-api-postgresql" depends="init-api-postgresql,test-api"/> + <target name="build-api-mysql" depends="init-api-mysql,test-api,drop-db-mysql"/> + <target name="build-api-postgresql" depends="init-api-postgresql,test-api,drop-db-postgresql"/> <target name="build-integration-mysql" depends="init-integration-mysql,test-integration"/> <target name="build-integration-postgresql" depends="init-integration-postgresql,test-integration"/> |