Forum OpenACS Development: Database replay feature ??

Collapse
Posted by Alfred Werner on
I'm interested in hearing thoughts on adding a database replay feature.

Meaning -

Site-wide configuration options - db_record_p  and db_record_log_file.

db_dml
db_exec

db_exec_plsql
db_exec_plsql
db_write_blob
db_write_lob

These procs (and any I didn't think of) - have them look at the db_record_p to see if they should log their efforts to $db_record_log_file.

Example -

db_record_p is off by default. I install OACS - set db_record_p, configure how I want it, run through and manually add a bunch of stuff.  New OACS comes out, I want to regression test it - I just run a replay log into the new instance.

This might be useful for the demo sites at collaboraid ...

Collapse
Posted by John Sequeira on
The trick with simply replaying a db-api log for regression testing is that you don't necessarily end up with the same primary keys if you rebuild an openacs instance from scratch.  Once these get out of sync,  your log is only useful if you backup/restore the initial db (and then you're not regression testing the installer script).

I suspect that capturing the web server log and replaying that through tclwebtest or portable.nsd might be a better idea.

I've had good luck with the latter... it's robust to user interface changes and it lets you test at a more granular command vs page level.    YMMV.

Try a google search on "Unit Testing Database code" for more info on the issues involved.