I have install the TestLink plugin in Jenkins, and configure like this
https://wiki.jenkins-ci.org/display/JENKINS/TestLink+Plugin , but I
don,t know what the mean about the [TestLink Automated tests key
custom field]. so I have try to make it equal the Classname、
Methodname. but the result is same. Jenkins can find the Junit test
result ,but no test results found. why?, it's the output below,look at
the back of the result:
----------------------------------------------------------------------------------------
Started by user anonymous
Checking out a fresh workspace because C:\Program Files (x86)\Jenkins
\jobs\Paypal CRM\workspace\Junit3 doesn't exist
Cleaning workspace C:\Program Files (x86)\Jenkins\jobs\Paypal CRM
\workspace
Checking out
https://172.17.0.192/svn/PCRMTest/MavenTest/MavenTest/Calculator
A target
A target\surefire-reports
A target\surefire-reports\TEST-
com.sitinspring.TestCalculator.xml
A target\surefire-reports\com.sitinspring.TestCalculator.txt
A target\surefire
A target\test-classes
A target\test-classes\com
A target\test-classes\com\sitinspring
AU target\test-classes\com\sitinspring\TestCalculator.class
A target\classes
A target\classes\com
A target\classes\com\sitinspring
AU target\classes\com\sitinspring\Calculator.class
A src
A src\test
A src\test\java
A src\test\java\com
A src\test\java\com\sitinspring
A src\test\java\com\sitinspring\TestCalculator.java
A src\main
A src\main\java
A src\main\java\com
A src\main\java\com\sitinspring
A src\main\java\com\sitinspring\Calculator.java
A POM.xml
At revision 107
no change for
https://172.17.0.192/svn/PCRMTest/MavenTest/MavenTest/Calculator
since the previous build
Preparing TestLink client API.
Using TestLink URL:
http://172.17.0.118/testlink/lib/api/xmlrpc.php.
Retrieving TestLink details about test project, test plan and build.
Using TestLink Test Project: [PayPal CRM], ID: [1].
Using TestLink Test Plan: [Automated Tests], ID: [625].
Using TestLink Build: [97], ID: [1].
Found [1] TestLink Automated Test Cases.
Found TestLink test case: TestCase [id=23, name=testAdd,
testSuiteId=null, testProjectId=null, authorLogin=null, summary=,
steps=[], preconditions=null, testImportance=null, executionType=2,
order=null, internalId=null, checkDuplicatedName=null,
actionOnDuplicatedName=null, versionId=24, version=1, parentId=null,
customFields=[], executionStatus=n].
Retrieving list of custom fields for test case.
Retrieving custom field TestClass.
Custom field TestClass value: TestCalculator.
Sorting automated test cases by TestLink test plan execution order.
Executing single test command: [cd ./Junit3
mvn -e clean test -Dtest=TestCalculator].
[workspace] $ cmd /c call C:\Windows\TEMP
\testlink_plugin802749283990155247.bat
C:\Program Files (x86)\Jenkins\jobs\Paypal CRM\workspace>cd ./Junit3
C:\Program Files (x86)\Jenkins\jobs\Paypal CRM\workspace\Junit3>mvn -e
clean test -Dtest=TestCalculator
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building Calculator 1.0-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ Calculator
---
[INFO] Deleting C:\Program Files (x86)\Jenkins\jobs\Paypal CRM
\workspace\Junit3\target
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources)
@ Calculator ---
[WARNING] Using platform encoding (GBK actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Program Files
(x86)\Jenkins\jobs\Paypal CRM\workspace\Junit3\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @
Calculator ---
[WARNING] File encoding has not been set, using platform encoding GBK,
i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Program Files (x86)\Jenkins\jobs
\Paypal CRM\workspace\Junit3\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-
testResources) @ Calculator ---
[WARNING] Using platform encoding (GBK actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Program Files
(x86)\Jenkins\jobs\Paypal CRM\workspace\Junit3\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-
testCompile) @ Calculator ---
[WARNING] File encoding has not been set, using platform encoding GBK,
i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Program Files (x86)\Jenkins\jobs
\Paypal CRM\workspace\Junit3\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @
Calculator ---
[INFO] Surefire report directory: C:\Program Files (x86)\Jenkins\jobs
\Paypal CRM\workspace\Junit3\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.sitinspring.TestCalculator
Tests run: 3, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.047
sec <<< FAILURE!
Results :
Failed tests:
testSub(com.sitinspring.TestCalculator): pattern is not match
test(com.sitinspring.TestCalculator): pattern is not match
Tests run: 3, Failures: 2, Errors: 0, Skipped: 0
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2.250s
[INFO] Finished at: Tue Aug 09 18:06:17 CST 2011
[INFO] Final Memory: 8M/22M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-
plugin:2.7.2:test (default-test) on project Calculator: There are test
failures.
[ERROR]
[ERROR] Please refer to C:\Program Files (x86)\Jenkins\jobs\Paypal CRM
\workspace\Junit3\target\surefire-reports for the individual test
results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test
(default-test) on project Calculator: There are test failures.
Please refer to C:\Program Files (x86)\Jenkins\jobs\Paypal CRM
\workspace\Junit3\target\surefire-reports for the individual test
results.
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:
213)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:
153)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:
145)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:
84)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:
59)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:
183)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:
161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:
290)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:
230)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:
409)
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.MojoFailureException: There are
test failures.
Please refer to C:\Program Files (x86)\Jenkins\jobs\Paypal CRM
\workspace\Junit3\target\surefire-reports for the individual test
results.
at
org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:
74)
at
org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:
642)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:
101)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:
209)
... 19 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Blank iterative test command. Skipping iterative test command
execution.
Looking for the test results of TestLink test cases.
Looking for JUnit test suites test results.
Found [1] JUnit XML(s).
Parsing JUnit XML [Junit3\target\surefire-reports\TEST-
com.sitinspring.TestCalculator.xml].
Looking for a test result that matches with key custom field [testAdd]
=> [com.sitinspring.TestCalculator].
Verifying TestLink test case [testAdd], ID [23].
Custom fields in this TestLink test case [[CustomField [id=1,
name=TestClass, label=TestClass, type=0, possibleValues=,
defaultValue=, validRegexp=, lengthMin=0, lengthMax=0,
showOnDesign=true, enableOnDesign=true, showOnExecution=true,
enableOnExecution=false, showOnTestPlanDesign=false,
enableOnTestPlanDesign=false, displayOrder=1, location=1,
value=TestCalculator]]].
Looking for JUnit test cases test results.
Found [1] JUnit XML(s).
Parsing JUnit XML [Junit3\target\surefire-reports\TEST-
com.sitinspring.TestCalculator.xml].
Veryfying JUnit test suite [com.sitinspring.TestCalculator]. This
suite contains [3] tests, [2] failures and [0] errors.
Looking for a test result that matches with key custom field [testAdd]
=> [com.sitinspring.TestCalculator].
Verifying TestLink test case [testAdd], ID [23].
Custom fields in this TestLink test case [[CustomField [id=1,
name=TestClass, label=TestClass, type=0, possibleValues=,
defaultValue=, validRegexp=, lengthMin=0, lengthMax=0,
showOnDesign=true, enableOnDesign=true, showOnExecution=true,
enableOnExecution=false, showOnTestPlanDesign=false,
enableOnTestPlanDesign=false, displayOrder=1, location=1,
value=TestCalculator]]].
Looking for a test result that matches with key custom field [testAdd]
=> [com.sitinspring.TestCalculator].
Verifying TestLink test case [testAdd], ID [23].
Custom fields in this TestLink test case [[CustomField [id=1,
name=TestClass, label=TestClass, type=0, possibleValues=,
defaultValue=, validRegexp=, lengthMin=0, lengthMax=0,
showOnDesign=true, enableOnDesign=true, showOnExecution=true,
enableOnExecution=false, showOnTestPlanDesign=false,
enableOnTestPlanDesign=false, displayOrder=1, location=1,
value=TestCalculator]]].
Looking for a test result that matches with key custom field [testAdd]
=> [com.sitinspring.TestCalculator].
Verifying TestLink test case [testAdd], ID [23].
Custom fields in this TestLink test case [[CustomField [id=1,
name=TestClass, label=TestClass, type=0, possibleValues=,
defaultValue=, validRegexp=, lengthMin=0, lengthMax=0,
showOnDesign=true, enableOnDesign=true, showOnExecution=true,
enableOnExecution=false, showOnTestPlanDesign=false,
enableOnTestPlanDesign=false, displayOrder=1, location=1,
value=TestCalculator]]].
No test results found.
Skipping update test case execution status. Nothing found.
Recording test results
Build step 'Publish JUnit test result report' changed build result to
UNSTABLE
Finished: UNSTABLE
-----------------------------------------------------------
Junit result but no test result.why?