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

clicking HTML Report link logs user out of Hudson, goes to other job

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not A Defect
    • Component/s: clover-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      Hello! I have been really enjoying the Clover plugin. However recently I tried
      to split out a job into parts to run faster and aggregate into a master job, and
      had problems. Here's how I did it:

      1. Create a job, foo-coverage, which generates clover coverage xml and html, and
      enable the Clover plugin, pointing it at the XML. Everything works perfectly for
      this project including the HTML link.

      2. Now, trigger foo-coverage from the master job, and grab the xml and a zip of
      the html from the workspace, unzipping and putting these in the workspace of the
      master. Enable the Clover plugin in the master, pointing it at the XML.

      This is where the problem happens. It picks up on the XML just fine and shows
      the summary. However when I click the HTML link on the master project, I get
      logged out AND sent to the summary page for foo-coverage (with no coverage
      available), even though I clicked from the master.

      Somehow Clover is getting mixed up about these jobs I think. I looked in the XML
      file and there is no reference to the foo-coverage that I can see.

        Attachments

          Activity

          Hide
          mcrooney mcrooney added a comment -

          Okay, I figured out the cause of problem, but not why it actually behaves this way. It was because the root of my workspace had an unrelated index.html file in it, so Clover archived my entire workspace for each build! Then this resulted in quite buggy behavior when clicking the HTML report. Now that I've removed the other index.html, Clover correctly finds the actual Clover HTML directory and displays/archives that. However it seems like it could do a better job of detecting the coverage directory and why it was logging me out and taking me to another project seems like a bug as well, but at least it isn't happening to me anymore.

          Show
          mcrooney mcrooney added a comment - Okay, I figured out the cause of problem, but not why it actually behaves this way. It was because the root of my workspace had an unrelated index.html file in it, so Clover archived my entire workspace for each build! Then this resulted in quite buggy behavior when clicking the HTML report. Now that I've removed the other index.html, Clover correctly finds the actual Clover HTML directory and displays/archives that. However it seems like it could do a better job of detecting the coverage directory and why it was logging me out and taking me to another project seems like a bug as well, but at least it isn't happening to me anymore.
          Hide
          marekparf Marek Parfianowicz added a comment -

          In my opinion the behavior is correct. It looks for the directory containing index.html file in the coverage report directory:

          private boolean copyHtmlReport(FilePath coverageReport, FilePath buildTarget, TaskListener listener) throws IOException, InterruptedException {
              // Copy the HTML coverage report
              final FilePath htmlIndexHtmlPath = findOneDirDeep(coverageReport, "index.html");

          and the coverageReport argument is set to:

          String reportDir = env.expand(cloverReportDir);
          FilePath coverageReportDir = workspace.child(reportDir);
          

          where the cloverReportDir is a folder specified in "Clover report directory" option in UI.

          So in case you have an empty value in it and an index.html file in the workspace root, Clover will copy the entire workspace.

          In order to fix it you simply have to specify a correct folder containing HTML report.

          Show
          marekparf Marek Parfianowicz added a comment - In my opinion the behavior is correct. It looks for the directory containing index.html file in the coverage report directory: private boolean copyHtmlReport(FilePath coverageReport, FilePath buildTarget, TaskListener listener) throws IOException, InterruptedException { // Copy the HTML coverage report final FilePath htmlIndexHtmlPath = findOneDirDeep(coverageReport, "index.html" ); and the coverageReport argument is set to: String reportDir = env.expand(cloverReportDir); FilePath coverageReportDir = workspace.child(reportDir); where the cloverReportDir is a folder specified in "Clover report directory" option in UI. So in case you have an empty value in it and an index.html file in the workspace root, Clover will copy the entire workspace. In order to fix it you simply have to specify a correct folder containing HTML report.

            People

            Assignee:
            marekparf Marek Parfianowicz
            Reporter:
            mcrooney mcrooney
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: