Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Can not completly integrate testrail with jenkins


#1

Hello. I run 1 test and I want the test result would be written to testrail. Test run is created but result isn’t written. In jenkins I have such problem:
java.lang.ClassCastException: testrail.testrail.JunitResults.Testsuite cannot be cast to testrail.testrail.JunitResults.Testsuites
at testrail.testrail.JunitResults.JUnitResults$1$1.visit(JUnitResults.java:68)
at hudson.util.DirScanner.scanSingle(DirScanner.java:49)
at hudson.util.DirScanner$Glob.scan(DirScanner.java:131)
at testrail.testrail.JunitResults.JUnitResults$1.invoke(JUnitResults.java:62)
at testrail.testrail.JunitResults.JUnitResults$1.invoke(JUnitResults.java:58)
at hudson.FilePath.act(FilePath.java:991)
at hudson.FilePath.act(FilePath.java:969)
at testrail.testrail.JunitResults.JUnitResults.slurpTestResults(JUnitResults.java:58)
at testrail.testrail.JunitResults.JUnitResults.(JUnitResults.java:47)
at testrail.testrail.TestRailNotifier.perform(TestRailNotifier.java:117)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1047)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1766)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:408)
Build step ‘Publish test results to TestRail’ marked build as failure
Finished: FAILURE
What ideas do you have about this?


#2

Hi!

Thanks for your posting. Could you let me know which Jenkins plugin you use? We currently don’t have an official Jenkins plugin and I assume you are using a custom plugin from Github, is this correct? You can always look into using our official Java binding as a starting point instead and we are happy to help in case any questions come up:

http://docs.gurock.com/testrail-api2/bindings-java

Cheers,
Tobias


#3

Hi!
Yes, I use custom plugin: testrail-jenkins-plugin.


#4

Thanks! This looks like a runtime issue with the Jenkins plugin and you might be able to modify the plugin by reviewing JUnitResults.java at line 68. It seems that the plugin always assume a Testsuites object (group of Testsuite) but encountered an instance of Testsuite instead.

Cheers,
Tobias