[ticket/584] Create phpBB setup

B3P-584
This commit is contained in:
Marc Alexander
2015-06-11 15:23:40 +02:00
parent 2afa1c14c9
commit 81d08cbef1
2 changed files with 63 additions and 4 deletions

View File

@@ -41,7 +41,9 @@
<property name="version" value="HEAD" override="true" />
<property name="build-directory" value="build" override="true" />
<property name="package-directory" value="${build-directory}/package/${vendor-name}/${extension-name}" />
<property name="phpbb-root" value="${build-directory}/../../../../../" />
<property name="phpbb-root" value="${build-directory}/../../../../../" />
<property name="clover-path" value="${build-directory}/logs/clover.xml" />
<property name="coverage-html-path" value="${build-directory}/coverage" />
<!-- These are the main targets which you will probably want to use -->
<target name="all" depends="prepare-structure,package" />
@@ -59,11 +61,48 @@
passthru="true" />
</target>
<target name="test" depends="clean,composer">
<target name="prepare-tests" depends="clean,composer">
<exec command="if [ -d '${build-directory}/../../../../../' ]; then echo 'true'; else echo 'false'; fi;" outputProperty="output.IS_DIRECTORY_EXISTS" />
<if>
<equals arg1="${output.IS_DIRECTORY_EXISTS}" arg2="true" />
<then>
<echo msg="phpBB is already set up." />
</then>
<else>
<!-- Move Board3 Portal and set up phpBB -->
<exec command="CURRENT_BUILD_REV=$(git rev-parse --abbrev-ref HEAD)" passthru="true" />
<exec command="echo $GIT_BRANCH" passthru="true" />
<exec command="git clone https://github.com/phpbb/phpbb.git phpbb" passthru="true" />
<exec dir="${build-directory}/../phpbb/phpBB" command="php ../composer.phar install" passthru="true" />
<mkdir dir="phpbb/phpBB/ext/board3" />
<exec dir="${build-directory}/../phpbb/phpBB/ext/board3" command="git clone https://github.com/marc1706/Board3-Portal.git portal" passthru="true" />
<exec dir="${build-directory}/../phpbb/phpBB/ext/board3/portal" command="git checkout $GIT_BRANCH" passthru="true" />
<exec dir="${build-directory}/../phpbb/phpBB/ext/board3/portal" command="php composer.phar install" passthru="true" />
<property name="phpbb-root" value="${build-directory}/../phpbb" override="true" />
<property name="clover-path" value="../build/logs/clover.xml" override="true" />
<property name="coverage-html-path" value="../build/coverage" override="true" />
<exec dir="${build-directory}/../phpbb" command="cp ~/workspace/test_config.php tests/test_config.php" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="chmod 777 phpBB/cache" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="chmod 777 phpBB/files" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="chmod 777 phpBB/store" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="chmod 777 phpBB/images/avatars/upload" passthru="true" />
</else>
</if>
</target>
<target name="test" depends="clean,composer,prepare-tests">
<exec dir="${phpbb-root}"
command="phpBB/vendor/bin/phpunit
-c phpBB/ext/${vendor-name}/${extension-name}/"
passthru="true" />
-c phpBB/ext/${vendor-name}/${extension-name}/ --coverage-clover=${clover-path} --coverage-html=${coverage-html-path}"
passthru="true" returnProperty="test.pass" />
<if>
<not>
<equals arg1="${test.pass}" arg2="0"/>
</not>
<then>
<fail msg="PHPUnit tests failed."/>
</then>
</if>
</target>
<target name="test-slow" depends="clean,composer">
@@ -72,6 +111,14 @@
-c phpBB/ext/${vendor-name}/${extension-name}/
--group slow"
passthru="true" />
<if>
<not>
<equals arg1="${test.pass}" arg2="0"/>
</not>
<then>
<fail msg="PHPUnit slow tests failed."/>
</then>
</if>
</target>
<!--

View File

@@ -20,4 +20,16 @@
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">./tests/functional/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>phpBB/ext/board3/portal/</directory>
<exclude>
<directory>../tests/</directory>
<directory>../develop/</directory>
<directory>../migrations/</directory>
<directory>../language/</directory>
<directory>../vendor/</directory>
</exclude>
</whitelist>
</filter>
</phpunit>