Re: [tclwebtest] Passing variable parameters to test scripts
Status: Abandoned
Brought to you by:
tils
From: Tilmann S. <ti...@ti...> - 2003-01-22 06:23:57
|
* Grzegorz Adam Hankiewicz <gr...@ef...> [20030121 14:54]: > On Mon, Jan 20, 2003 at 06:44:00PM +0000, Tilmann Singer wrote: > > > I saw the TESTHOME variable, but looks like that is set by tclwebtest > > > internally, I thought initially it could be an environment variable. > > > I can overcome this limitation wrapping the script around another > > > temporary script which sets the variables, but maybe there is an > > > easier way? > > > > How do these two things relate? And what do you want to achieve? > > Basically, we are going to have scripts which run locally or remotely > depending on a switch, and the easiest way to do it would be to > set a variable with the base url of the test. I don't want this > hardcoded into the scripts themselves, because then we would have > two versions of the same script with one different line. > > > Look at the openacs tests for an example. I think it would break > > when you have your tests in several subdirectories, but I'm > > not sure. > > Well, all scripts are going to be stored in a database, so I'm > going to run them iteratively, putting them out in some /tmp file > and running tclwebtest over them. Since I'll be doing this, I could > as well modify them to include the fist line "set SERVER_URL xxx". What I meant would be interesting from the openacs scripts was the fact that they are sourcing a common settings file, where you would set your SERVER_URL variable, so that it's only stored in one place. Still you could as well use an environment variable, why not? They should be available in the env array within the test. By the way, did you try to source tclwebtest into aolserver (not very efficient, I know) like in the example I sent you and run the tests you retrieve from the db with the run_test command? It might not be necessary to put them in a /tmp/ file and run them from there. Looking at run_test it occurs to me that Peter Marklund contributed a nice -config_file switch, to solve the settings problem more elegantly. Maybe this can be used in your project? It just passes a filename to run_test where the file is read, but maybe it should be changed so that the file is read before the invocation of run_test and the contents should be passed instead, then run_test could be run more flexibly. What do you think? > PD: Weren't you meant to answer through the ML? Yes, sorry. I'll send this reply over the list now. til |