Coder Social home page Coder Social logo

hsitter / ci_reporter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ci-reporter/ci_reporter

0.0 0.0 0.0 546 KB

CI::Reporter is an add-on to popular test frameworks that allows you to generate XML reports

License: MIT License

Ruby 100.00%

ci_reporter's Introduction

CI::Reporter is an add-on to Ruby testing frameworks like Test::Unit or RSpec that allows you to generate XML reports of your test runs. The resulting files can be read by a continuous integration system that understands Ant's JUnit report XML format, thus allowing your CI system to track test/spec successes and failures.

Gem Version Build Status Dependency Status Code Climate

Usage

CI::Reporter works with projects that use standard Rake tasks for running tests. In this fashion, it hooks into testing frameworks using environment variables recognized by these custom tasks to inject the CI::Reporter code into the test run.

Each supported testing framework is provided by a separate gem:

Upgrading from CI::Reporter 1.x

CI::Reporter 1.x supported all the different test frameworks in a single gem. This was convenient, but caused issues as test frameworks released new, sometimes incompatibile, versions. CI::Reporter 2.x has been split into multiple gems, allowing each gem to specify the test framework versions it supports.

To upgrade to 2.x, remove ci_reporter from your Gemfile and replace it with one or more of the framework-specific gems above.

Jenkins setup

  1. Add the "Publish JUnit test result report" post-build step in the job configuration.

  2. Enter "test/reports/*.xml,spec/reports/*.xml" in the "Test report XMLs" field (adjust this to suit which tests you are running)

Report files are written, by default, to the test/reports, features/reports or spec/reports subdirectory of your project. If you wish to customize the location, simply set the environment variable CI_REPORTS (either in the environment, on the Rake command line, or in your Rakefile) to the location where they should go.

Conditional reporting

You may not wish to always produce report files. There are two primary ways to configure this:

With environment variables

Use an environment variable in your Rakefile to control if CI:Reporter will be invoked:

if ENV['GENERATE_REPORTS'] == 'true'
  require 'ci/reporter/rake/rspec'
  task :rspec => 'ci:setup:rspec'
end

You can either inject this variable in your CI or simply call rake with the environment variable set:

GENERATE_REPORTS=true rake rspec

With CI-specific Rake tasks

Instead of modifying your existing Rake tasks, create new ones:

namespace :ci do
  task :all => ['ci:setup:rspec', 'rspec']
end

Then use this Rake target in CI:

rake ci:all

Environment Variables

  • CI_REPORTS: if set, points to a directory where report files will be written.
  • CI_CAPTURE: if set to value "off", stdout/stderr capture will be disabled.

ci_reporter's People

Contributors

ajwdev avatar amatsuda avatar amfranz avatar ari avatar bsingr avatar btaitelb avatar citrusmoose avatar dfrenkel avatar docwhat avatar ferrous26 avatar heathkit avatar jarib avatar jorgenpt avatar justfalter avatar kou avatar mathie avatar mikz avatar next2you avatar nicksieger avatar nickveys avatar orthographic-pedant avatar pkuczynski avatar realmyst avatar redross avatar rsutphin avatar sauliusgrigaitis avatar shepmaster avatar spraints avatar stopdropandrew avatar yuki24 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.