以下是我在JUnit XML文件中的内容:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite hostname="sebastien-xps" name="service.AclServiceTest" tests="15" errors="0" failures="0" time="5.534">
<properties>
<property name="jline.esc.timeout" value="0" />
<property name="config.resource" value="application-dev.conf" />
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment" />
<property name="scala.concurrent.context.maxThreads" value="20" />
<property name="sun.boot.library.path" value="/home/sebastien/Desktop/devhome/install/jdk1.7.0_45/jre/lib/amd64" />
<property name="java.vm.version" value="24.45-b08" />
<property name="java.vm.vendor" value="Oracle Corporation" />
<property name="java.vendor.url" value="http://java.oracle.com/" />
<property name="path.separator" value=":" />
<property name="java.vm.name" value="Java HotSpot(TM) 64-Bit Server VM" />
<property name="file.encoding.pkg" value="sun.io" />
<property name="user.country" value="FR" />
<property name="sun.java.launcher" value="SUN_STANDARD" />
<property name="sun.os.patch.level" value="unknown" />
<property name="java.vm.specification.name" value="Java Virtual Machine Specification" />
<property name="user.dir" value="/home/sebastien/Desktop/Stample" />
<property name="java.runtime.version" value="1.7.0_45-b18" />
<property name="java.awt.graphicsenv" value="sun.awt.X11GraphicsEnvironment" />
<property name="java.endorsed.dirs" value="/home/sebastien/Desktop/devhome/install/jdk1.7.0_45/jre/lib/endorsed" />
<property name="os.arch" value="amd64" />
<property name="java.io.tmpdir" value="/tmp" />
<property name="line.separator" value=" " />
<property name="java.vm.specification.vendor" value="Oracle Corporation" />
<property name="os.name" value="Linux" />
<property name="sun.jnu.encoding" value="UTF-8" />
<property name="java.library.path" value="/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib" />
<property name="sun.nio.ch.bugLevel" value="" />
<property name="java.specification.name" value="Java Platform API Specification" />
<property name="java.class.version" value="51.0" />
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers" />
<property name="os.version" value="3.5.0-54-generic" />
<property name="user.home" value="/home/sebastien" />
<property name="user.timezone" value="Europe/Paris" />
<property name="java.awt.printerjob" value="sun.print.PSPrinterJob" />
<property name="file.encoding" value="UTF8" />
<property name="java.specification.version" value="1.7" />
<property name="java.class.path" value="./sbt-launch-0.13.1.jar" />
<property name="user.name" value="sebastien" />
<property name="jline.shutdownhook" value="false" />
<property name="scala.concurrent.context.minThreads" value="10" />
<property name="java.vm.specification.version" value="1.7" />
<property name="sun.java.command" value="./sbt-launch-0.13.1.jar" />
<property name="java.home" value="/home/sebastien/Desktop/devhome/install/jdk1.7.0_45/jre" />
<property name="sun.arch.data.model" value="64" />
<property name="user.language" value="fr" />
<property name="java.specification.vendor" value="Oracle Corporation" />
<property name="stampleEnv" value="dev" />
<property name="awt.toolkit" value="sun.awt.X11.XToolkit" />
<property name="java.vm.info" value="mixed mode" />
<property name="java.version" value="1.7.0_45" />
<property name="java.ext.dirs" value="/home/sebastien/Desktop/devhome/install/jdk1.7.0_45/jre/lib/ext:/usr/java/packages/lib/ext" />
<property name="sun.boot.class.path" value="/home/sebastien/Desktop/devhome/install/jdk1.7.0_45/jre/lib/resources.jar:/home/sebastien/Desktop/devhome/install/jdk1.7.0_45/jre/lib/rt.jar:/home/sebastien/Desktop/devhome/install/jdk1.7.0_45/jre/lib/sunrsasign.jar:/home/sebastien/Desktop/devhome/install/jdk1.7.0_45/jre/lib/jsse.jar:/home/sebastien/Desktop/devhome/install/jdk1.7.0_45/jre/lib/jce.jar:/home/sebastien/Desktop/devhome/install/jdk1.7.0_45/jre/lib/charsets.jar:/home/sebastien/Desktop/devhome/install/jdk1.7.0_45/jre/lib/jfr.jar:/home/sebastien/Desktop/devhome/install/jdk1.7.0_45/jre/classes" />
<property name="java.awt.headless" value="true" />
<property name="java.vendor" value="Oracle Corporation" />
<property name="file.separator" value="/" />
<property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/" />
<property name="sun.io.unicode.encoding" value="UnicodeLittle" />
<property name="sun.cpu.endian" value="little" />
<property name="sun.desktop" value="gnome" />
<property name="sun.cpu.isalist" value="" />
</properties>
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<system-out />
<system-err />
</testsuite>
有趣的部分是:
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
<testcase classname="service.AclServiceTest" name="service.AclServiceTest" time="0.0" />
正如您所看到的,未包含示例名称,这使得我们的Jenkins服务器无法识别所有示例。这可以解决吗?
请注意,它不适用于test
任务,而只适用于运行集成测试的it:test
任务。
正常测试似乎没问题:
</testcase><testcase name="The username should::be valid when only lowercase chars and numbers" classname="utils.SignupUtilsTest" time="0,004">
</testcase><testcase name="The username should::be invalid when having too much characters" classname="utils.SignupUtilsTest" time="0,001">
我尝试使用Play使用in Test
:
parallelExecution in IntegrationTest := false,
testOptions in IntegrationTest += Tests.Argument(TestFrameworks.Specs2, "sequential", "true", "junitxml", "console"),
testOptions in IntegrationTest += Tests.Argument(TestFrameworks.JUnit, "--ignore-runners=org.specs2.runner.JUnitRunner"),
这似乎没有任何改善。
另一个奇怪的事情是it:test
文件的包名没有前缀,与test
文件不同:
drwxrwxr-x 2 sebastien sebastien 4096 mai 4 11:19 ./
drwxrwxr-x 8 sebastien sebastien 4096 mai 4 11:19 ../
-rw-rw-r-- 1 sebastien sebastien 6152 mai 7 14:02 AclServiceTest.xml
-rw-rw-r-- 1 sebastien sebastien 4864 mai 7 13:56 AnnotationUtilsTest.xml
-rw-rw-r-- 1 sebastien sebastien 5013 mai 7 14:02 BreadcrumbServiceTest.xml
-rw-rw-r-- 1 sebastien sebastien 11901 mai 7 14:01 CategoryServiceTest.xml
-rw-rw-r-- 1 sebastien sebastien 4872 mai 7 14:02 CommentServiceTest.xml
-rw-rw-r-- 1 sebastien sebastien 4652 mai 7 14:01 RelationshipServiceTest.xml
-rw-rw-r-- 1 sebastien sebastien 4878 mai 7 14:02 ReminderServiceTest.xml
-rw-rw-r-- 1 sebastien sebastien 4634 mai 7 14:02 SearchServiceTest.xml
-rw-rw-r-- 1 sebastien sebastien 10660 mai 7 14:02 SharingServiceTest.xml
-rw-rw-r-- 1 sebastien sebastien 5157 mai 7 13:56 SignupUtilsTest.xml
-rw-rw-r-- 1 sebastien sebastien 7891 mai 7 14:01 StampleServiceTest.xml
-rw-rw-r-- 1 sebastien sebastien 19606 mai 7 13:56 utils.AnnotationUtilsTest.xml
-rw-rw-r-- 1 sebastien sebastien 20001 mai 7 13:56 utils.SignupUtilsTest.xml