Hi
I'm starting to write tclwebtest acceptance tests for my first package! I ran across this post about up and coming tclwebtests with oacs. I grabbed a beta copy from cvs and it looks like these test are mostly intended for automating installation of OACS (how cool). But there are lots of really useful procs defined there for general OACS testing with tclwebtest.
So long story, somewhat shorter, I am trying to use this testing framework to implement some basic acceptance tests for my new package. I can outline how I started doing this (below) and what I'm hoping for is some sort of guidance/feedback on my (mis)use versus the way this neat new test harness is intended to be used. Keep in mind this my first use of tclwebtest too so any tips are welcome really;)
The testing stuff is located in /etc/install under OACS root.
Looks like my *.test files should be created here to take advantage of the extensive test procs that have been written for use with tclwebtest + oacs.
Do I have to copy /usr/local/src/tclwebtest-0.3/tclwebtest and /usr/local/src/tclwebtest-0.3/lib to openacs-4/etc/install to use this?!
Otherwise tclwebtest can't find either its own lib (unless run from its source dir) or the openacs-4/etc/install/tcl files (uses path relative to dir tclwebtest is exec'd from) to source them:(
Next problem I encounter is, if I pass my nsd config to tclwebtest (using -config_file as I see done in other places here), well then I get errors about ns_log in my nsd.config (not being defined of course). There is an ns_log in the sample config provided with the testing stuff so I am missing something here... are these tests supposed to be run from within aolserver? It'd be much nicer for me if not!
Yet if I don't pass -config_file to tclwebtest, I will get this sort of error for various variables defined in nsd config:
can't read "serverroot": no such variable
I can make a stripped down copy of server nsd conf file containing only the variables I think are needed by the test procs (from openacs-4/etc/install/tcl/config-procs.tcl global vars;).
I ended up needing at least this to run a basic test (just to source openacs-4/etc/install/tcl/config-procs.tcl mostly):
#---------------------------------------------------------------------
# change to 80 and 443 for production use
set httpport 8000
set httpsport 8443
# The hostname and address should be set to actual values.
set hostname myserver.mydomain.com
set address 127.0.0.1
set server "openacs-dev"
set servername "New OpenACS Installation - Development"
set serverroot "/www/nsroot/${server}"
set server_url "http://myserver.mydomain.com:8000"
set admin_last_name "admin_last_name"
set admin_email "admin_email"
set admin_password "admin_password"
set alert_keyword "alert_keyword"
#---------------------------------------------------------------------
So anyway, I know this stuff is hot off the press, but can I get some direction from the pros in the trenches please?
What is the manner in which tests are recommended to be developed for new packages? Where do things go? I'll be happy to document my experiences getting up and running...
TIA:)