unable to get Hudson to run unit tests

j vickroy jim.vickroy at noaa.gov
Tue May 11 11:42:55 EDT 2010


Stefan Behnel wrote:
> j vickroy, 11.05.2010 16:46:
>  > Stefan Behnel wrote:
>>> No, what Hudson actually does, is, it writes your command(s) into a
>>> text file and runs it with the system's shell interpreter (which,
>>> unless otherwise configured, is "cmd.exe" on Windows).
>>
>> This is not the behavior I am experiencing on my Windows XP Pro (Service
>> Pack 3) workstation.
> 
> Then setting the "Shell executable" to "cmd.exe" will do the right thing 
> here.
> 
> 
>>> This assures the highest
>>> possible compatibility with the executed script. You can even use the
>>> shebang in Hudson's scripts that way, so that you can execute scripts
>>> in basically any scripting language.
> 
> ... although the shebang isn't really supported by cmd.exe, I guess ...
> 
> 
>>> The likely reason why it doesn't find your test results is that you
>>> didn't tell it where to look.
>>
>> Actually, Hudson is not finding the tests results because they are not
>> being generated. There is no "nosetests.xml" file anywhere on my hard
>> drive
> 
> That's why I told you to configure nosetest to use an specific output 
> path for the unit test file.
> 
> 
>> Thanks again for your continued interest. I quickly got Hudson to
>> retrieve job source from our subversion repository so I thought it would
>> be equally easy to get Hudson to run the unit tests, but that has proven
>> to be difficult, and so far I do not know how to diagnose this since it
>> seems there is no way to prevent Hudson from immediately deleting the
>> temporary scripts it generates.
> 
> Which is ok, since it prints what it does during the script execution, 
> and the scripts contain nothing more than what you typed in.
> 
> Does nosetest produce an XML file when you call it manually from the 
> command line? Is nosetest.exe in your PATH, so that the cmd.exe that 
> Hudson starts can find it?
> 
> Personally, I'd always step into the target directory before running a 
> command, so I'd make the script
> 
>     cd level-1
>     nosetest.exe ...
> 
> Stefan
> 

Here are the Hudson job | Configure | Execute shell | Command inputs:

------------------------------------------------------------------
cd level-1
dir
nosetests.exe --with-xunit --xunit-file=nosetests.xml --verbose
------------------------------------------------------------------
#!python.exe
####print 'FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO'
import os ; print 'os.getcwd():',os.getcwd(); print 
'os.listdir(os.getcwd()):',os.listdir(os.getcwd())
------------------------------------------------------------------


and here is the Hudson Console Output:

--------------------------------------------------------------------------------------
Started by user anonymous
Updating svn://vm-svn/GOES data processing/trunk/GOES/13,14,15/SXI/level-1
At revision 3417
no change for svn://vm-svn/GOES data 
processing/trunk/GOES/13,14,15/SXI/level-1 since the previous build
[workspace] $ C:\WINDOWS\system32\cmd.exe -xe 
C:\DOCUME~1\JIM~1.VIC\LOCALS~1\Temp\hudson2208088016039194869.sh
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\jim.vickroy\.hudson\jobs\GOES 13-15 SXI 
Level-1 Products Generation\workspace>[workspace] $ python.exe 
C:\DOCUME~1\JIM~1.VIC\LOCALS~1\Temp\hudson6398132145818001258.sh
os.getcwd(): C:\Documents and Settings\jim.vickroy\.hudson\jobs\GOES 
13-15 SXI Level-1 Products Generation\workspace
os.listdir(os.getcwd()): ['level-1']
Recording test results
No test report files were found. Configuration error?
Finished: FAILURE
--------------------------------------------------------------------------------------


There is no nosetests.xml file anywhere on my hard drive (except as 
previously noted in the Recycle Bin).

 From the above Console Output, I see no evidence that the nosetests.exe 
command was ever executed.



More information about the Python-list mailing list