Úterý VII 22, 2008

Hudson as a tool for testing? Yes!

Lots of folks in NetBeans started to use Hudson as a tool for continuous integration, or just for building NetBeans from various clones, or to build test, whatever you can imagine. Just take a look at Deadlock machine and you will see a plenty of NetBeans related jobs. We (NetBeans QE) recently got an idea to utilize Hudson as our testing infrastructure. Yes, NetBeans have a lot of automated tests that are being ran daily and test results are evaluated for potential problems. So you have tests, you have machines, but you still need an infrastructure to connect this together. We chose Hudson, because it's a great tool, and what's really cool - is extensible by various plugins (available on Hudson's web, or you can write your own if you wish). The basic idea was to use Hudson as "master-slave" architecture, where you simply set up on master what do you want to run, and master distributes the work to the slaves, that execute the jobs. More detailed approach to this - configure on master which tests do you want to run on which platforms, and they will get executed on appropriate slaves. And getting one level lower - to achieve this, you have to have something we called generic Ant script, which will provide all the stuff needed to execute test:
  1. Download IDE - the IDE build which will be tested
  2. Download NetBeans Test Distribution - Test Distribution contains binaries of all tests from NetBeans repo.
  3. Run selected tests - Specify which tests from Test Distribution will run in tested IDE
So i wrote and Ant script with plenty of useful targets to provide this functionality (Yeah, by this I learned a lot how to write Ant scrips:-) ). This Ant script is generic, and all the stuff like where to take IDE build, where to take Test Distribution, which tests run, what to do with results etc. are controlled by passing corresponding properties. Once we have this working, the only thing we have to do, is to distribute the Ant script to machine we want to run tests on, and provide some better UI than command line for the main properties, which control the test execution. Therefore me and Max Sauer extended Hudson by Test Run Plugin (sources are not public right now), that enables Hudson to copy our generic Ant script on target slave machines and extends job configuration with our panel for setting properties for testrun. With all this stuff working, people can simply log in on master, select one or more slave machines on which will tests run, configure which build will be tested by which test (through nice GUI :-) ), run the job and take a nap while watching the progress of tests execution on target machines. When test run is finished, you get a nice overview of test results (yes, built-in feature of Hudson).
The main benefits we take from Hudson (aka features we really like):
  • Master-slave architecture - you can have various machine with various architectures/OS added into testing farm.
  • JUnit results processing - nice HTML, results trends, charts,...
  • Scheduler - triggering of testrun by another job (which can listen e.g. if new production build is available), or "cron-like" settings.
  • Email notification - send email if tests do not pass.
  • SCP plugin - we can send test results to remote machine that can parse them and store into DB.
  • Authentication - simply configure and point Hudson to your LDAP server, really out of box functionality.
  • Multiple JDK installations - specify location where are JDKs located and voila - you can run whole matrix of tests - one axis is JDKs, second is platform.
  • ...many many others:-)
And conclusion? Hudson is not only contentious integration tool, it can be almost whatever you like.

Pondělí IV 21, 2008

On soccer match on Sunday: Bohemians 1905 vs. 1.FC Brno

Every second Sunday you can meet around Vrsovice (Prague district) people in green and white scarfs. They are heading towards "Dolicek" - stadium of footbal club Bohemians 1905, familiary called "Bohemka", with kangaroo in sign. Bohemka is actually playing first league (almost miracle, in 2005 club ran out totally out of money, but fans organized fund-rising campaign in order to save their beloved club), so we could enjoy superb football atmosphere, created by the best fans in Czech league (average attendeance in times Bohemians played third division exceeded average attandance of almost all clubs playing first league!). Active football full of combinantions, beer, sausage from grill, chat with friends, nice weather and four nice goals...that's why I like to go to Dolicek! Bohemians won 3:1, and so the evening was full of green and white joy... And how does atmosphere in Dolicek look like?

Pondělí III 31, 2008

Ruby conference in Prague

This weekend took a place in Prague Europian Ruby Conference (Euruko2008). I've been invited there by Roman Strobl as someone who's interested in Ruby (actually i did QA on initial phases of Ruby support in NetBeans 6.0, later on Ruby debugger). I can say i like Ruby not only because of Rails framework, but beause of powerful and nice language constructs - I have to confess that I have a lot of things to learn to be able to call myself "Ruby programmer"
Even if the invitation came on Thursday (and you know, you already got some plans for a weekend...), I managed some time to attend at least three presentations. My notices and impressions:
  1. Keynote was presented by Yukihiro Matsumoto (AKA "Matz"). Matz is a chief designer of Ruby language, and spoke about Ruby concepts in past, present and future. Maybe it's a bit pitty that his presentation was a keynote, I'd really appriciate to hear from him more detailed vision of what Ruby 2.0 will be like.
  2. Next speaker was Koichi Sasada, author of YARV, virtual machine for interpreting Ruby code. He focuses mainly on performace, in his presentation outlined techniques of paralelization (and synchronization) in his VM, and showed some benchmarks. Very interesting - at least for me - since I'm interested in such a "low level" stuff.
  3. Last presentation was JRuby, by JRuby guys Charles Nutter and Thomas Enbo. They clarified that Java!=Java programming language, and were talking about (and also showing in "eye candy" style) how fast can Ruby run in JVM. Great lesson for everyone who is scared of slowness when there's "J" in front of some name - definitly not true here
As usual - some pictures:

