My favorites | Sign in
Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 230: --argumentfile option should be accepted multiple times
2 people starred this issue and may be notified of changes. Back to list
Status:  Done
Owner:  pekka.klarck
Closed:  Feb 2009
Type-Defect
Priority-Medium
Target-2.1


Sign in to add a comment
 
Reported by c.martin.taylor, Feb 12, 2009
I have a RunTest.bat file that looks something like this (a simplification
for the purposes of this report, but essentially the same as what I really
have):

pybot ^
 --name My_Test_Name ^
 --variable Var1:Value1 ^
 --argumentfile ArgFile1.txt ^ 
 --argumentfile ArgFile2.txt ^ 
 ../../TestsToRun.html

ArgFile1.txt has
--variable Var2:Value2

and ArgFile2.txt has
--variable Var3:Value3

Some of the resource file paths imported by ../../TestsToRun.html depend on
${Var1}, ${Var2}, ${Var3}.

What I observe is that the resource files imported using references to
${Var1} and ${Var2} work OK but resource files imported using references to
${Var3} fail with a message that ${Var3} does not exist.
Comment 1 by pekka.klarck, Feb 16, 2009
This sounds really strange. I don't see how argument files would affect this, as they
are handled before actually passing arguments to RF. Your case should be 100%
equivalent to 

pybot ^
 --name My_Test_Name ^
 --variable Var1:Value1 ^
 --variable Var2:Value2 ^
 --variable Var3:Value3 ^
 ../../TestsToRun.html


Could you double check is there possibly something else wrong in your setup? You
could e.g. try running the same suite without argument files. If the problem isn't in
your setup, could you please create a minimal example suite and start-up script that
demonstrates the problem and attach them here as a zip package?
Comment 2 by ChrisPrinos, Feb 16, 2009
I think this is because robot can't process multiple argfiles (at least according to 
the command line help), so only the first one is read. It would be a good enhancement 
to allow multiple argument files though, as this comes in handy in a lot of 
situations.


Comment 3 by c.martin.taylor, Feb 16, 2009
The user guide says nothing about not handling multiple argument files and, when you 
use multiple files, pybot does not complain.  However it really does fail to process 
the 2nd file.  See the attached example.  If you run the PC tests with Issue_230
\Product_Name\RobotFrameworkTests\Test_Suite\RunTests\PC\Debug_PC_Product_V1_Tests.ba
t or Issue_230
\Product_Name\RobotFrameworkTests\Test_Suite\RunTests\PC\Debug_PC_Product_V2_Tests.ba
t then everything works fine.  In those .bat files the variables that I would set in 
the 2nd argument file are directly done on the pybot command line, like Peke's 
example above.  If you run the PC tests with Issue_230
\Product_Name\RobotFrameworkTests\Test_Suite\RunTests\PC\Debug_PC_Product_V1_Tests_2A
rgFiles.bat or Issue_230
\Product_Name\RobotFrameworkTests\Test_Suite\RunTests\PC\Debug_PC_Product_V2_Tests_2A
rgFiles.bat then the issue described above occurs and the tests fail.
Issue_230.zip
110 KB   Download
Comment 4 by ChrisPrinos, Feb 16, 2009
It's not in the user guide (should be), but if you do a "pybot -h" and look at the 
usage information, you'll see that arguments that can be specified more that once are 
listed with an asterisk (*), and that the --argumentfile option does not have an 
asterisk.
Comment 5 by pekka.klarck, Feb 16, 2009
Chris is correct in his analysis, --argumentfile is accepted only once as denoted
with that '*'. I really don't know why it is implemented like that (even though I'm
the one who has implemented it.....) and it ought to be relatively easy to change the
behavior. This also should be documented better, but if we are anyway going to change
it updating the documentation isn't worth the effort.
Summary: --argumentfile option should be accepted multiple times
Status: Accepted
Labels: Target-2.1
Comment 6 by pekka.klarck, Feb 23, 2009
Tests commited in r1338, changes to argument parser in r1339, and updated start-up
scripts in r1340.

If you want to get this feature into use, you can just copy the updated
argumentparser.py over existing 2.0.4 installation. You can get r1339 version of
argument parser directly from
http://robotframework.googlecode.com/svn-history/r1339/trunk/src/robot/utils/argumentparser.py

I'll still add a note to User Guide that starting from 2.1 --argumentfile can be
given multiple times but I'll close this already now. UG updates are likely to be in
r1341.
Status: Done
Comment 7 by pekka.klarck, Mar 20, 2009
(No comment was entered for this change.)
Owner: pekka.klarck
Sign in to add a comment

Hosted by Google Code