unable to get Hudson to run unit tests

j vickroy jim.vickroy at noaa.gov
Tue May 11 11:26:22 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.

OK, I will do this and report back.

> 
> 
>> 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.

Yes, and I am not seeing the nosetests.exe command listed anywhere in 
the Hudson console output.  This is why I do not think Hudson is 
executing it.

> 
> Does nosetest produce an XML file when you call it manually from the 
> command line? 

Yes it does.  The exact same command (specified for the Hudson job) 
works perfectly from a Windows console.

Is nosetest.exe in your PATH, so that the cmd.exe that
> Hudson starts can find it?

Yes, it is.  "C:\Python26\Scripts" is in PATH and that is where 
"nosetests.exe" is.
> 
> Personally, I'd always step into the target directory before running a 
> command, so I'd make the script
> 
>     cd level-1
>     nosetest.exe ...

OK, I will try this.

> 
> Stefan
> 



More information about the Python-list mailing list