TAP Test Results Screen NPE since junit 1372.vfea_f21efa_b_26

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major
    • Component/s: tap-plugin
    • None
    • Environment:

      Since junit plugin version 1372.vfea_f21efa_b_26, jenkins shows the "Oops, problem occurred" page when attempting to view "TAP Test Results", from a build where TAP tests results are available.  "TAP Extended Test Results" renders correctly.  Our TAP tests are created/published within declarative pipelines, eg:

      def publishTAPResults( String a_results_dir, String b_results_dir, String c_results_dir, String d_results_dir ) {

          env.a_results_dir = a_results_dir
          env.b_results_dir = b_results_dir
          env.c_results_dir = c_results_dir
          env.d_results_dir = d_results_dir

          tap_files = sh(returnStdout: true, script: 'find \"\${a_results_dir}/goss\" -name
      *.tap 2>/dev/null || true').trim()

          if (tap_files != "") {
              step([$class: "TapPublisher", testResults: "${a_results_dir}/goss/**/*.tap"])
              archiveArtifacts artifacts: "${a_results_dir}/goss/*/.tap", fingerprint: true
      {{    }}}
      <...>
      Log messages in attached file.

      "TAP Test Results" page works correctly with junit plugin 1369.v15da_00283f06.  Issue occurs on a freshly-built jenkins instance.  The plugin downgrade consistently restores the expected results page.

      The following summary text from a heavily-prompted and lengthy LLM troubleshooting;  very much hope this is in some way helpful, with my apologies because I am not a jenkins or java developer:

      The TAP plugin fails to display test results when used with junit plugin version 1372 or higher. This is caused by a *latent bug in the TAP plugin* that was exposed by a UI refactoring in junit 1372.

      *Root Cause:* TAP plugin's `TapStreamResult` class has a transient `owner` field that is never restored after deserialization from disk.

      *Breaking Change:* junit commit `feaf21e` (PR #755) moved the access of `${it.parentAction}` to the very beginning of view rendering, before any initialization occurs.

      *Result:* When the view accesses `parentAction`, it calls `getRun()` which returns the uninitialized transient field (null), causing a NullPointerException.

            Assignee:
            Bruno P. Kinoshita
            Reporter:
            James
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: