Posts Tagged ‘test’

JetBrains TeamCity — Continuous Integration For Ruby

Friday, November 27th, 2009

There’s been lots of talks about Ruby and Rails being Agile. One of the core agile practices is Continuous Integration. And JetBrains offers its continuous integration and build management system named TeamCity.

One of the many RubyMine 2.0 additions is IDE integration with TeamCity. So, here we want to review how a Ruby/Rails project can be set up in TeamCity and what additional benefits the IDE integration brings.

We’ll not be giving a full tutorial on TeamCity setup and configuration here, we’ll link to TeamCity docs instead, which are very good, by the way. We recommend using TeamCity 5.0 as it has the ‘Rake runner’ bundled and RubyMine only supports this version.

So, after you install TeamCity, launch it, direct your browser to it, (e.g. http://localhost:8111), log in and begin adding your project to start building it.

First, create a new project, and then create a build configuration that actually configures the build process. Follow the configuration steps.

For running Ruby builds you need to select the right build runner. Most probably you want to choose Rake Runner.

Do not forget to configure test reporters for the build, so you get nice stats for all types of tests (RSpec, Cucumber, Shoulda, etc.).

Once the build configuration is ready you can ‘Run’ it to get first results.

Here are some cool things about TeamCity:

  • Instant build results — you do not need the build to finish to know some test have failed
  • Build time estimation — TeamCity tells you how long the build will run
  • Misc. build triggers — launch build on VCS commit, by schedule, or dependency from other build configuration
  • Pre-tested commit — TeamCity will perform VCS check-in of your changes only after a successful build with them (e.g. no tests fail).
  • Assign/take responsibility — responsibility can be set for a build configuration problems or failed tests.
  • Multiple notification ways such as e-mail, Jabber, RSS, IDE plugin, tray notifier.
  • Multiple supported VCS — SVN, Git, Perforce, CVS, Mercurial, etc.
  • Open source code in IDE from TeamCity web UI (works for RubyMine, IntelliJ IDEA, Eclipse, etc.)
  • View VCS check-in diffs in TeamCity web UI

Additionally, you can add custom reports to TeamCity UI. For example, if you have RCov set-up analyzing your code, you can embed its HTML report as another tab (see screenshot below, click to enlarge).

Review some TeamCity screenshots made from Cucumber and other projects builds:

So, your builds should up and running already. Time to see how we can work with TeamCity from RubyMine. Let’s install the IDE plugin.

For this, in TeamCity UI go to My Settings & Tools and from TeamCity Tools section, download the IntelliJ Platform plugin. For plugin installation instructions refer to Installing Plugin Manually.

When you relaunch RubyMine you will notice a new icon in the status bar and a new TeamCity menu item. You need to configure the server and log in to it to see your builds. Make sure you configure watched projects/builds under IDE Notifier in Watched Builds and Notifications section.

Now, with the IDE plugin, you can:

  • Start/stop builds from RubyMine
  • View build stats from RubyMine
  • Receive build results notifications in the IDE

As always, we look forward to hear your thoughts on this. Welcome to our issue tracker and discussion forum. There’s also TeamCIty forum where you can ask questions about the system
To be continued..

Testing RubyMine with Cucumber

Tuesday, August 18th, 2009

We’ve recently tried to do some dogfooding of our updated Cucumber support and to write some RubyMine tests with it. And we actually liked the result so much that we’re now writing most of our new tests with Cucumber, and slowly accumulating a set of step definitions for testing RubyMine code. Since RubyMine is a Java application, we obviously have to run Cucumber under JRuby, and we also use JRuby for writing the step definitions.

We have our Cucumber tests running as part of our continuous integration build on TeamCity. Since we have a Cucumber formatter that outputs results in the format of TeamCity service messages, we can run Cucumber tests in the same build as our main JUnit tests and aggregate the reporting for passed and failed tests.

Of course, the real use of Cucumber gives us a lot of ideas for features which can be implemented to improve our Cucumber support in RubyMine even more — and eventually, you’ll see them in new EAP builds of RubyMine.

What’s mining: Cucumber support

Wednesday, May 13th, 2009

We’ve heard a lot of buzz around Cucumber BDD framework during the RailsConf. We ourselves, think Cucumber is very interesting. Aslak Hellesøy (the author of the framework) has been presenting it on a session and the tool was mentioned on many other sessions and tutorials.

Aslak has also come to our booth to ask about our Cucumber support plans. We had not worked on it before the RailsConf. But…

We’ve been mining… during session breaks, during the flights back home and so on.

So, with the nearest update RubyMine will provide initial support for Cucumber. It will include the syntax highlighting for Cucumber steps and definition files. In RubyMine 1.1, scheduled before the end of May, will also add special run configurations and some more intelligence and assistance for testing with Cucumber.

Stay tuned for updates!

-JetBrains RubyMine Team

BDD with RSpec in RubyMine

Monday, March 23rd, 2009

We, at JetBrains in general, and in RubyMine team in particular, pay big attention to unit testing of our code. And as first users of our own products we try to make unit testing tightly integrated with the major development tasks adding features for easy test-code navigation, tests execution, etc.

Ruby and Rails developers have a great RSpec framework for doing behavior-driven development. We provide a good level of integration with RSpec in RubyMine for Ruby and for Rails projects. And the support for the latest RSpec 1.2 release is already available.

We captured a short screencast (5 mins) that demonstrates the development process when you start a feature with a test. The demo shows the useful features, shortcuts and shows off the RubyMine’s Test Runner UI. The features are demonstrated while adding new functionality to our real-live Exception Analyzer application.

Here is the couple of screenshots:


Code completion and quick doc lookup

RubyMine Test Runner UI


RubyMine also supports other test frameworks such as Test::Unit and test/spec.

View screencast online (5 min) or Download demo movie (27Mb, QuickTime)

Develop and test with pleasure using RubyMine!

Continuous Integration for Ruby on Rails Projects

Friday, November 28th, 2008

Our neighbor TeamCity team just released new major version of JetBrains TeamCity — definitely the best continuous integration and build server.

One of the guys has prepared a quick demo showing how he uses TeamCity for building and testing his own Ruby on Rails project.

Check it out in TeamCity Developers’ Blog.

It looks interesting.