Development: Automated Testing
Written 04 Aug 2005
Below is a copy-n-paste of a message to the mailing list:
On 8/3/05, xushi wrote: > well my back is seriously killing me , so ill catch an early night > tonight. Anything you guys want me to look at before i leave? > > few notes for today.. BBLOGROOT is fixed, BBLOGURL still needs a bit of > work. Installer works though. And i merged your fopen(config.php 'wb') > fix to it for testing. Great! I am looking forward to that. I'll run a couple install tests tonight, both on Linux and Windows. Included with this message is the first release of the Automated Testing Framework - *nix Don't be surprised if there are still bugs lurking in it ;) This framework currently: 1] Creates a series of test folders to house bBlog test installations 2] Unpacks a tar-balled bBlog into a test folder and applies proper permisisons (not according to revision 40) 3] Creates a database, user and password and grants this user access to the database 4] Creates an uninstall file in the bBlog folder. This will remove the database, user and privileges along with deleting the current test folder (current == The one you execute the uninstall script from) 5] Automates the install of bBlog (the part normally done through the browser) using SimpleTest, a PHP Unit testing framework. This portion simulates a web browser, so we aren't just sticking data in the database and calling bBlog installed. It actually 'walks' through the bBlog installer, populating form fields and clicking buttons. 6] Gives a little report at the end tell what failed. Future versions will include: 1) Bug fixes! Yeah baby! 2) Ability to export bBlog from the Berlios repo 3) Perform more specific tests than "Yep, the installer works" Here is a glimpse of a sample run: [web_dev.fortwayne.ardencompanies.com - kpower - ~/public_html/tests/08032005/12/tests/ ] $ ./blogTests.sh -f ~/bBlog-berlios.tar.gz -m root -u blogsvn -p test123 Creating test folders... Creating current test directory...40 Unpacking bBlog... Creating database... Granting permissions to database user... Enter password: Setup complete. DB: 0803200540 DB User: blogsvn DB Password: test123 Performing a simple test run that does a basic install of bBlog... PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/20020429/pgsql.so' - /usr/lib/php4/20020429/pgsql.so: cannot open shared object file: No such file or directory in Unknown on line 0 bBlog-current OK Test cases run: 1/1, Passes: 12, Failures: 0, Exceptions: 0 (Ignore the PHP Warning. I have something goofy with the PHP setup on this server) The initial command, blogTest.sh, accepts the following arguments: -d Username for logging into Berlios SVN [Not currently used] -f Specify bBlog tarbal, must be full path --mysql-user | -m Mysql user that has super-user privileges for creating DBs and users -p Password for the bBlog user created in this process -u Username for the bBlog user -version Display version number of this script Of all the parameters, -f is mandatory, although I don't have the script die if you don't specifiy it. There are two config options you need to alter in blogTests.sh BASEDIR = fully qualified path to an existing folder that serves as the root of the entire testing heirarchy TEST_URI = How to get to the above path via your browser Any questions, comments or problems feel free to ask. Complaints will be directed elsewhere. Kenneth
Updated:
The message I sent was holding for moderator approval, for being too large :)
Tonight I had some time, so did a little tweaking. Now the setup file downloads from Berlios either anonymously or as a developer. The -d developername argument determines this. The version I uploaded to the mailing list was 0.0.1. Current is 0.0.1
Download autoinstaller-0.0.2.zip