Charles Nutter is fine-tuning JRuby presentation.

Matz enjoyed his presentation, so did the audience.

Koichi showing a slide that proves that 1:1 threading model is the best..we have to believe him

Thomas and Charles are presenting JRuby.

P.S.: Can anyone point me to slides from this conference (if there's any global storage)?

Úterý III 25, 2008

VirtualBox - virtuality out of the box

Some time ago nearly everyone was blogging about this event - Sun Microsystems acquiring Innotek. So this entry are my (possibly redundant) two cents. I have to admit I've always been sceptical to running non-native applications on some OS. And even whole operating system! (My scepticism come from ancient times when i was trying to run some very simple Windows-based application under Wine emulator- after few clicks I always ended with "segmentation fault"). VirtualBox was my second experience on this field, and I have to say a very nice surprise! Reasons?
  1. Out of box installation - either download ~17MB binary, or (on Linux) install by package manager. Easy.
  2. Nice and intuitive GUI - Created virtual machine with a little help of simple wizards. No need for any special setup.
  3. Performance - Cannot compare with competitors, but subjectively was very good.
  4. Irrational - I just fell in love with this piece of software.

Beause of reasons above - VirtualBox has settled permanently on my laptop. I hope I'll spare some time for studying possible tweaks to make first great experience even greater!

Pátek III 21, 2008

Goodbye studies, hello real life:-)

I had a graduation ceremony on Wednesday, a "last goodbye" to my alma mater Czech technical university (CVUT). I got a brand new shiny diploma that allows me to use academic title "inzenyr" (engineer). Ceremony took a place in Betlemska kaple, an ancient chapel tied to Czech history. Rector of our university stared his allocution: "In 18th century..." so it seemed that his speech will last at least two days Atmosphere of ceremony was superb, cameras were flashing, grandparents had tears in their eyes, parents were proud of their children,...

A picture is worth a thousand words: Mace-bearer with CVUT insignia, in the background vice-rector of CVUT.

Sobota III 15, 2008

Milovice - city of ghosts

Some time ago me and my friend took a trip into Milovice. On first sight it seems like perfectly normal small town, kids going to school, women chick chatting at the marketplace, men drinking beer in pub... The adventure begins in a nearby district called "Milovice Mlada". What's so special about it?
In august 1968 was Czechoslovakia occupied by Soviet union plus it's political satellites in order to stop liberalization and reformation of socialism AKA Prague Spring. And Milovice were chosen to serve as a military and social basement for Soviet soldiers. In Milovice took a place HQ for Central Group of Forces. In the same location as a military base were built blocks of flats for families of soldiers. But not only blocks of flats, but also mall, cinema, hospital, cafeteria,...so Milovice Mlada was self-sufficent district with it's own life. After Velvet revolution in 1989 and breakdown of whole soviet block was time for soviet forces to go back home. Most of them left Czechoslovakia till the end of 1991. Milovice district was abandoned and started to fell into the ruins. When you are walking through the areal, it feels like walking through city of ghosts. Sometimes you can meet guys playing paintball in the ruins. Everyhere is a lot of trash, even old soviet newspaper can be found. Some blocks of flats have undergone through complete reconstruction and serve as affordable living especially for young families. The rest is still sadly waiting for its destiny...

Here are some pictures I took there: (full photoset in my webalbum)

Block of flats. This used to be a (temporary) home for families of soviet soldiers.

Entering military base. Sign says "guard gatekeeper".

No windows, no door, trash everywhere.

Time to do some shopping in the local mall.

And the cinema. What's on today?

Inside of the cinema.

Seems like seats are gone forever.

Kindergarten. Where do the children play?

Pátek III 14, 2008

Project with sharable libraries (AKA How to avoid broken references)

Till now:

If you tried to share with someone your NetBeans project, where you depend on some libraries that you've defined in IDE, you probably received complains: "Your project does not work for me, I've got there broken references, everything's red underlined,.....and...I don't have time to do some tweaking, resolving...ummmm....maybe I'm not so interested in your project..:-)" Well, that's because your friend's IDE was missing definitions of libraries, that your project needs to work.

Since now:

If you share your NetBeans project (e.g. using VCS), your friend just simply checks out your project and libraries with their definitions. Project is then ready to use out of the box.

Example of typical workflow:

  1. Create you project under some versioned folder. When creating project, don't forget to check Project Shared With Other Users checkbox. Do not change location for sharable libraries, it's good to have them on the same level as project folder(s).
  2. Add dependencies on libraries that your project needs. Notice that when you invoke Add library on your project, you are operating with shared libraries (i.e. libraries stored in location you defined), not global libraries. Good practice is that when you are adding new library into shared location, choose that you want to copy library JAR(s) into shared location. It ensures that definitions and JARs are physically at the same location.
  3. Once you do some coding, it's time to check in your sources into VCS. Notice that also newly added libraries are offered for commit.
  4. That's it! If someone checks out your project (as well as libraries folder as location for shared libraries), project is ready to use out of the box.

TIP: If you have some projects created by NetBeans 6.0 and you want to make them sharable, there's a wizard which can make project to use sharable libraries. Just go to project properties, and on Libraries panel you'll see Make sharable... button. This button triggers a wizard, which switches your project into sharable concept and imports necessary libraries to your shared location.

For those who are interested here is some documentation of this great new feature. Feel free to try it out in NetBeans 6.1 Beta.


Tomas Musil


« srpen 2016