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

TAP Plugin not communicating with other plugins

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • tap-plugin
    • None
    • CentOS 6.4, Tomcat 7.0.53, Jenkins 1.562

      I have inherited a plugin (https://github.com/andrewcooke-isti/JiraTestResultReporter) that creates Jira issues from test results. It works fine with JUnit, but not with TAP. It's quite possible this is some kind of error in my plugin, so apologies in advance, but what seems to be happening is that when I call getFailedTests() on a TestResultAction instance, it returns an empty set, even when tests have failed.

      I have no idea how this information is created, but the underlying AbstractTestResultAction returns an empty set. So I wondered if perhaps you need to over-ride that? For Junit, that method returns a set of CaseResult instances that I can use to generate test reports.

      I should emphasize that your plugin seems to work fine otherwise - it parses the TAP output and generates tables of results.

      Please contact me (andrew@acooke.org) if you have more questions. I can modify my plugin to get more info if you need it.

      Thanks for your help and sorry this is so vague.

          [JENKINS-23296] TAP Plugin not communicating with other plugins

          andrew cooke added a comment -

          Hi. Some more info on this.

          I have worked around the issue by checking the type returned from AbstractBuild.getResult() and, if it's an instance of TapStreamResult, calling getFailedTests2() instead of getFailedTests().

          I have absolutely no idea why you're implementing getFailedTests() to return an empty list! That's how it's implemented in the base class, sure, but other plugins over-ride that to return their results.

          Anyway, that's the basic issue. I'm no longer waiting on a fix as I have the work-around above. Maybe there's an explanation that I'm missing. Hope this helps.

          Cheers,
          Andrew

          andrew cooke added a comment - Hi. Some more info on this. I have worked around the issue by checking the type returned from AbstractBuild.getResult() and, if it's an instance of TapStreamResult, calling getFailedTests2() instead of getFailedTests(). I have absolutely no idea why you're implementing getFailedTests() to return an empty list! That's how it's implemented in the base class, sure, but other plugins over-ride that to return their results. Anyway, that's the basic issue. I'm no longer waiting on a fix as I have the work-around above. Maybe there's an explanation that I'm missing. Hope this helps. Cheers, Andrew

          Hiya Andrew!

          Sorry for not giving any feedback on this. I've been busy with $work projects and couldn't really push any changes in Jenkins plug-ins.

          I think I put that getFailedTests2() because I didn't find a simple way to convert a TestResult into a CaseResult? Not sure tho.

          If you can send a pull request or have any advice on which is the simplest way to fix it that you imagine, I can try to push a new release this week - I'll have meetings/releases till Thursday, but Friday I want to work on some open source stuff.

          Sorry again Andrew
          Bruno

          Bruno P. Kinoshita added a comment - Hiya Andrew! Sorry for not giving any feedback on this. I've been busy with $work projects and couldn't really push any changes in Jenkins plug-ins. I think I put that getFailedTests2() because I didn't find a simple way to convert a TestResult into a CaseResult? Not sure tho. If you can send a pull request or have any advice on which is the simplest way to fix it that you imagine, I can try to push a new release this week - I'll have meetings/releases till Thursday, but Friday I want to work on some open source stuff. Sorry again Andrew Bruno

          andrew cooke added a comment -

          i am trapped in a twisty maze of classes that all look alike!

          getResult() returns an Object :o(

          the other code i am working with returns a subclass of MetaTabulatedResult at that point, whose getFailedTests() returns subclasses of TestResult.

          TapStreamResult also returns TestResults.

          so i think things may be consistent?

          i don't have a patch. we did consider it, but decided it was better to test and handle the code (sorry - short term time pressure).

          andrew cooke added a comment - i am trapped in a twisty maze of classes that all look alike! getResult() returns an Object :o( the other code i am working with returns a subclass of MetaTabulatedResult at that point, whose getFailedTests() returns subclasses of TestResult. TapStreamResult also returns TestResults. so i think things may be consistent? i don't have a patch. we did consider it, but decided it was better to test and handle the code (sorry - short term time pressure).

          No worries, it is really confusing. The plug-in itself started with TAP and a custom interface. Later, after user requests, we added support to Jenkins built-in Test Results pages.

          Some of the methods/classes you're looking at were (probably) adapted from the TestNG plug-in, and others were part of the old codebase.

          I'll leave the issue open and will try to find a way to make code simpler. Feel free to comment here too if you have any suggestions.

          All the best
          Bruno

          Bruno P. Kinoshita added a comment - No worries, it is really confusing. The plug-in itself started with TAP and a custom interface. Later, after user requests, we added support to Jenkins built-in Test Results pages. Some of the methods/classes you're looking at were (probably) adapted from the TestNG plug-in, and others were part of the old codebase. I'll leave the issue open and will try to find a way to make code simpler. Feel free to comment here too if you have any suggestions. All the best Bruno

            kinow Bruno P. Kinoshita
            acooke andrew cooke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: