Rake

Skip to end of metadata
Go to start of metadata
You are viewing documentation of TeamCity 5.x, which is not the most recent released version of TeamCity. Please refer to the listing to choose another version.
Search

Searching TeamCity 5.x Documentation

Table of Contents

In this section:

Prerequisites

Make sure to have Ruby interpreter (MRI Ruby, JRuby, IronRuby, REE, MacRuby, or etc) with rake 0.7.3 gem or higher (mandatory) and all necessary gems for your Ruby (or ROR) projects and testing frameworks installed on at least one build agent.
You can install several Ruby interpreters in different folders. On Linux/MacOS you can install interpreters using RVM. If you want to automatically configure agent requirements for this interpreters you need to register its paths in build agent configuration properties and then refer to such property name in Rake build runner configuration.
To install a gem execute:

You can refer to the Ruby Gems Manuals for more information.

If you use Ruby 1.9 for Shoulda, Test-Spec and Test::Unit frameworks to operate, the 'test-unit' gem must be installed.

Important Notes

  • Ruby's pending specs are shown as Ignored Tests in the Overwiew tab.
  • Rake Runner uses its own unit tests runner and loads it using RUBYLIB environment variable. You need to ensure your program doesn't clear this environment variable, but you may append your paths to it.
  • If you run RSpec with the '--color' option enabled under Windows OS, RSpec will suggest you install the win32console gem. This warning will appear in your build log, but you can ignore it. TeamCity Rake Runner doesn't support coloured output in the build log and doesn't use this feature.
  • Rake Runner runs spec examples with a custom formatter. If you use additional console formatter, your build log will contain redundant information.
  • Spec::Rake::SpecTask.spec_opts of your rakefile is affected by SPEC_OPTS command line parameter. Rake Runner always uses SPEC_OPTS to setup its custom formatter. Thus you should set up Spec Options in Web UI. The same limitation exist for Cucumber tests options.
  • When reporting issues, you can look up version of the Rake Runner in rakeRunnerPluginAgent.zip/version (agent plugin), and rakeRunnerPluginServer.jar/version (server plugin).
  • To include HTML reports into the Build Results, you can add corresponding report tab for them.

Rake Runner Settings

Rake Parameters

Option Description
Path to a Rakefile file Enter Rakefile path if you don't want to use a default one. Specified path should be relative to the Build Checkout Directory.
Rakefile content Type in the Rakefile content instead of using existing Rakefile. The new Rakefile will created dynamically from the specified content before running Rake.
Working directory Optional. Specify if differs from the Build Checkout Directory.
Rake tasks Enter tasks names separated by space character if you don't want to use 'default' task.
For example, 'test:functionals' or 'mytask:test mytask:test2'.
Additional Rake command line parameters Specified parameters will be added to 'rake' command line. The command line will have the following format:

Launching Parameters

Option Description
Ruby interpreter path Path to Ruby interpreter. If not specified the interpreter will be searched in the PATH.
In this field you can use values of environment and system variables. For example:

Moreover you can specify the RVM SDK name instead of the path.

RVM gemset name Specify here the name of a gemset configured on a build agent. Note, that if you want to use an RVM gemset, the interpreter specified above should be RVM interpreter.
Debug Check the Track invoke/execute stages option to enable showing Invoke stage data in the build log.

Tests Reporting

Option Description
Attached reporters If you want TeamCity to display test results on the dedicated Tests tab of the Build Results page, select here the testing framework you use: Test::Unit, Test-Spec, Shoulda, RSpec or Cucumber.
If you're using RSpec or Cucumber, make sure to specify here the user options defined in your build script, otherwise they will be ignored.

XML Report Processing

Select a report type to import. You only need to import tests reports, if the automatic tests reporting fails to detect your tests.

Option Description
Import data from Select report format from a drop-down list. The following report formats are supported: PMD, Surefire, Ant JUnit, NUnit, and FindBugs.

Known Issues

  • If your Rake tasks or tests run in parallel in the scope of one build, the build output and tests results will be inaccurate.

Development Links

Rake support is implemented as an open-source plugin. For development links refer to the plugin's page.


Labels:

ruby ruby Delete
rake rake Delete
build build Delete
runner runner Delete
xml xml Delete
reports reports Delete
test test Delete
rakefile rakefile Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.