Skip to content
Newer
Older
100644 71 lines (40 sloc) 4.58 KB
008a25a @mathie Update documentation, take the liberty of bumping the release to 1.6.
mathie authored May 5, 2009
1 CI::Reporter is an add-on to Test::Unit, RSpec and Cucumber that allows you to generate XML reports of your test, spec and/or feature 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.
bfdcd21 @nicksieger - Prepare for 1.0 release; last set of changes in current svn location
nicksieger authored Feb 15, 2007
2
f02e44c @nicksieger Creating new ci_reporter svn structure
nicksieger authored Feb 15, 2007
3 == Dependencies
4
172f0a1 @nicksieger Add Aslak's patch for SPEC_OPTS (new in RSpec 1.0.6)
nicksieger authored Jun 18, 2007
5 CI::Reporter has one required dependency on Builder, but since many will have a viable version of Builder via Rails' ActiveSupport gem, Builder is not a direct dependency of the project at the moment. Instead, ensure that you have either the +builder+ or +activesupport+ gem installed before continuing. CI::Reporter will raise an exception at runtime if it cannot locate Builder.
674e745 @nicksieger - Prepare for 1.2.4 release
nicksieger authored Apr 14, 2007
6
bfdcd21 @nicksieger - Prepare for 1.0 release; last set of changes in current svn location
nicksieger authored Feb 15, 2007
7 == Installation
8
582f9f1 @nicksieger - Prepare for 1.2 release
nicksieger authored Mar 26, 2007
9 CI::Reporter is available as a gem. To install the gem, use the usual gem command:
bfdcd21 @nicksieger - Prepare for 1.0 release; last set of changes in current svn location
nicksieger authored Feb 15, 2007
10
11 gem install ci_reporter
12
13 == Usage
14
172f0a1 @nicksieger Add Aslak's patch for SPEC_OPTS (new in RSpec 1.0.6)
nicksieger authored Jun 18, 2007
15 CI::Reporter works best with projects that use a +Rakefile+ along with the standard <code>Rake::TestTask</code> or <code>Spec::Rake::SpecTask</code> tasks for running tests or examples, respectively. In this fashion, it hooks into <code>Test::Unit</code> or +RSpec+ using environment variables recognized by these custom tasks to inject the CI::Reporter code into the test or spec runs. If you're using the Rails plugin, step 1 is unnecessary; skip to step 2.
bfdcd21 @nicksieger - Prepare for 1.0 release; last set of changes in current svn location
nicksieger authored Feb 15, 2007
16
17 1. To use CI::Reporter, simply add the following lines to your Rakefile:
18
19 require 'rubygems'
20 gem 'ci_reporter'
008a25a @mathie Update documentation, take the liberty of bumping the release to 1.6.
mathie authored May 5, 2009
21 require 'ci/reporter/rake/rspec' # use this if you're using RSpec
22 require 'ci/reporter/rake/cucumber' # use this if you're using Cucumber
bfdcd21 @nicksieger - Prepare for 1.0 release; last set of changes in current svn location
nicksieger authored Feb 15, 2007
23 require 'ci/reporter/rake/test_unit' # use this if you're using Test::Unit
24
008a25a @mathie Update documentation, take the liberty of bumping the release to 1.6.
mathie authored May 5, 2009
25 2. Next, either modify your Rakefile to make the <code>ci:setup:rspec</code>, <code>ci:setup:cucumber</code> or <code>ci:setup:testunit</code> task a dependency of your test tasks, or include them on the Rake command-line before the name of the task that runs the tests or specs.
bfdcd21 @nicksieger - Prepare for 1.0 release; last set of changes in current svn location
nicksieger authored Feb 15, 2007
26
27 rake ci:setup:testunit test
28
008a25a @mathie Update documentation, take the liberty of bumping the release to 1.6.
mathie authored May 5, 2009
29 Report files are written, by default, to the <code>test/reports</code>, <code>features/reports</code> or <code>spec/reports</code> 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.
cbe1c35 @nicksieger updated documentation w/ mention of CI_REPORTS
nicksieger authored Feb 27, 2007
30
bfdcd21 @nicksieger - Prepare for 1.0 release; last set of changes in current svn location
nicksieger authored Feb 15, 2007
31 == Advanced Usage
32
35308f1 @nicksieger Move stub.rake to top directory, and update release notes and documen…
nicksieger authored Aug 29, 2007
33 If you don't have control over the Rakefile or don't want to modify it, CI::Reporter has a substitute rake file that you can specify on the command-line. It assumes that the main project rake file is called +Rakefile+ and lives in the current directory. Run like so:
34
35 rake -f GEM_PATH/stub.rake ci:setup:testunit test
36 rake -f GEM_PATH/stub.rake ci:setup:rspec spec
008a25a @mathie Update documentation, take the liberty of bumping the release to 1.6.
mathie authored May 5, 2009
37 rake -f GEM_PATH/stub.rake ci:setup:cucumber features
35308f1 @nicksieger Move stub.rake to top directory, and update release notes and documen…
nicksieger authored Aug 29, 2007
38
cbe1c35 @nicksieger updated documentation w/ mention of CI_REPORTS
nicksieger authored Feb 27, 2007
39 If for some reason you can't use the above technique to inject CI::Reporter (e.g., you're not using Rake), you'll have to do one of these:
bfdcd21 @nicksieger - Prepare for 1.0 release; last set of changes in current svn location
nicksieger authored Feb 15, 2007
40
41 1. If you're using <code>Test::Unit</code>, ensure the <code>ci/reporter/rake/test_unit_loader.rb</code> file is loaded or required at some point before the tests are run.
008a25a @mathie Update documentation, take the liberty of bumping the release to 1.6.
mathie authored May 5, 2009
42
bfdcd21 @nicksieger - Prepare for 1.0 release; last set of changes in current svn location
nicksieger authored Feb 15, 2007
43 2. If you're using +RSpec+, you'll need to pass the following arguments to the +spec+ command:
008a25a @mathie Update documentation, take the liberty of bumping the release to 1.6.
mathie authored May 5, 2009
44
bfdcd21 @nicksieger - Prepare for 1.0 release; last set of changes in current svn location
nicksieger authored Feb 15, 2007
45 --require GEM_PATH/lib/ci/reporter/rake/rspec_loader
46 --format CI::Reporter::RSpec
47
008a25a @mathie Update documentation, take the liberty of bumping the release to 1.6.
mathie authored May 5, 2009
48 3. If you're using Cucumber, you'll need to cheat slightly so that Cucumber's step definition autoloading will still work. Instead of calling the +cucumber+ script directly, run:
49
50 ruby -r GEM_PATH/lib/ci/reporter/rake/cucumber_loader -S cucumber --format CI::Reporter::Cucumber
51
126c307 @nicksieger - Prepping 1.2.1 release
nicksieger authored Mar 26, 2007
52 There's a bit of a chicken and egg problem because rubygems needs to be loaded before you can require any CI::Reporter files. If you cringe hard-coding a full path to a specific version of the gem, you can also copy the +rspec_loader+ file into your project and require it directly -- the contents are version-agnostic and are not likely to change in future releases.
53
a26f68c @nicksieger 1.2.2 release: CI_CAPTURE to control stdout/stderr capture
nicksieger authored Apr 4, 2007
54 == Environment Variables
55
56 * +CI_REPORTS+: if set, points to a directory where report files will be written.
57 * +CI_CAPTURE+: if set to value "off", stdout/stderr capture will be disabled.
58
172f0a1 @nicksieger Add Aslak's patch for SPEC_OPTS (new in RSpec 1.0.6)
nicksieger authored Jun 18, 2007
59 == Source
60
6652f76 @nicksieger Update source location README
nicksieger authored Mar 29, 2008
61 You can get the CI::Reporter source using Git, in any of the following ways:
172f0a1 @nicksieger Add Aslak's patch for SPEC_OPTS (new in RSpec 1.0.6)
nicksieger authored Jun 18, 2007
62
fab2d52 @nicksieger Version 1.6.1
nicksieger authored Mar 25, 2010
63 git clone git://git.caldersphere.net/ci_reporter.git
6652f76 @nicksieger Update source location README
nicksieger authored Mar 29, 2008
64 git clone git://github.com/nicksieger/ci_reporter.git
65
66 You can also download a tarball of the latest CI::Reporter source at http://github.com/nicksieger/ci_reporter/tree/master.
172f0a1 @nicksieger Add Aslak's patch for SPEC_OPTS (new in RSpec 1.0.6)
nicksieger authored Jun 18, 2007
67
126c307 @nicksieger - Prepping 1.2.1 release
nicksieger authored Mar 26, 2007
68 == License
69
a5302a5 @nicksieger Update README dates and switch to Darkfish RDoc
nicksieger authored Jun 25, 2010
70 This software is released under an MIT license. For details, see the LICENSE.txt file included with the distribution. The software is copyright (c) 2006-2010 Nick Sieger <nicksieger@gmail.com>.
Something went wrong with that request. Please try again.