unable to get Hudson to run unit tests

j vickroy jim.vickroy at noaa.gov
Tue May 11 10:46:17 EDT 2010


Thanks again, Stefan.  My comments are below.

Stefan Behnel wrote:
> j vickroy, 10.05.2010 17:39:
>> Unfortunately, when "Hudson Build now" is performed, the Hudson Console
>> output, for this job, is:
>>
>> ------------------------------------------------------------
>> Started by user anonymous
>> Updating svn://vm-svn/GOES data 
>> processing/trunk/GOES/13,14,15/SXI/level-1
>> At revision 3403
>> no change for svn://vm-svn/GOES data
>> processing/trunk/GOES/13,14,15/SXI/level-1 since the previous build
>> [workspace] $ python.exe
>> C:\DOCUME~1\JIM~1.VIC\LOCALS~1\Temp\hudson5273111667332806239.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']
>> [workspace] $ cmd.exe -xe
>> C:\DOCUME~1\JIM~1.VIC\LOCALS~1\Temp\hudson991194264891924641.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>Recording test results
>> No test report files were found. Configuration error?
>> Finished: FAILURE
>> ------------------------------------------------------------
>>
>> The second [workspace] section output (above) looks like cmd.exe is
>> being executed with no parameters (i.e., without the
>> "nosetests.exe --where=level-1 --with-xunit --verbose") parameter.
> 
> 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.

If I do not specify "C:\WINDOWS\system32\cmd.exe" for "Manage Hudson | 
Configuration System | Shell | Shell executable", the "Console output" 
after a "Build now" is:

-----------------------------------------------------
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] $ sh -xe 
C:\DOCUME~1\JIM~1.VIC\LOCALS~1\Temp\hudson869574722591302824.sh
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: Cannot run program "sh" (in directory "C:\Documents 
and Settings\jim.vickroy\.hudson\jobs\GOES 13-15 SXI Level-1 Products 
Generation\workspace"): CreateProcess error=2, The system cannot find 
the file specified
	at java.lang.ProcessBuilder.start(Unknown Source)
	at hudson.Proc$LocalProc.<init>(Proc.java:149)
	at hudson.Proc$LocalProc.<init>(Proc.java:121)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:636)
	at hudson.Launcher$ProcStarter.start(Launcher.java:271)
	at hudson.Launcher$ProcStarter.join(Launcher.java:278)
	at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:83)
	at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:58)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
	at 
hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:584)
	at hudson.model.Build$RunnerImpl.build(Build.java:174)
	at hudson.model.Build$RunnerImpl.doRun(Build.java:138)
	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416)
	at hudson.model.Run.run(Run.java:1244)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
	at hudson.model.ResourceController.execute(ResourceController.java:88)
	at hudson.model.Executor.run(Executor.java:122)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot 
find the file specified
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(Unknown Source)
	at java.lang.ProcessImpl.start(Unknown Source)
	... 17 more
Recording test results
Finished: FAILURE
-----------------------------------------------------

Note Hudson is looking for "sh".

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.
> 
> 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 (except in the Recycle Bin from my explicit executions of the 
"nosetests.exe --where=level-1 --with-xunit --verbose" command).  This 
is why I thought Hudson was not executing the above nosetests.exe 
command (specified in "*job* | Configure | Build | Execute shell | command".


Put a wildcard path into the unit test
> config box that finds the XML files that nosetest writes. It's also best 
> to tell nosetest where to put them explicitly using a command line option.
> 
> Stefan
> 

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.



More information about the Python-list mailing list