Autotesting PHP applications (and others) 3

Posted by caike on January 12, 2010

So you’ve probably heard of ZenTest/Autotest, right?

In case you haven’t, it is a Ruby gem that (among other things) automatically runs your tests whenever it notices that a file in you project has changed. It’s a great productivity boost, because it saves you from having to run your tests each time you make a change to your program. The perfect tool if you are doing TDD.

So I wanted to get this autotest functionality going for projects in other languages - like PHP, for example - but apparently ZenTest/Autotest only works within Ruby projects.

Talking to the EnvyLabs’ guys I was told about Watchr, a Ruby gem that monitors files matched by a regular expression and triggers a user defined command whenever a file changes. That’s enough to get you started in an autotest-like tool for PHP - or just about any other language.

I’ve setup an example PHP project of Watchr playing an autotest role in a PHP project:


View on Vimeo.

The source code from this example can be seen at http://github.com/caike/watchr_running_php

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

  1. Alex Tue, 12 Jan 2010 20:50:14 PST

    Fala, Caike! Bem legal essa ferramenta, pode ser útil até no Coding Dojo (até como inspiração para a DojoTools, que está começando a caminhar).

    P.S.: Que música é essa de fundo? Parece um pouco Deftones…

  2. caike Wed, 13 Jan 2010 00:22:46 PST

    Fala, Alex!
    A idéia é usá-la em Coding Dojos mesmo.
    Um projeto de maior porte provavelmente precise de algumas funcionalidades a mais, como rodar apenas o método de teste que falhou e etc.
    Eu vi que o Flávio implementou uns métodos pra monitorar arquivos no DojoTools.
    Será que não há algo parecido com o Watchr em Python ?
    A música é Knife Party do Deftones

  3. Alex Tercete Fri, 15 Jan 2010 01:47:38 PST

    > Será que não há algo parecido com o Watchr em Python ?

    Cheguei a procurar algo parecido pra Python, mas não encontrei. De qualquer forma, é uma “simples” questão de traduzir o que está em Ruby para Python! :P

    > A música é Knife Party do Deftones

    Sabia que soava muito familiar! :)

Comments

Anti-Spam Protection by WP-SpamFree