6

Currently I'm running a Maven 3 build with Selenium/WebDriver tests. Whenever a test fails, it will snap a screenshot and save it to the correct folder (for the plugin). When the job finishes, I can see all the attachments listed. I can also copy the attachments off of the Jenkins server and view them.

However, whenever I try to view them in Jenkins, I'm seeing a 404 file not found exception. I've double checked the permissions of all the files involved, tried using both .jpg and .png extensions. I've commented on the JUnit Attachments Plugin wiki page. I'm thinking that it might be a bug at this point, but wanted to see if anyone has had it work with Maven builds.

n.b. I'm using version 1.3 of the plugin, version 1.540 of Jenkins, and the correct dependency for JQuery.

Edit: This is not specific to images. I attempted this with a text file, and still get a 404.

  • I was digging into this same problem last week (and will continue). I believe this is a bug between jenkins-core, the maven-plugin, and this junit-attachment plugin. When the attachment file is stashed into (~/.jenkins) a different path is given to the attachment plugin than when the attachment is resolved for browser view/download with _hudson.plugins.junitattachments.AttachmentPublisher_ at the center of the problem. – James A Wilson Nov 25 '13 at 13:52
  • @James, thanks for the update. I found one interesting clue. Inside an individual build, look for the attachments icon on the left-nav. The link, for me, looks something like this: **http : //junit///attachments** Which leads me to believe that it's a problem with the AttachmentTestAction class (More specifically the overridden 'annotate' method). Thoughts? – Daniel Hinton Nov 25 '13 at 19:12
  • I've not yet seen any left column item. I went looking for it last week when I saw the sidepanel.jelly file in the plugin. However, when I change hudson.maven.MavenTestDataPublisher.perform method to pass the moduleBuild loop-variable to the tdp.getTestData the links in the results work. [I asked the mailing list](https://groups.google.com/forum/#!topic/jenkinsci-dev/sORiz0WA5TM) – James A Wilson Nov 25 '13 at 21:02
  • Interesting. The left-nav 'attachments' item only shows up when you're viewing the job results for a class (the same view where the actual attachments show up). If you drill down (or up) from the class view, the attachments item is no longer present in the left-nav. – Daniel Hinton Nov 25 '13 at 21:12
  • Ah! I see it. And the left-column link fails where the embedded attachment link works fine with my locally modified 2.1-SNAPSHOT maven-plugin. – James A Wilson Nov 25 '13 at 21:21
  • Any update on this? I'm having exactly the same issue with JUnit attachments 1.3 and Jenkins 1.538. – czajek Dec 18 '13 at 13:43
  • As James mentioned above, it's possible to recompile the maven plugin and then it will (mostly) work. I'd be more than happy to share the version I'm using if that would help. – Daniel Hinton Dec 18 '13 at 17:39
  • Any news here? I'm facing the same problem with my maven projects. The screenshot is fetched by the plugin and linked on the test results page, but I get a 404 when using it. Any idea what to do? – Horst Krause Oct 28 '16 at 07:15

0 Answers0