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

The files are not visible from either the test or the class page

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: In Review (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:
      Jenkins ver. 1.529, JUnit Attachments Plugin 1.3
    • Similar Issues:

      Description

      The files are not visible from either the test or the class page,

      https://github.com/marklemay/simple-failing-project

      Built with: mvn -U -Pci clean integration-test -e

        Attachments

          Issue Links

            Activity

            Hide
            dfhinton Daniel Hinton added a comment -

            I'm seeing the same issue:
            "This image failed to load."

            Built with: mvn -e clean install -Dtest=QA_Test

            Show
            dfhinton Daniel Hinton added a comment - I'm seeing the same issue: "This image failed to load." Built with: mvn -e clean install -Dtest=QA_Test
            Hide
            jrogers Jonathan Rogers added a comment -

            This appears to be identical to or very similar to JENKINS-20737

            Show
            jrogers Jonathan Rogers added a comment - This appears to be identical to or very similar to JENKINS-20737
            Hide
            mane0001 Marco Neumann added a comment -

            It seems to me that all maven projects do not work because the test results are stored in "modules" and the junit-attachments are stored in the top level build.

            I patched one source code line and the generated plugin works for our maven projects and the referenced test project "simple-failing-project".

            Patch:

            diff --git a/src/main/java/hudson/plugins/junitattachments/AttachmentPublisher.java b/src/main/java/hudson/plugins/junitattachments/AttachmentPublisher.java
            index 84ac90c..f98958e 100644
            --- a/src/main/java/hudson/plugins/junitattachments/AttachmentPublisher.java
            +++ b/src/main/java/hudson/plugins/junitattachments/AttachmentPublisher.java
            @@ -34,7 +34,7 @@
                 }
             
                 public static FilePath getAttachmentPath(AbstractBuild<?, ?> build) {
            -        return new FilePath(new File(build.getRootDir().getAbsolutePath()))
            +        return new FilePath(new File(build.getRootBuild().getRootDir().getAbsolutePath()))
                             .child("junit-attachments");
                 }
            
            Show
            mane0001 Marco Neumann added a comment - It seems to me that all maven projects do not work because the test results are stored in "modules" and the junit-attachments are stored in the top level build. I patched one source code line and the generated plugin works for our maven projects and the referenced test project "simple-failing-project". Patch: diff --git a/src/main/java/hudson/plugins/junitattachments/AttachmentPublisher.java b/src/main/java/hudson/plugins/junitattachments/AttachmentPublisher.java index 84ac90c..f98958e 100644 --- a/src/main/java/hudson/plugins/junitattachments/AttachmentPublisher.java +++ b/src/main/java/hudson/plugins/junitattachments/AttachmentPublisher.java @@ -34,7 +34,7 @@ } public static FilePath getAttachmentPath(AbstractBuild<?, ?> build) { - return new FilePath(new File(build.getRootDir().getAbsolutePath())) + return new FilePath(new File(build.getRootBuild().getRootDir().getAbsolutePath())) .child("junit-attachments"); }

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              marklemay Mark Lemay
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated: