phpunit не может использовать муравья в Jenkins

Я установил Jenkins в среде Linux. У меня есть сервер SunOs, который действует как подчиненный компьютер, и на этом сервере доступен бинарный файл phpunit.phar. На сервере вручную я могу выполнить свой phpunit. Я создал задание Jenkins, которое будет запускаться на ведомой машине, которая будет выполнять phpunit, используя сборку ANt.

build.xml:

<project name="name-of-project" default="full-build">
<!--  By default, we assume all tools to be on the $PATH  -->
<property name="phpunit" value="phpunit"/>
<!--
<property name="phpunit" value="${basedir}/build/tools/phpunit.phar"/>
-->
<!--
Use this when the tools are managed by Composer in ${basedir}/vendor/bin
<property name="phpunit" value="${basedir}/vendor/bin/phpunit"/>
-->
<target name="full-build" depends="prepare,lint,phpunit,-check-failure" description="Performs static analysis, runs the tests, and generates project documentation"/>
<!--
Adjust the threadCount attribute's value to the number of CPUs
-->

<target name="clean" unless="clean.done" description="Cleanup build artifacts">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<property name="clean.done" value="true"/>
</target>
<target name="prepare" unless="prepare.done" depends="clean" description="Prepare for build">
<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<property name="prepare.done" value="true"/>
</target>
<target name="lint" unless="lint.done" description="Perform syntax check of sourcecode files">
<apply executable="/pkg/vddfg/php/bin/php" taskname="lint">
<arg value="-l"/>
<fileset dir="${basedir}/Symfony/src">
<include name="**/*.php"/>
<modified/>
</fileset>
<fileset dir="${basedir}/Symfony/src">
<include name="**/*.twig"/>
<modified/>
</fileset>
<fileset dir="${basedir}/tests">
<include name="**/*.php"/>
<modified/>
</fileset>
</apply>
<property name="lint.done" value="true"/>
</target>

<target name="phpunit" unless="phpunit.done" depends="prepare" description="Run unit tests with PHPUnit">
<exec executable="${phpunit}" resultproperty="result.phpunit" taskname="phpunit">
<arg value="--configuration"/>
<arg path="${basedir}/build/phpunit.xml"/>
</exec>
<property name="phpunit.done" value="true"/>
</target>
<target name="phpunit-no-coverage" unless="phpunit.done" depends="prepare" description="Run unit tests with PHPUnit (without generating code coverage reports)">
<exec executable="/pkg/vddfg/php/bin/phpunit" failonerror="true" taskname="phpunit">
<arg value="--configuration"/>
<arg path="${basedir}/build/phpunit.xml"/>
<arg value="--no-coverage"/>
</exec>
<property name="phpunit.done" value="true"/>
</target>
<target name="-check-failure">
<fail message="PHPUnit did not finish successfully">
<condition>
<not>
<equals arg1="${result.phpunit}" arg2="0"/>
</not>
</condition>
</fail>
</target>
</project>

Когда я запускаю задание Jenkins, мое задание ANT завершается неудачно с сообщением об ошибке:

Не удалось выполнить: java.io.IOException: не удается запустить программу «phpunit» (в
каталог «/ home / jenkins / workspace»): ошибка = 2, такого файла нет или
каталог

Я также попытался указать путь phpunit также в build.xml, затем я получил сообщение об ошибке:

[phpunit] / usr / bin / env: нет такого файла или каталога

Как исправить эту проблему?

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …