i'm полностью исчерпан. jenkins не закончится успешно :)Jenkins/Hudson Ни один из протоколов испытаний не содержал никаких результатов
Возможно, некоторые из вас могут мне помочь? задание ant jenkins включает плагин javadoc, публиковать плагин html reports и junit test-result plugin. настройка завершена по умолчанию, например. нет пути переменных или любой ..
Started by an SCM change
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/TicTacToe/workspace
Updating http://xxx.xxx.xxx.xxx/svn/repo/projekt at revision '2014-01-24T15:21:33.486 +0100'
U build.xml
U .classpath
At revision 20
[workspace] $ ant
Buildfile: /var/lib/jenkins/jobs/TicTacToe/workspace/build.xml
build-subprojects:
init:
build-project:
[echo] TicTacToe: /var/lib/jenkins/jobs/TicTacToe/workspace/build.xml
build:
BUILD SUCCESSFUL
Total time: 0 seconds
Publishing Javadoc
[htmlpublisher] Archiving HTML reports...
Recording test results
None of the test reports contained any result
Build step 'Publish JUnit test result report' changed build result to FAILURE
Finished: FAILURE
и структура затмение:
в (простые) тесты:
package tictactoe;
import junit.framework.TestCase;
import org.junit.Assert;
import org.junit.Test;
//@RunWith(Suite.class)
//@SuiteClasses({Tests.class})
public class FieldTest extends TestCase {
@Test
public void testSchlange() {
String schlange = new String();
Assert.assertTrue(schlange.isEmpty());
}
@Test
public void testAdd() {
Assert.assertFalse(false);
}
}
и build.xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. --><project basedir="." default="build" name="TicTacToe">
<property environment="env"/>
<property name="ECLIPSE_HOME" value="../../"/>
<property name="junit.output.dir" value="junit"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.7"/>
<property name="source" value="1.7"/>
<path id="TicTacToe.classpath">
<pathelement location="bin"/>
<pathelement location="jfxrt.jar"/>
<pathelement location="hamcrest-core-1.3.jar"/>
<pathelement location="junit-4.11.jar"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="TicTacToe.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
<target name="TicTacToe">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="tictactoe.FieldTest" todir="${junit.output.dir}"/>
<classpath refid="TicTacToe.classpath"/>
</junit>
</target>
<target name="FieldTest">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="tictactoe.FieldTest" todir="${junit.output.dir}"/>
<classpath refid="TicTacToe.classpath"/>
</junit>
</target>
<target name="junitreport">
<junitreport todir="${junit.output.dir}">
<fileset dir="${junit.output.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${junit.output.dir}"/>
</junitreport>
</target>
</project>
На первый взгляд мне кажется, что вы не называете свои целевые объекты junit-test в своем файле сборки, поэтому он не может собирать результаты теста, так как они никогда не исполнялись. Возможно, вам захочется проверить, чтобы ваши тесты выполнялись до сбора данных. – crusam
Я совершенно новый для этой темы. можете ли вы объяснить мой подход немного подробным? например «Возможно, вам захочется проверить, что ваши тесты выполняются до сбора данных« звучит хорошо, но я не знаю, как это сделать;) –