From: j vickroy on
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.
From: Stefan Behnel on
j vickroy, 11.05.2010 17:42:
> 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

This is telling. It doesn't properly execute the cmd.exe shell. Maybe you
have to configure the shell setup somehow to make it accept MS's cmd.exe?
Note that cmd.exe isn't really what I'd call a "shell", so you may have to
put some work into getting it to run your scripts.

You can also try to add a shebang "#!cmd.exe" to the script, it seems like
Hudson interprets that by itself. Or execute nosetest from a Python script,
just check what the nosetest main script is doing and do the same in a
Python script.

Disclaimer: I never used Hudson on MS Windows, and I'm happy I don't have to.

Stefan