Giter Site home page Giter Site logo

junit-attachments-plugin's Introduction

JUnit Attachments Plugin

This plugin can archive certain files (attachments) together with your JUnit results.

Attached files are shown in the JUnit results.

Image attachments are shown inline.

To activate this plugin, configure your job with "Additional test report features" and select "Publish test attachments".

How to attach files

By putting them into a known location

One way to do this is to produce files from your tests into a known location.

  • Jenkins looks for the JUnit XML report.
  • Then it looks for a directory with the name of the test class, in the same directory as the XML report.
  • Every file in this directory will be archived as an attachment to that test class.

Example:

  • test report in .../target/surefire-reports/TEST-foo.bar.MyTest.xml
  • test class is foo.bar.MyTest
  • test attachment directory: .../target/surefire-reports/foo.bar.MyTest/

By printing out the file name in a format that Jenkins will understand

The above mechanism has a problem that your test needs to know about where your test driver is producing reports to. This 2nd approach eliminates that problem by simply letting you print out arbitrary file names to stdout/stderr in the following format:

[[ATTACHMENT|/absolute/path/to/some/file]]

Each ATTACHMENT should be on its own line, without any text before or after. See Kohsuke's post for more details.

junit-attachments-plugin's People

Contributors

jglick avatar abayer avatar huybrechts avatar vlatombe avatar kohsuke avatar orrc avatar basil avatar dependabot[bot] avatar alanharder avatar notmyfault avatar topikachu avatar ndeloof avatar ladyprowess avatar tobix avatar miyajan avatar thomedw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.