Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-12916

Can't assign testng results to the testlink by Test Methode Name(only by Java Class )

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • testlink-plugin
    • None
    • WinXP: Jenkins (org.jenkins-ci.main:jenkins-war:1.449), Jenkins TestLink Plugin (3.0.2), TestNG Lib (6.4),TestLink 1.9.3 (Prague)

      I'm using testlink plugin for my project. It is very useful and easy to use. Thanks to the authors. But I have some suggestion.
      1.As I understand, test results from testng-results.xml are mapped to the tests only by Java Class Custom field. Do I have any way to map them by test-methode?
      2.And one more question: I'm using dataproviders in my tests. Do I have any mechanism to map the pairs (test-methode,dataprovider Object[]) to the tests.

      I mean if I have

      @DataProvider(name = "test1")
      public Object[][] createData1() {
      return new Object[][] {

      { "Cedric", new Integer(36) },
      { "Anne", new Integer(37)},
      };
      }

      //This test method declares that its data should be supplied by the Data Provider
      //named "test1"
      @Test(dataProvider = "test1")
      public void verifyData1(String n1, Integer n2) {
      AssertJUnit.assertTrue( n1.equals("Anne"));
      }

      And I have 2 test in Testlink: 1. for { "Cedric", new Integer(36) }

      , 2. for

      { "Anne", new Integer(37)}

      .
      And the results should map to each test

          [JENKINS-12916] Can't assign testng results to the testlink by Test Methode Name(only by Java Class )

          Nikolay Myakushkin added a comment - - edited

          Hello, Bruno,
          Sorry, I didnt have time to check alpha release, I was in vacation.
          Today, I have tried to check assigned test results by test methode name. But testlink plugin(3.1) didn't find test results in testng-results.xm (Found 0 test result(s).)

          Below is console log.

          Preparing TestLink client API.
          Using TestLink URL: http://localhost:8000/lib/api/xmlrpc.php

          Found 25 automated test cases in TestLink.

          Sorting automated test cases by TestLink test plan execution order.

          Executing single Build Steps.

          Executing iterative Build Steps.

          Looking for the test results of TestLink test cases.

          Looking for test results in TestNG suites.

          Found 0 test result(s).

          TestNG Reports Processing: START
          Looking for TestNG results report in workspace using pattern: **/target/surefire-reports/testng-results.xml
          Saving reports...
          Processing 'C:\dev\JENKINS_HOME\jobs\Manager\builds\2012-03-12_17-52-36\testng\testng-results.xml'
          TestNG Reports Processing: FINISH

          Nikolay Myakushkin added a comment - - edited Hello, Bruno, Sorry, I didnt have time to check alpha release, I was in vacation. Today, I have tried to check assigned test results by test methode name. But testlink plugin(3.1) didn't find test results in testng-results.xm (Found 0 test result(s).) Below is console log. Preparing TestLink client API. Using TestLink URL: http://localhost:8000/lib/api/xmlrpc.php Found 25 automated test cases in TestLink. Sorting automated test cases by TestLink test plan execution order. Executing single Build Steps. Executing iterative Build Steps. Looking for the test results of TestLink test cases. Looking for test results in TestNG suites. Found 0 test result(s). TestNG Reports Processing: START Looking for TestNG results report in workspace using pattern: **/target/surefire-reports/testng-results.xml Saving reports... Processing 'C:\dev\JENKINS_HOME\jobs\Manager\builds\2012-03-12_17-52-36\testng\testng-results.xml' TestNG Reports Processing: FINISH

          Nikolay Myakushkin added a comment - - edited

          My Testlink settings in attachment

          Nikolay Myakushkin added a comment - - edited My Testlink settings in attachment

          Hi Nikolay! Hope you enjoyed your vacations

          Could you attach the testng-results.xml file as well, please? And maybe a sample test case in TestLink.

          That would be helpful.

          Thanks for your feedback

          Bruno P. Kinoshita added a comment - Hi Nikolay! Hope you enjoyed your vacations Could you attach the testng-results.xml file as well, please? And maybe a sample test case in TestLink. That would be helpful. Thanks for your feedback

          All tests in testlink have Custom Fileds : Java Class, Automated, Test Methode Name.

          I think that I'M working wrong with Custom Fileds?

          Nikolay Myakushkin added a comment - All tests in testlink have Custom Fileds : Java Class, Automated, Test Methode Name. I think that I'M working wrong with Custom Fileds?

          It depends on the way you're using them

          I think it will help if I explain how the TestNG method name strategy works.

          This strategy works by parsing the TestNG XML files, concatenating <package>.<classname>#<methodname>, and then matching against each automated test case from Testlink.

          It means that in TestLink, your test case would have a custom field value (the key custom field) equals to something like com.example.MyAutomatedTest#testSomething

          Let me know if that helps

          Bruno P. Kinoshita added a comment - It depends on the way you're using them I think it will help if I explain how the TestNG method name strategy works. This strategy works by parsing the TestNG XML files, concatenating <package>.<classname>#<methodname>, and then matching against each automated test case from Testlink. It means that in TestLink, your test case would have a custom field value (the key custom field) equals to something like com.example.MyAutomatedTest#testSomething Let me know if that helps

          Sure Bruno, I have attached testng-results.xml, and testng-resultstestlinkwithsubs.xml for importing to testlink

          Nikolay Myakushkin added a comment - Sure Bruno, I have attached testng-results.xml, and testng-resultstestlinkwithsubs.xml for importing to testlink

          Thanks for the attachments Nikolay, that helped.

          The key custom field you're using in the plug-in strategy is Test Method Name. Try setting in TestLink, the value of the "Test Method Name" in your test cases to the <package>.<class>#<method> format.

          For example, your test case internal ID 86, name functional, change the value of Test Methode Name from functional to test.TestClass1#function. If everything works, the plug-in will update your test case as Passed (the status from TestNG xml file).

          Bruno P. Kinoshita added a comment - Thanks for the attachments Nikolay, that helped. The key custom field you're using in the plug-in strategy is Test Method Name. Try setting in TestLink, the value of the "Test Method Name" in your test cases to the <package>.<class>#<method> format. For example, your test case internal ID 86, name functional, change the value of Test Methode Name from functional to test.TestClass1#function. If everything works, the plug-in will update your test case as Passed (the status from TestNG xml file).

          Thank you Bruno, everything is ok. Working perfect.
          As I said before, you are making the great plugin.

          But don't forget to update Jenkins TestLink Plugin Tutorial It will be very helpful.

          Nikolay Myakushkin added a comment - Thank you Bruno, everything is ok. Working perfect. As I said before, you are making the great plugin. But don't forget to update Jenkins TestLink Plugin Tutorial It will be very helpful.

          Don't mention it Nikolay, thanks for the compliments, I hope the plug-in can help you to automate your tests with Jenkins, and keep managing them in TestLink

          Regarding the tutorial, it was due to a bad time management of my part. I decided to refactor the code to create the result seeking strategy (before that, the plug-in was using pure OO, with inheritance, and the code was very tied). My first idea was to refactor, fix bugs, write tests, update Wiki and tutorial, and then release it. But I ended having to postpone the documentation step for after the release.

          I'll update the docs throughout this week, so by Thursday or Friday we will have the Wiki and the Tutorial updated.

          Thank you again! I'll close this issue, but feel free to comment here, reopen, or e-mail me directly if you have any further issues.

          Cheers, Bruno

          Bruno P. Kinoshita added a comment - Don't mention it Nikolay, thanks for the compliments, I hope the plug-in can help you to automate your tests with Jenkins, and keep managing them in TestLink Regarding the tutorial, it was due to a bad time management of my part. I decided to refactor the code to create the result seeking strategy (before that, the plug-in was using pure OO, with inheritance, and the code was very tied). My first idea was to refactor, fix bugs, write tests, update Wiki and tutorial, and then release it. But I ended having to postpone the documentation step for after the release. I'll update the docs throughout this week, so by Thursday or Friday we will have the Wiki and the Tutorial updated. Thank you again! I'll close this issue, but feel free to comment here, reopen, or e-mail me directly if you have any further issues. Cheers, Bruno

          Fixed in 3.1.1

          Bruno P. Kinoshita added a comment - Fixed in 3.1.1

            kinow Bruno P. Kinoshita
            anm110c Nikolay Myakushkin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: