testingjenkinstestlink

Is it possible to somehow automatically create jobs in TestLink from Jenkins?


I'm doing a bit of reasearch on Jenkins and TestLink and I was wondering - is it possible to automatically generate new project/job in TestLink or does it always have to be done manually? The issue is that I would like to run tests on Jenkins and then all the test that failed should create a new job in TestLink.

Is it possible and how to do it?


Solution

  • With default TestLink Jenkins plugin you can't create new projects automatically on TestLink. You will end up in below type of error

    FATAL: Test Project (name:TestSample1234) does not exist.
        br.eti.kinoshita.testlinkjavaapi.util.TestLinkAPIException: Test Project (name:TestSample1234) does not exist.
            at br.eti.kinoshita.testlinkjavaapi.BaseService.checkResponseError(BaseService.java:113)
            at br.eti.kinoshita.testlinkjavaapi.BaseService.executeXmlRpcCall(BaseService.java:91)
            at br.eti.kinoshita.testlinkjavaapi.TestProjectService.getTestProjectByName(TestProjectService.java:112)
            at br.eti.kinoshita.testlinkjavaapi.TestLinkAPI.getTestProjectByName(TestLinkAPI.java:438)
            at hudson.plugins.testlink.TestLinkBuilder.getTestLinkSite(TestLinkBuilder.java:309)
            at hudson.plugins.testlink.TestLinkBuilder.perform(TestLinkBuilder.java:186)
            at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
            at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
            at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.build(MavenModuleSetBuild.java:906)
            at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:857)
            at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
            at hudson.model.Run.execute(Run.java:1738)
            at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:410)
        ERROR: Error communicating with TestLink. Check your TestLink configuration.
        Finished: FAILURE
    

    Maybe you can achieve this by customizing the Jenkin plugin, please have look in plugin code [1] and [2] or asked from testlink forum [1] https://github.com/jenkinsci/testlink-plugin [2] https://github.com/kinow/testlink-java-api