开发者

Ant build target is failing after first junit task

I have an Ant build target that performs some testing using jUnit4

   <target name="integrationtest" depends="init, buildtests, deploytests">
      <junit haltonfailure="false">
         <sysproperty key="driver" value="org.openqa.selenium.firefox.FirefoxDriver" />
         <sysproperty key="screenshotDir" value="${screenshotsDir}" />
         <classpath>
            <pathelement location="${interfaceTestJar}"/>
         </classpath>
         <batchtest>
            <fileset dir="${interfaceTestClasses}">
               <include name="**/tests/Test*.class" />
            </fileset>
         </batchtest>
      </junit>

      <junit haltonfailure="false">
         <sysproperty key="driver" value="org.openqa.selenium.ie.InternetExplorerDriver" />
         <classpath>
            <pathelement location="${interfaceTestJar}"/>
         </classpath>
         <batchtest>
            <fileset dir="${interfaceTestClasses}">
               <include name="**/tests/Test*.class" />
            </fileset>
         </batchtest>
      </junit>

      <echo message="##teamcity[publishArtifacts '${artifactsDir}']" />
   </target>

First junit task is always started, but if there is any failed tests in it, the second one isn't starts (exepected to start in any case, even if first one has failed tests)

EDIT: Seems like there is another problem. Second jUnit is not started in any 开发者_运维知识库case (if first is succeed or failed). In my TeamCity build log i see the following lines

[integrationtest] junit
[20:06:14]: [junit] ru.company.tests.TestDateField
[20:06:30]: [junit] Process exited with code 255

TestDateField is my first test suite. After it there are some more suites and they all succeed (and the first one too).


Is there a chance your test does something like System.exit? Did you try adding fork="true" to your junit task, so it will run in a separate JVM?


I think you should use <junit haltonfailure="no"> instead of <junit haltonfailure="false">


As per the docs, haltonfailure should be yes or no.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