• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unit Testing and Continuous Integration

#1
Hi,

I want to add Unit testing to my CI projects.
I have seen there is ci-phpunit-test from kenjis.

It seems nice however I came across TOAST and I quite like the 5 criteria that led to its creation:
  1.    It must be lightweight a completely unobtrusive - I don't want a lot of bloat or a ton of files littering my CI installation
  2.    It must integrate perfectly with CI - ie. no hacking the core, no intricate workarounds to make it work inside CI Controller classes, and no duplicate index.php files
  3.    It must use simple JUnit-like syntax (meaning it must support a range of assert_*() functions)
  4.    It must work entirely in the browser - I don't always have shell access to my servers, and you might not either
  5.    It must offer a simple way to run both individual tests, groups of tests, and all tests at once

I am not sure that ci-phpunit-test matches number 4.

What are your thoughts about Unit Testing ? What tools do you use ?

Going forward I want to perform continuous integration: any experiences on that ? I am thinking of using Jenkins.


Cheers,
L.
Reply

#2
I'm probably a little biased on this, having worked on CodeIgniter Testing Guide with Kenji. I think the whole premise of #4 is problematic, because you shouldn't be running tests in your production environment (except perhaps before it goes live), and it usually isn't difficult to have access to the CLI at least in your development environment.

Anyway, while I haven't attempted it, it should be possible to implement a browser interface to run tests through PHPUnit/ci-phpunit-test installed.
Reply

#3
Hi,

If you really value #1, ci-phpunit-test does not fit you.
Because ci-phpunit-test includes thrid-party libraries, now it has 294 php files in the Zip archive.
And more, you need to install PHPUnit.

About #4, you can run ci-phpunit-test/phpunit via your browser if you use VisualPHPUnit.
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.