Dec 6, 2007

What I like about TeamCity: Pre-tested commit

I am one of the TeamCity developers so you can surely consider my opinion to be biased. But I am speaking here of a typical problems that any of you can experience and will try not to brag about my product too much ;-)

I'm a software developer. And though TeamCity is not an individual tool like IntelliJ IDEA, I'd like to present TeamCity features which ease my life as a software developer.

Pre-tested commit


In days before TeamCity, I used to write the following command line:
kir@work:~$ ant test && svn ci -m "FBQ-3324 fixed"

As you see, all I want is to ensure that my changes don't break tests and commit them the to version control afterwards. Usually, I wrote such a command once a day, right before going home.

Why I did so? Running the tests was a rather long process, because there were plenty integration and functional tests. And this situation is quite normal for non-pet projects. And still, I want to run all the tests to ensure that my changes won't break the build and the team is not affected by problems in my code.

Unfortunately, running a full suite of tests on the own machine is a luxury I can afford only when going home (or in the lunch time). Usually the computer load caused by running tests is pretty high and interrupts the productive development process.

Back to TeamCity. My current use case is as follows:

  1. I do some modifications in the code, write more tests
  2. I send the changelist to TeamCity and mark build configurations to be built with my changes. I also set checkbox "Commit if build successful" (see the illustration screenshot below)
  3. I continue working with the code (edit same files, write more tests)
  4. If TeamCity builds were successful, my IDE got the corresponding notification and my changes made in position 2 are sent to the version control. I continue working with the code, preparing for the new pre-tested commit.
  5. If the TeamCity builds were unsuccessful, I get the information about failed tests, navigate to the failing stacktrace (all within IDE), and fix discovered problems. I.e. the build with my problematic code was run on TeamCity build agent and didn't affect the version control and my team mates' work.
  6. The TeamCity build may be unsuccessful, but no new tests has failed (this information is also provided by TeamCity). In this case I may decide to force commit of my changes. I am on the safe side when doing that, because TeamCity IDE plugin remembers the state of my code when remote build was initiated.




So, as you can see, I am pretty confident that my changes won't break the build and the bad code won't go to the version control. And I like this.

What happens, when someone else commits changes and these changes conflict with mine? In such case, my commit will be rejected and IDE plugin will notify me about that. I'll have to update changed files from the version control and resolve the conflict manually - no unexpected magic here.

Please note, that TeamCity supports this scenario with different IDEs, including IntelliJ IDEA 6.0/7.0, Eclipse, and Visual Studio, with minor variations.

This feature is described on the JetBrains site in more detail, but may be it's better to try it and see for yourself.

Good luck and successful builds,
KIR

Oct 4, 2007

Problem with offsetTop and element position location in IE

This is just a small note for someone looking into a similar problem.

I was implementing keyboard navigation with explicit scrolling using scrollTo method, and found out that in IE I cannot get correct values for element position on the page. I use Prototype and it's Position.cumulativeOffset method (which, in turn, uses offetTop/offsetParent properties of the element). Position calculation worked fine in FF, Safari and Opera, but sometimes failed in IE.

The DOM tree I was operating with consisted of several nested UL, LI, SPAN elements (SPAN inside LI).

I added some debug code and found out, that SPAN elements sometimes got huge offset relative to LI, though it should be simply 0 (FF showed value of -1).

The solution to the problem was to add position:relative style to the SPAN, after that the problem disappears.

Unfortunately, I was unable to reproduce the problem with a simple test case to give the example here.



Sep 9, 2007

How to run rake tasks for non-development rails environments

I’ve found that parameters passed to rake tasks in the form “name=value” are converted into the environment variables. This magic is done by rake itself when parsing command-line parameters. It has an interesting consequence – you can run some db-oriented rake tasks for any of your ruby on rails environments. For instance, to migrate your production database to the latest version you can run:
rake db:migrate RAILS_ENV=production

This knowledge is also useful when writing custom rake tasks; you can access environment variables using predefined ENV hash (you can also access rake command line parameters using ARGV hash).



Mar 1, 2007

How EAP works

I'm really excited how TeamCity EAP program works. Using our discussion forum, people report bug, problems, enhancements, features, ask for and got real help. We're trying hard to answer all questions and requests, and though it takes noticeable time, it's worth doing it.

One small example.

Some time ago we got a message from Jacques Morel regarding support for third-party reporting tools in TeamCity. After some discussion with Dave Griffith and Tim McNerney it turned into an interesting feature - custom reporting tab for any third-party reporting tool, which provides report in web-enabled format (e.g. html, text, image etc). Such a tab can be configured with just one line of xml, which describes title of the tab and content location in the artifacts directory of the corresponding build.
So it was implemented; we've migrated our EMMA coverage support to this approach, and released a EAP with this feature.

You may see how this feature works for Etienne Studer
Try it yourself in our latest EAP - I hope you'll like it :)

Another exciting feature of TeamCity, which is already available in the EAP - Eclipse plugin with personal builds, own changes view and build status information.

And if you want more features, or have any suggestions about the implemented ones - we'll be glad to get your feedback in our EAP.


Technorati:

Jan 31, 2007

Agra: popups everywhere

Just a couple of screenshots from the latest EAP of TeamCity.
Quick access to artifacts:


Quick access to the list of failed tests:




Jan 26, 2007

Humanized and Enzo

I've read about that tool at 37 Signals and watched the short demo. I should say it looks brilliant. Quite obvious for Mac users but it is first time I see such a good implementation on Windows.

In fact, they put to life "Command" button inspired by Jeff Raskin in his The Humane Interface book. The implementation is simple, and very impressive - they just use "Caps Lock" key as such "Command" button.

And looks like Aza Raskin (who is one of the owners of Humanized) is a good son of his father.

Well, I'd like to see Linux port of this tool. Anyone?