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

NullPointerException with TAP plugin version 2.4.0

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • tap-plugin
    • None
    • Debian bullseye
      Jenkins 2.426.2
      openjdk-11-jdk-headless 11.0.21+9-1~deb11u1

      The latest version of the TAP plugin fails hard for me:

      15:49:08 java.lang.NullPointerException
      15:49:08 	at org.tap4j.plugin.TapPublisher.isPerformPublisher(TapPublisher.java:395)
      15:49:08 	at org.tap4j.plugin.TapPublisher.performImpl(TapPublisher.java:273)
      15:49:08 	at org.tap4j.plugin.TapPublisher.perform(TapPublisher.java:268)
      15:49:08 	at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
      15:49:08 	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
      15:49:08 	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      15:49:08 	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818)
      15:49:08 	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:767)
      15:49:08 	at hudson.model.Build$BuildExecution.post2(Build.java:179)
      15:49:08 	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:711)
      15:49:08 	at hudson.model.Run.execute(Run.java:1918)
      15:49:08 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
      15:49:08 	at hudson.model.ResourceController.execute(ResourceController.java:101)
      15:49:08 	at hudson.model.Executor.run(Executor.java:442)
      15:49:08 Build step 'Publish TAP Results' marked build as failure

      Example of the TAP plugin configuration for such a failing Jenkins job:

          <org.tap4j.plugin.TapPublisher plugin="tap@2.4.0">
            <testResults>reports/**</testResults>
            <failIfNoResults>false</failIfNoResults>
            <failedTestsMarkBuildAsFailure>false</failedTestsMarkBuildAsFailure>
            <outputTapToConsole>true</outputTapToConsole>
            <enableSubtests>true</enableSubtests>
            <discardOldReports>false</discardOldReports>
            <todoIsFailure>true</todoIsFailure>
            <includeCommentDiagnostics>false</includeCommentDiagnostics>
            <validateNumberOfTests>false</validateNumberOfTests>
            <planRequired>true</planRequired>
            <verbose>true</verbose>
            <showOnlyFailures>false</showOnlyFailures>
          </org.tap4j.plugin.TapPublisher>
      

      Downgrading the TAP plugin to version 2.3 fixes this NullPointerException issue for me.

      Let me know if you need any further information from my side or if should try/test anything specific.

      BTW: https://plugins.jenkins.io/tap/ doesn't list the latest v2.4.0 in the release notes.

          [JENKINS-72558] NullPointerException with TAP plugin version 2.4.0

          It's my Maven version! Newer versions block dependencies served over http, and looks like one of the dependencies of the previous version doesn't have an https version (or some transitive dep?). – https://stackoverflow.com/a/74600959

          Build tool problem solved Now onto this :bug:

          Bruno P. Kinoshita added a comment - It's my Maven version! Newer versions block dependencies served over http, and looks like one of the dependencies of the previous version doesn't have an https version (or some transitive dep?). – https://stackoverflow.com/a/74600959 Build tool problem solved Now onto this :bug:

          Replicated and fixed locally. Do you have a testbed server where you could try this hpi, please, mika ? The issue was that I mistakenly removed the readObject method from that object in the last release. I've attached the file I created called "tap-2024-01-15.hpi". Cheers.

          Bruno P. Kinoshita added a comment - Replicated and fixed locally. Do you have a testbed server where you could try this hpi, please, mika ? The issue was that I mistakenly removed the readObject method from that object in the last release. I've attached the file I created called "tap-2024-01-15.hpi". Cheers.

          (If you cannot test it I can cut a 2.4.1 and publish to central, so you can try that one – let me know which one you prefer)

          Bruno P. Kinoshita added a comment - (If you cannot test it I can cut a 2.4.1 and publish to central, so you can try that one – let me know which one you prefer)

          PR: https://github.com/jenkinsci/tap-plugin/pull/36 (waiting to see if others can test it before merging and releasing)

          Bruno P. Kinoshita added a comment - PR: https://github.com/jenkinsci/tap-plugin/pull/36 (waiting to see if others can test it before merging and releasing)

          kinow great, thanks! More than happy to test the tap-2024-01-15.hpi on our testing system, but I'm afraid I can't the file anywhere here?

          Michael Prokop added a comment - kinow great, thanks! More than happy to test the tap-2024-01-15.hpi on our testing system, but I'm afraid I can't the file anywhere here?

          Oh, sorry, I think I forgot to attach it: tap-2024-01-18.hpi. Should be attached now.

          Bruno P. Kinoshita added a comment - Oh, sorry, I think I forgot to attach it: tap-2024-01-18.hpi. Should be attached now.

          Jepp, I can confirm that with your tap-2024-01-18.hpi AKA 2.4.1-SNAPSHOT (private-4af97b41-kinow) it works fine:
          TAP Reports Processing: FINISH
          Can't see any further nullpointer exceptions and LGTM. Thanks!

          Michael Prokop added a comment - Jepp, I can confirm that with your tap-2024-01-18.hpi AKA 2.4.1-SNAPSHOT (private-4af97b41-kinow) it works fine: TAP Reports Processing: FINISH Can't see any further nullpointer exceptions and LGTM. Thanks!

          Excellent! Will cut a release right now then. By the way, I also managed to write a unit test and fix the XSS bug in the TAP Plug-in. If you open the plug-in page/wiki there's a warning for that (i.e. it's public already).

          I will release the fix for the null pointer first so that we minimize the changes in each release, but just in case you see another release tomorrow or over the next days, that'll be fox the XSS issue.

          Thanks for testing it. 2.4.1 released.

          Bruno P. Kinoshita added a comment - Excellent! Will cut a release right now then. By the way, I also managed to write a unit test and fix the XSS bug in the TAP Plug-in. If you open the plug-in page/wiki there's a warning for that (i.e. it's public already). I will release the fix for the null pointer first so that we minimize the changes in each release, but just in case you see another release tomorrow or over the next days, that'll be fox the XSS issue. Thanks for testing it. 2.4.1 released.

          In 2.4.1

          Bruno P. Kinoshita added a comment - In 2.4.1

          Wonderful, thank you, Bruno!

          Michael Prokop added a comment - Wonderful, thank you, Bruno!

            kinow Bruno P. Kinoshita
            mika Michael Prokop
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: