News
finding the culprit with bisect automagically

I guess most of you know how to use rspec. And some might have used the power of git bisect. But how can you make them play nicely together?

(In the following example, I am assuming that you use rake, rspec 1.x and bundler, could be a rails project, could be anything)

Well, the easy way is to just run all the spec via the bisect command. Start with

% git bisect start <bad-revision> <good-revision>

and then use

% git bisect run rake spec

until it shows you the bad commit. Use the power of git diff(tool) to compare the last good and the first bad commit, and you'll find the problem in short order.

But what if your test suite is huge, or the startup time for rake spec is not worth it? Well, then you can combine two really interesting flags for rspec: --format e and -e FILE. Example:

Before I prepare bisecting with bisect start ... as above, I am running the specs with the 'failing' formatter via

% spec <directory_or_files_to_run> -f e 2>/dev/null 1>/tmp/failing.txt

which will run the specified files and output the failing specification's descriptions to the file /tmp/failing.txt'. In the next step, I use

% git bisect run spec -e /tmp/failing.txt

thus letting git do the hard work of running the failing specs over and over until the culprit is found. This should be way faster than running the whole test suite altogether, but you also might miss some other failing specs, so beware! Running all specs again will be necessary, and then you might have to start all over again.

Oh, and for those that are missing an example for rspec-2: I'm working on it. It's a bit more involved, because the formatter has to be customized, and the input has to come from the shell (unless I am willing to patch rspec-core), but I am confident that I can get that done in time, too.

Hope that helped some of you, and stay tuned for the rspec-2 method of getting the same stuff done!

by Anton Bangratz at Tue Sep 27 09:44:26 +0200 2011
rails, ruby, datamapper, ...

Well, that was an interesting Saturday afternoon. As usual, I upgraded some small stuff, did a little programming on a private project, and then decided to check the versions ...

(The project is using Rails 3.0, Datamapper, Devise and some more things)

And whoo! Datamapper has been upgraded!

So, first things first, I went into my Gemfile and updated the version. Typing bundle install would then give me ...

Errors. Yay.

First, incompatibility in gems. I had to update dm-devise too - and dm-rails (obviously), which lead to upgrading rails to 3.0.5 ...

As soon as I had fixed that, I got more weird errors:

"invalid value for @cert_chain"

Argh! Well, some googling and browsing stackoverflow lead me to the following conclusions:

  1. I need to upgrade rubygems
  2. Following that, I need to downgrade rubygems again, or
  3. I need to upgrade my ruby version.

Going for the full monty, I virtually stripped down my system, dropping gemsets left and right, reinstalling ruby(1.9.2-head) via rvm and then upgrating rubygems (via gem update --system, which seems to work again).

After dropping the vendor/ruby directory, I reinstalled the bundle (bundle install --path vendor/ --rubygems, and everything works again!

... well, almost, now I have to remove the deprecated stuff that Devise introduced ...

... the interesting saturday continues.

by Anton Bangratz at Sat Apr 02 17:59:48 +0200 2011
... with RVM

Long story short:

rvm get head
rvm reload
rvm list known
rvm install 1.8.7
rvm install rbx

WORKS!

by Anton Bangratz at Fri Apr 01 00:02:42 +0200 2011
Working: 90%

Installing

Prerequisites

To install any type of Debian on your newly unwrapped HP 620, you have to have the following:

  1. The Debian Installer (d-i) CD (I do use netinstall usually)
  2. Any kind of boot cd that can boot your system again (e.g. Xubuntu installer)
  3. A lot of patience

Preparing the system

First: my system came preloaded with Windows 7. I started the installation process, because I wanted to install Linux in parallel. After futile attempts to resize the partition, create a new one and install Debian squeeze and Xubuntu (one after another), which worked from an install point of view but never managed to boot the system, I gave up and deleted all partitions.

In the BIOS I removed the option to 'protect the disk' and set the controller to IDE (just to be sure).

After that it was pretty straightforward. I installed Debian (minimum, because that's how I roll) and rebooted, just to be greeted by "No System Disk or Disk Error". How inconvenient. But strangely enough, starting the system with the 'boot first disk' option from the Xubuntu worked - and after the first system update, the system was bootable.

The only thing that was left was to activate the wlan device. I installed Xfce and the works, removed network-manager and installed wicd, then downloaded the driver for RTL8192SE from RTL and installed it according to the included readme.

Then I tried to get those pesky extra keys (volume, mute) to work, installed keytouch and the keytouch-editor (via aptitude), but then it segfaulted all the time when trying to create a new configuration. Well, I will leave that for another time.

Out of the important points, the HP 620 works for me. The installation is a bit rough, not all keys work (yet), but after all, everything seems to work now. Now that I know about the pitfalls, I would definitely recommend it so far for running Debian.

by Anton Bangratz at Wed Jul 07 19:59:11 +0200 2010
Und täglich grüsst das Fahrrad.

Hi all,

lately I'm running daily updates of this site, but only in the (german) Bike Section; check it out here.

That's all!

t.

by Anton Bangratz at Tue Sep 23 20:55:04 +0200 2008

1 2 3

Creative Commons License Get Firefox Valid XHTML 1.0 Transitional