- Selenium Grid
- CruiseControl with phpUnderControl
- ant for build tasks
- Several VM's running various browsers and Selenium RC
- PHPUnit v 3.3.15 (more one this)
- PHP 5.2.10
- symfony framework v 1.2
- Doctrine 1.1
Symfony comes with the lime testing framework, and I use this as a way to "unit test" my controllers/actions. Most of my applications however have a high degree of Javascript built into them, making calls, updating the DOM, and I need to test this in as many browsers as possible.
Problems I ran into:
- New versions of PHPUnit (3.4) have removed the capability to log the test runs to a database without replacing these features in other products (phpc, phpuc etc)
- If the code running the unit test doesn't log this information anymore how would you get accurate code coverage results without running the tests again.
- Complex XML logs are bulky and eat up disk space, and need to be rotated and managed. Not to mention, they are not human readable, so need to be parsed and exported into reports.
- Selenium Grid would hang occasionally if the browser gets in a bad state.
- Other php unit testing frameworks do not integrate nicely with Selenium
- No way to easily store historic logs or screenshots in a logical manner.
- Just no "central" one tool to run, log, and view all the testing data.
I needed a solution that I could setup quickly to replace my existing setup, without all the hassle that CruiseControl has (java server that is a memory hog). So, I decided to use the same tools that I use for development, and create a frontend to the PHPUnit database schema in 3.3.15. This is easily accomplished with Doctrine and Symfony.
I ran the provided schema from phpunit in SQLite 3, placed the database in the /data directory, setup my database.yml file and ran the build-schema build-model command. I now had classes that mapped to the PHPUnit schema for logging.
I also setup a symfony task to execute phpunit using the sfPhpunit Plugin as well. Word of caution: this pulgin needs to be worked on to work correctly, and needs some extra work to accept several parameters. Mainly, I needed the test database parameters, the xml configuration file to use, and the bootstrap arguments. This was all easily added to the task, and the output is captured into the database.
From there, I created all the admin modules, as well as a few frontend modules to view the test runs in reports that made sense.
No comments:
Post a Comment