Giter VIP home page Giter VIP logo

junit-annotate-buildkite-plugin's Introduction

JUnit Annotate Buildkite Plugin

A Buildkite plugin that parses junit.xml artifacts (generated across any number of parallel steps) and creates a build annotation listing the individual tests that failed.

Example

The following pipeline will run test.sh jobs in parallel, and then process all the resulting JUnit XML files to create a summary build annotation.

steps:
  - command: test.sh
    parallelism: 50
    artifact_paths: tmp/junit-*.xml
  - wait: ~
    continue_on_failure: true
  - plugins:
      - junit-annotate#v1.7.0:
          artifacts: tmp/junit-*.xml

Configuration

artifacts (required)

The artifact glob path to find the JUnit XML files.

Example: tmp/junit-*.xml

job-uuid-file-pattern (optional)

Default: -(.*).xml

The regular expression (with capture group) that matches the job UUID in the junit file names. This is used to create the job links in the annotation.

To use this, configure your test reporter to embed the $BUILDKITE_JOB_ID environment variable into your junit file names. For example "junit-buildkite-job-$BUILDKITE_JOB_ID.xml".

failure-format (optional)

Default: classname

This setting controls the format of your failed test in the main annotation summary.

There are two options for this:

  • classname
    • displays: MyClass::UnderTest text of the failed expectation in path.to.my_class.under_test
  • file
    • displays: MyClass::UnderTest text of the failed expectation in path/to/my_class/under_test.file_ext

fail-build-on-error (optional)

Default: false

If this setting is true and any errors are found in the JUnit XML files during parsing, the annotation step will exit with a non-zero value, which should cause the build to fail.

Developing

To test the plugin hooks (in Bash) and the junit parser (in Ruby):

docker-compose run --rm plugin &&
docker-compose run --rm ruby

To test the Ruby parser locally:

cd ruby
rake

To test your plugin in your builds prior to opening a pull request, you can refer to your fork and SHA from a branch in your pipeline.yml.

steps:
  - label: Annotate
    plugins:
      - YourGithubHandle/junit-annotate#v1.7.0:
          ...

License

MIT (see LICENSE)

junit-annotate-buildkite-plugin's People

Contributors

benmacleod avatar berfarah avatar boomper-bot[bot] avatar martinbaillie avatar renovate-bot avatar toolmantim avatar

Stargazers

 avatar

Watchers

 avatar  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.