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

JavaScript error in history.js: $(...).tooltip is not a function

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • junit-plugin
    • None
    • Jenkins 2.263.1
      JUnit Plugin 1.48
      ECharts API Plugin 4.9.0-2
      Microsoft Edge Version 87.0.664.75 (Official build) (64-bit)

      At https://REDACTED/jenkins/job/REDACTED/job/master/327/testReport/history/, Microsoft Edge developer console shows the following:

      jquery.min.js:2 jQuery.Deferred exception: $(...).tooltip is not a function TypeError: $(...).tooltip is not a function
          at HTMLDocument.<anonymous> (https://REDACTED/jenkins/static/316c5f91/plugin/junit/history/history.js:10:38)
          at e (https://REDACTED/jenkins/static/316c5f91/plugin/jquery3-api/webjars/jquery.min.js:2:30005)
          at t (https://REDACTED/jenkins/static/316c5f91/plugin/jquery3-api/webjars/jquery.min.js:2:30307) undefined
      
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/d8212cb1-f52d-4a86-b595-aa4425e1094c/getTestDurationTrend".
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/0a01b1f5-79bd-41e3-a007-f6fb850ba950/getTestResultTrend".
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/0a01b1f5-79bd-41e3-a007-f6fb850ba950/getTestDurationTrend".
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/8e50018f-d955-4ea8-8015-3082ba0009c6/getTestDurationTrend".
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/d8212cb1-f52d-4a86-b595-aa4425e1094c/getTestResultTrend".
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/8e50018f-d955-4ea8-8015-3082ba0009c6/getTestResultTrend".
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/ea372422-4d36-4f4e-b661-5e2114cb9eaa/getTestDurationTrend".
      prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/ea372422-4d36-4f4e-b661-5e2114cb9eaa/getTestResultTrend".
      
      jquery.min.js:2 Uncaught TypeError: $(...).tooltip is not a function
          at HTMLDocument.<anonymous> (VM2605 history.js:10)
          at e (jquery.min.js:2)
          at t (jquery.min.js:2)
      

      It seems the $('[data-toggle="tooltip"]').tooltip(); has been copied to history.js from issues-detail.js in warnings-ng-plugin, which has data-toggle="tooltip" attributes in several files, such as property.jelly. However, JUnit Plugin does not seem to set this attribute anywhere; the only occurrences of of "toggle" and "tooltip" are in history.js itself and in a comment in AbstractTestResultAction.java. Therefore, I think the tooltip call is not useful in JUnit Plugin and should be removed.

      (This caught my eye while I was trying to find what causes JENKINS-64586.)

          [JENKINS-64585] JavaScript error in history.js: $(...).tooltip is not a function

          Kalle Niemitalo created issue -
          Kalle Niemitalo made changes -
          Link New: This issue is caused by JENKINS-62096 [ JENKINS-62096 ]
          Kalle Niemitalo made changes -
          Description Original: At https://REDACTED/jenkins/job/REDACTED/job/master/327/testReport/history/, Microsoft Edge developer console shows the following:

          {noformat}
          jquery.min.js:2 jQuery.Deferred exception: $(...).tooltip is not a function TypeError: $(...).tooltip is not a function
              at HTMLDocument.<anonymous> (https://REDACTED/jenkins/static/316c5f91/plugin/junit/history/history.js:10:38)
              at e (https://REDACTED/jenkins/static/316c5f91/plugin/jquery3-api/webjars/jquery.min.js:2:30005)
              at t (https://REDACTED/jenkins/static/316c5f91/plugin/jquery3-api/webjars/jquery.min.js:2:30307) undefined
          {noformat}

          {noformat}
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/d8212cb1-f52d-4a86-b595-aa4425e1094c/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/0a01b1f5-79bd-41e3-a007-f6fb850ba950/getTestResultTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/0a01b1f5-79bd-41e3-a007-f6fb850ba950/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/8e50018f-d955-4ea8-8015-3082ba0009c6/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/d8212cb1-f52d-4a86-b595-aa4425e1094c/getTestResultTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/8e50018f-d955-4ea8-8015-3082ba0009c6/getTestResultTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/ea372422-4d36-4f4e-b661-5e2114cb9eaa/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/ea372422-4d36-4f4e-b661-5e2114cb9eaa/getTestResultTrend".
          {noformat}

          {noformat}
          jquery.min.js:2 Uncaught TypeError: $(...).tooltip is not a function
              at HTMLDocument.<anonymous> (VM2605 history.js:10)
              at e (jquery.min.js:2)
              at t (jquery.min.js:2)
          {noformat}

          I think it means {{$('[data-toggle="tooltip"]').tooltip();}} in [history.js|https://github.com/jenkinsci/junit-plugin/blob/fdb46958fa9732dfafd4b72554995b34add531f2/src/main/webapp/history/history.js#L6-L11] is executed before the HTTP server responds to the getTestDurationTrend and getTestResultTrend requests, so there is no data-toggle="tooltip" attribute in any element yet. Although history.js runs that code within {{$(function () &#123; ... &#125;)}}, i.e. when the DOM has finished loading, it does not mean that the trend data has also finished loading.

          (This caught my eye while I was trying to debug why the test duration chart does not appear at all, even though the test result chart appears OK. However, if I comment out the {{$('[data-toggle="tooltip"]').tooltip();}} call, then the test duration chart still does not appear, so it must be caused by something else.)
          New: At https://REDACTED/jenkins/job/REDACTED/job/master/327/testReport/history/, Microsoft Edge developer console shows the following:

          {noformat}
          jquery.min.js:2 jQuery.Deferred exception: $(...).tooltip is not a function TypeError: $(...).tooltip is not a function
              at HTMLDocument.<anonymous> (https://REDACTED/jenkins/static/316c5f91/plugin/junit/history/history.js:10:38)
              at e (https://REDACTED/jenkins/static/316c5f91/plugin/jquery3-api/webjars/jquery.min.js:2:30005)
              at t (https://REDACTED/jenkins/static/316c5f91/plugin/jquery3-api/webjars/jquery.min.js:2:30307) undefined
          {noformat}

          {noformat}
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/d8212cb1-f52d-4a86-b595-aa4425e1094c/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/0a01b1f5-79bd-41e3-a007-f6fb850ba950/getTestResultTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/0a01b1f5-79bd-41e3-a007-f6fb850ba950/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/8e50018f-d955-4ea8-8015-3082ba0009c6/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/d8212cb1-f52d-4a86-b595-aa4425e1094c/getTestResultTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/8e50018f-d955-4ea8-8015-3082ba0009c6/getTestResultTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/ea372422-4d36-4f4e-b661-5e2114cb9eaa/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/ea372422-4d36-4f4e-b661-5e2114cb9eaa/getTestResultTrend".
          {noformat}

          {noformat}
          jquery.min.js:2 Uncaught TypeError: $(...).tooltip is not a function
              at HTMLDocument.<anonymous> (VM2605 history.js:10)
              at e (jquery.min.js:2)
              at t (jquery.min.js:2)
          {noformat}

          I think it means {{$('[data-toggle="tooltip"]').tooltip();}} in [history.js|https://github.com/jenkinsci/junit-plugin/blob/fdb46958fa9732dfafd4b72554995b34add531f2/src/main/webapp/history/history.js#L6-L11] is executed before the HTTP server responds to the getTestDurationTrend and getTestResultTrend requests, so there is no data-toggle="tooltip" attribute in any element yet. Although history.js runs that code within {{$(function () &#123; ... &#125;)}}, i.e. when the DOM has finished loading, it does not mean that the trend data has also finished loading.

          (This caught my eye while I was trying to find what causes JENKINS-64586.)
          Kalle Niemitalo made changes -
          Link New: This issue relates to JENKINS-64586 [ JENKINS-64586 ]
          Kalle Niemitalo made changes -
          Remote Link New: This issue links to ".ready() | jQuery API Documentation (Web Link)" [ 26435 ]
          Kalle Niemitalo made changes -
          Description Original: At https://REDACTED/jenkins/job/REDACTED/job/master/327/testReport/history/, Microsoft Edge developer console shows the following:

          {noformat}
          jquery.min.js:2 jQuery.Deferred exception: $(...).tooltip is not a function TypeError: $(...).tooltip is not a function
              at HTMLDocument.<anonymous> (https://REDACTED/jenkins/static/316c5f91/plugin/junit/history/history.js:10:38)
              at e (https://REDACTED/jenkins/static/316c5f91/plugin/jquery3-api/webjars/jquery.min.js:2:30005)
              at t (https://REDACTED/jenkins/static/316c5f91/plugin/jquery3-api/webjars/jquery.min.js:2:30307) undefined
          {noformat}

          {noformat}
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/d8212cb1-f52d-4a86-b595-aa4425e1094c/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/0a01b1f5-79bd-41e3-a007-f6fb850ba950/getTestResultTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/0a01b1f5-79bd-41e3-a007-f6fb850ba950/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/8e50018f-d955-4ea8-8015-3082ba0009c6/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/d8212cb1-f52d-4a86-b595-aa4425e1094c/getTestResultTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/8e50018f-d955-4ea8-8015-3082ba0009c6/getTestResultTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/ea372422-4d36-4f4e-b661-5e2114cb9eaa/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/ea372422-4d36-4f4e-b661-5e2114cb9eaa/getTestResultTrend".
          {noformat}

          {noformat}
          jquery.min.js:2 Uncaught TypeError: $(...).tooltip is not a function
              at HTMLDocument.<anonymous> (VM2605 history.js:10)
              at e (jquery.min.js:2)
              at t (jquery.min.js:2)
          {noformat}

          I think it means {{$('[data-toggle="tooltip"]').tooltip();}} in [history.js|https://github.com/jenkinsci/junit-plugin/blob/fdb46958fa9732dfafd4b72554995b34add531f2/src/main/webapp/history/history.js#L6-L11] is executed before the HTTP server responds to the getTestDurationTrend and getTestResultTrend requests, so there is no data-toggle="tooltip" attribute in any element yet. Although history.js runs that code within {{$(function () &#123; ... &#125;)}}, i.e. when the DOM has finished loading, it does not mean that the trend data has also finished loading.

          (This caught my eye while I was trying to find what causes JENKINS-64586.)
          New: At https://REDACTED/jenkins/job/REDACTED/job/master/327/testReport/history/, Microsoft Edge developer console shows the following:

          {noformat}
          jquery.min.js:2 jQuery.Deferred exception: $(...).tooltip is not a function TypeError: $(...).tooltip is not a function
              at HTMLDocument.<anonymous> (https://REDACTED/jenkins/static/316c5f91/plugin/junit/history/history.js:10:38)
              at e (https://REDACTED/jenkins/static/316c5f91/plugin/jquery3-api/webjars/jquery.min.js:2:30005)
              at t (https://REDACTED/jenkins/static/316c5f91/plugin/jquery3-api/webjars/jquery.min.js:2:30307) undefined
          {noformat}

          {noformat}
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/d8212cb1-f52d-4a86-b595-aa4425e1094c/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/0a01b1f5-79bd-41e3-a007-f6fb850ba950/getTestResultTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/0a01b1f5-79bd-41e3-a007-f6fb850ba950/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/8e50018f-d955-4ea8-8015-3082ba0009c6/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/d8212cb1-f52d-4a86-b595-aa4425e1094c/getTestResultTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/8e50018f-d955-4ea8-8015-3082ba0009c6/getTestResultTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/ea372422-4d36-4f4e-b661-5e2114cb9eaa/getTestDurationTrend".
          prototype.js:1585 XHR finished loading: POST "https://REDACTED/jenkins/$stapler/bound/ea372422-4d36-4f4e-b661-5e2114cb9eaa/getTestResultTrend".
          {noformat}

          {noformat}
          jquery.min.js:2 Uncaught TypeError: $(...).tooltip is not a function
              at HTMLDocument.<anonymous> (VM2605 history.js:10)
              at e (jquery.min.js:2)
              at t (jquery.min.js:2)
          {noformat}

          It seems the {{$('[data-toggle="tooltip"]').tooltip();}} has been copied to [history.js|https://github.com/jenkinsci/junit-plugin/blob/fdb46958fa9732dfafd4b72554995b34add531f2/src/main/webapp/history/history.js#L6-L11] from [issues-detail.js in warnings-ng-plugin|https://github.com/jenkinsci/warnings-ng-plugin/blob/0004886ccfdd5e19db9c011a35541380425442d5/plugin/src/main/webapp/js/issues-detail.js#L52-L57], which has {{data-toggle="tooltip"}} attributes in several files, such as [property.jelly|https://github.com/jenkinsci/warnings-ng-plugin/blob/0004886ccfdd5e19db9c011a35541380425442d5/plugin/src/main/resources/issues/property.jelly#L43-L45]. However, JUnit Plugin does not seem to set this attribute anywhere; the only occurrences of of "toggle" and "tooltip" are in history.js itself and in a comment in [AbstractTestResultAction.java|https://github.com/jenkinsci/junit-plugin/blob/fdb46958fa9732dfafd4b72554995b34add531f2/src/main/java/hudson/tasks/test/AbstractTestResultAction.java#L376]. Therefore, I think the tooltip call is not useful in JUnit Plugin and should be removed.

          (This caught my eye while I was trying to find what causes JENKINS-64586.)
          Ramon Leon made changes -
          Assignee New: Ramon Leon [ mramonleon ]
          Ramon Leon made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Tim Jacomb made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Fixed but Unreleased [ 10203 ]
          Tim Jacomb made changes -
          Assignee Original: Ramon Leon [ mramonleon ] New: Tim Jacomb [ timja ]
          Tim Jacomb made changes -
          Released As New: https://github.com/jenkinsci/junit-plugin/releases/tag/junit-1.52
          Status Original: Fixed but Unreleased [ 10203 ] New: Resolved [ 5 ]

            timja Tim Jacomb
            kon Kalle Niemitalo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: