Posts Tagged ‘cucumber’

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.

RubyMine 1.1 RC

Friday, May 22nd, 2009

RubyMine 1.1 is ready but we do not like releasing on Fridays. So, to let you try all the new stuff earlier than later, we release the Release Candidate now!

What is in RubyMine 1.1:

  • Rails 2.3 support
    • Application templates support on project creation
    • Localized views support
    • Improved code insight and rails-specific completion
  • HAML syntax highlighting
  • Cucumber BDD framework support (thanks to Aslak Hellesoy for helping from Cucumber side!)
    Note: you need the latest Cucumber 0.3.7 gem

  • Remote Debug for Ruby and Rails
  • DRb server support for RSpec.
  • And other IDE improvements such as
    • Create New Ruby Class option
    • Load selected code to IRB console (Alt+Shift+L / ⌥⇧L)
    • Platform specific IDE Help, with corresponding default shortcuts

Download RubyMine 1.1 for Windows, Mac OS X or Linux, get evaluation key, if you do not have one yet, and try it!

If you have questions about some features, ask on the forum and we’ll be glad to help.

-JetBrains RubyMine Team

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