TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

Rake

Last modified: 20 April 2023

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 it is easier to configure using RVM or rbenv. It is possible to install Ruby interpreter and necessary Ruby gems using the Command Line build runner step. If you want to automatically configure agent requirements for this interpreters, you need to register its paths in the build agent configuration properties and then refer to such property name in the Rake build runner configuration. To install a gem, execute:

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

Instead of the gem command, you can install gems using the Bundler gem.

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 the 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 set up its custom formatter. Thus you should set up Spec Options in Web UI. The same limitation exists for Cucumber tests options.

  • To include HTML reports into the Build Results, you can add the corresponding report tab for them.

Rake Runner Settings



Rake Parameters



Ruby Interpreter



Launching Parameters



Tests Reporting



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.

  • If you are using RVM, it is recommended to start TeamCity agent when the current rvm sdk isn't set or to invoke the "rvm system" at first.

Additional Runner Options



These options can be configured using system properties in the Build Parameters section.

Development Links



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