2014: it’s time for a change

Keep calm and fly to Thailand

I wrote the first post on this blog in 2009. I have to admit that I haven’t been that good at keeping it up to date. But I feel that 2014 is a good number to start with a couple of changes.

The first one I’m going to do is writing more often about my work and my experiences.

The second change is my travel to Thailand. Yes, Thailand. I’m going to be there for nearly three months, working remotely for Ideato.

Roberta, a laptop and a camera will be my partners on this journey.

I’ll get back to you soon.

Slow test suite, ramdisk and Mac OSX

As I’m working with Symfony2, in some projects I found useful a boost in perfomance while runnig tests.

One of the way of speeding up your tests is to put the symfony cache and logs directories into a ram disk. Even better would be to put in there also the database (if you’re using SQLite). To create a ramdisk on OSX, we use a script written by  Francesco Tassi.

The only thing left is to congifure yout Symfony2 project:

    # app/config/config_test.yml or parameter_test.ini
    kernel.cache_dir = /Volumes/ramdisk/symfony/cache
    kernel.logs_dir = /Volumes/ramdisk/symfony/logs

and you’re good to go!

Another way of improving your test suite is described into the LiipFunctionaTestBundle documentation (if you’re using their bundle 😉 ). This bundle gives you the ability of sharing a cached SQLite database between tests that are using the same set of fixtures.

And last but not least, a Kris Wallsmith’s blog post where he describes how to avoid creating a new kernel for each new “client” in your functional test. This solution seems to work pretty well but the only thing I couldn’t find a way to do was to test emails  through the profiler.

Happy testing! 😉


Mac OSX 10.8.6: maxfiles settings

Hi there!

In the last few days I’ve been working on a new project. Testing the application I’ve come across the “Too many open files” error.

My OSX 10.8.6 has the maxfiles limit set to 256. That’s ok for daily activities but it is not when working on big projects.

Googling the error I’ve found a lot of people speaking about it and giving their right solution. It is always the same:

  1. create or edit the file “/etc/launchd.conf”
  2. write in it the following: limit maxfiles 20000 50000
  3. save and reboot

This configuration is ok, but it wasn’t working on my machine. The one more thing I needed to do was setting the right permission to the file 🙂

So, to sum up:

  1. create or edit the file “/etc/launchd.conf”
  2. write in it the following: limit maxfiles 20000 50000
  3. save and reboot
  4. run the command: sudo chmod 775 /etc/launchd.conf

Hope it helps!