unable to get Hudson to run unit tests

J

j vickroy

Hello,

I apologize if this is not the appropriate forum for a question about
Hudson (http://hudson-ci.org/), but I did not know where else to ask and
my web searches have not been fruitful.

I'm attempting to use Hudson to run nose
(http://somethingaboutorange.com/mrl/projects/nose/0.11.3/) unit tests
but without success.

The Hudson job configuration contains the following entry in the
**Source Code Management** section:

svn://vm-svn/GOES data processing/trunk/GOES/13,14,15/SXI/level-1

which successfully retrieves the desired project code from the
subversion repository.

The *Build* section, of the job configuration page, contains the
following entry:

"C:\Python26\Scripts\nosetests.exe --with-xunit --verbose"

in the *Execute Python Script* subsection.

Note, the above nose command runs as expected from a command shell
prompt on my computer.

As an additional check, I added the following command:

#!python.exe
print 'FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO'

in the *Execute shell* subsection of the job configuration *Build* section.

The Hudson console output for this job after a *Build Now* request is:

Started by user anonymous
Updating svn://vm-svn/GOES data processing/trunk/GOES/13,14,15/SXI/level-1
At revision 3379
no change for svn://vm-svn/GOES data
processing/trunk/GOES/13,14,15/SXI/level-1 since the previous build
[workspace] $ python
C:\DOCUME~1\JIM~1.VIC\LOCALS~1\Temp\hudson6901585295620519415.py
[workspace] $ python.exe
C:\DOCUME~1\JIM~1.VIC\LOCALS~1\Temp\hudson851004747320097491.sh
FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
Recording test results
Test reports were found but none of them are new. Did tests run?
For example, C:\Documents and Settings\jim.vickroy\.hudson\jobs\GOES
13-15 SXI Level-1 Products Generation\workspace\level-1\nosetests.xml is
20 min old

Finished: FAILURE

which seems to indicate the unit tests were not run since nosetests.xml
was generated by a previous execution of nose from a command shell.

I have been unable to get this to work (after trying many permutations
in the Hudson job configuration section) and would appreciate your guidance.

Thanks,
-- jv


P.S.
My system particulars are:

Microsoft Windows XP Professional (Service Pack 3)
Python 2.6.4
nose 0.11.3
Hudson 1.355
 
S

Stefan Behnel

j vickroy, 07.05.2010 20:44:
I apologize if this is not the appropriate forum for a question about
Hudson (http://hudson-ci.org/), but I did not know where else to ask and
my web searches have not been fruitful.

Certainly nice to read something about Hudson in this forum, which is rare
enough. It's seriously the greatest CI tool I've ever used, and it works
great with Python apps.

"C:\Python26\Scripts\nosetests.exe --with-xunit --verbose"

in the *Execute Python Script* subsection.

The problem is that this isn't a "Python Script". I's a an executable,
native program. Use the "execute shell" build step instead.

Stefan
 
J

Jean-Michel Pichavant

Stefan said:
j vickroy, 07.05.2010 20:44:

Certainly nice to read something about Hudson in this forum, which is
rare enough. It's seriously the greatest CI tool I've ever used, and
it works great with Python apps.
We use it, but this is a python list that's why there's few topics about
it. :)
Speaking for myself, I use it to execute the linter (pylint) on the
code and run unitary tests. Great tool for sure.

JM
 
J

j vickroy

Stefan said:
j vickroy, 07.05.2010 20:44:

Certainly nice to read something about Hudson in this forum, which is
rare enough. It's seriously the greatest CI tool I've ever used, and it
works great with Python apps.



The problem is that this isn't a "Python Script". I's a an executable,
native program. Use the "execute shell" build step instead.

Stefan
Thanks for your reply, Stefan.

When the above command

"C:\Python26\Scripts\nosetests.exe --with-xunit --verbose"

is moved to the "Execute shell" section of the job configuration page
along with the following "tracer" command:

#!python.exe
print 'FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO'

their is still no indication the unit tests are run.

Here is the output from the Hudson Console Output page

-------------------------------------------------------------------
Started by user anonymous
Updating svn://vm-svn/GOES data processing/trunk/GOES/13,14,15/SXI/level-1
At revision 3401
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\hudson2011616575490005324.sh
FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
[workspace] $ cmd.exe -xe
C:\DOCUME~1\JIM~1.VIC\LOCALS~1\Temp\hudson902246697107326581.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
Test reports were found but none of them are new. Did tests run?
For example, C:\Documents and Settings\jim.vickroy\.hudson\jobs\GOES
13-15 SXI Level-1 Products Generation\workspace\level-1\nosetests.xml is
2 days 19 hr old

Finished: FAILURE
-------------------------------------------------------------------

As a side note, my Hudson "global" configuration page contains:

cmd.exe

in the "Shell executable" section and

NOSEDIR
C:\Python26\Scripts

in the "Global properties" section.

-- jv
 
J

j vickroy

Stefan said:
j vickroy, 07.05.2010 20:44:

Certainly nice to read something about Hudson in this forum, which is
rare enough. It's seriously the greatest CI tool I've ever used, and it
works great with Python apps.



The problem is that this isn't a "Python Script". I's a an executable,
native program. Use the "execute shell" build step instead.

Stefan
Thanks for your reply, Stefan.

When the above command

"C:\Python26\Scripts\nosetests.exe --with-xunit --verbose"

is moved to the "Execute shell" section of the job configuration page
along with the following "tracer" command:

#!python.exe
print 'FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO'

their is still no indication the unit tests are run.

Here is the output from the Hudson Console Output page

-------------------------------------------------------------------
Started by user anonymous
Updating svn://vm-svn/GOES data processing/trunk/GOES/13,14,15/SXI/level-1
At revision 3401
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\hudson2011616575490005324.sh
FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
[workspace] $ cmd.exe -xe
C:\DOCUME~1\JIM~1.VIC\LOCALS~1\Temp\hudson902246697107326581.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
Test reports were found but none of them are new. Did tests run?
For example, C:\Documents and Settings\jim.vickroy\.hudson\jobs\GOES
13-15 SXI Level-1 Products Generation\workspace\level-1\nosetests.xml is
2 days 19 hr old

Finished: FAILURE
-------------------------------------------------------------------

As a side note, my Hudson "global" configuration page contains:

cmd.exe

in the "Shell executable" section and

NOSEDIR
C:\Python26\Scripts

in the "Global properties" section.

-- jv
 
J

j vickroy

Jean-Michel Pichavant said:
We use it, but this is a python list that's why there's few topics about
it. :)
Speaking for myself, I use it to execute the linter (pylint) on the
code and run unitary tests. Great tool for sure.

JM

Is there a more appropriate forum to ass about Python and Hudson? -- jv
 
J

j vickroy

Jean-Michel Pichavant said:
We use it, but this is a python list that's why there's few topics about
it. :)
Speaking for myself, I use it to execute the linter (pylint) on the
code and run unitary tests. Great tool for sure.

JM

Is there a more appropriate forum to ass about Python and Hudson? -- jv
 
J

Jean-Michel Pichavant

j said:
Stefan said:
j vickroy, 07.05.2010 20:44:

Certainly nice to read something about Hudson in this forum, which is
rare enough. It's seriously the greatest CI tool I've ever used, and
it works great with Python apps.



The problem is that this isn't a "Python Script". I's a an
executable, native program. Use the "execute shell" build step instead.

Stefan
Thanks for your reply, Stefan.

When the above command

"C:\Python26\Scripts\nosetests.exe --with-xunit --verbose"

is moved to the "Execute shell" section of the job configuration page
along with the following "tracer" command:

#!python.exe
print 'FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO'

their is still no indication the unit tests are run.

Here is the output from the Hudson Console Output page

-------------------------------------------------------------------
Started by user anonymous
Updating svn://vm-svn/GOES data
processing/trunk/GOES/13,14,15/SXI/level-1
At revision 3401
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\hudson2011616575490005324.sh
FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
[workspace] $ cmd.exe -xe
C:\DOCUME~1\JIM~1.VIC\LOCALS~1\Temp\hudson902246697107326581.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
Test reports were found but none of them are new. Did tests run?
For example, C:\Documents and Settings\jim.vickroy\.hudson\jobs\GOES
13-15 SXI Level-1 Products Generation\workspace\level-1\nosetests.xml
is 2 days 19 hr old

Finished: FAILURE
-------------------------------------------------------------------

As a side note, my Hudson "global" configuration page contains:

cmd.exe

in the "Shell executable" section and

NOSEDIR
C:\Python26\Scripts

in the "Global properties" section.

-- jv
Maybe something is missing on the machine hosting hudson, did you try to
execute nosetests.exe on that machine ?
I'm also confused with something, you do not provide nosetests with the
location of your package, assuming the current directory contains that
package (my guess).
Instead of printing 'FOOO', try "import os ; print os.getcwd(); print
os.listdir(os.getcwd())" to know where you are exactly and if this dir
contains your python package.

JM
 
J

j vickroy

Jean-Michel Pichavant said:
j said:
Stefan said:
j vickroy, 07.05.2010 20:44:
I apologize if this is not the appropriate forum for a question about
Hudson (http://hudson-ci.org/), but I did not know where else to ask
and
my web searches have not been fruitful.

Certainly nice to read something about Hudson in this forum, which is
rare enough. It's seriously the greatest CI tool I've ever used, and
it works great with Python apps.


"C:\Python26\Scripts\nosetests.exe --with-xunit --verbose"

in the *Execute Python Script* subsection.

The problem is that this isn't a "Python Script". I's a an
executable, native program. Use the "execute shell" build step instead.

Stefan
Thanks for your reply, Stefan.

When the above command

"C:\Python26\Scripts\nosetests.exe --with-xunit --verbose"

is moved to the "Execute shell" section of the job configuration page
along with the following "tracer" command:

#!python.exe
print 'FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO'

their is still no indication the unit tests are run.

Here is the output from the Hudson Console Output page

-------------------------------------------------------------------
Started by user anonymous
Updating svn://vm-svn/GOES data
processing/trunk/GOES/13,14,15/SXI/level-1
At revision 3401
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\hudson2011616575490005324.sh
FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
[workspace] $ cmd.exe -xe
C:\DOCUME~1\JIM~1.VIC\LOCALS~1\Temp\hudson902246697107326581.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
Test reports were found but none of them are new. Did tests run?
For example, C:\Documents and Settings\jim.vickroy\.hudson\jobs\GOES
13-15 SXI Level-1 Products Generation\workspace\level-1\nosetests.xml
is 2 days 19 hr old

Finished: FAILURE
-------------------------------------------------------------------

As a side note, my Hudson "global" configuration page contains:

cmd.exe

in the "Shell executable" section and

NOSEDIR
C:\Python26\Scripts

in the "Global properties" section.

-- jv
Maybe something is missing on the machine hosting hudson, did you try to
execute nosetests.exe on that machine ?

Hudson is running on my workstation (which also has python and nose
installed).
I'm also confused with something, you do not provide nosetests with the
location of your package, assuming the current directory contains that
package (my guess).

That is correct but see below ...
Instead of printing 'FOOO', try "import os ; print os.getcwd(); print
os.listdir(os.getcwd())" to know where you are exactly and if this dir
contains your python package.

great suggestion !

This showed the current working directory to be one level above where I
expected so that was definitely a problem so I changed my nose command,
in the Hudson Job configuration Execute shell box, to be

nosetests.exe --where=level-1 --with-xunit --verbose

and saved the configuration change.

This works as expected when run from a command shell in the Hudson
current working directory for this Hudson job.

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.

Thanks for thinking about this; I realize how difficult it is to
remotely troubleshoot a problem like this.

-- jv
 
J

j vickroy

Jean-Michel Pichavant said:
j said:
Stefan said:
j vickroy, 07.05.2010 20:44:
I apologize if this is not the appropriate forum for a question about
Hudson (http://hudson-ci.org/), but I did not know where else to ask
and
my web searches have not been fruitful.

Certainly nice to read something about Hudson in this forum, which is
rare enough. It's seriously the greatest CI tool I've ever used, and
it works great with Python apps.


"C:\Python26\Scripts\nosetests.exe --with-xunit --verbose"

in the *Execute Python Script* subsection.

The problem is that this isn't a "Python Script". I's a an
executable, native program. Use the "execute shell" build step instead.

Stefan
Thanks for your reply, Stefan.

When the above command

"C:\Python26\Scripts\nosetests.exe --with-xunit --verbose"

is moved to the "Execute shell" section of the job configuration page
along with the following "tracer" command:

#!python.exe
print 'FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO'

their is still no indication the unit tests are run.

Here is the output from the Hudson Console Output page

-------------------------------------------------------------------
Started by user anonymous
Updating svn://vm-svn/GOES data
processing/trunk/GOES/13,14,15/SXI/level-1
At revision 3401
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\hudson2011616575490005324.sh
FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
[workspace] $ cmd.exe -xe
C:\DOCUME~1\JIM~1.VIC\LOCALS~1\Temp\hudson902246697107326581.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
Test reports were found but none of them are new. Did tests run?
For example, C:\Documents and Settings\jim.vickroy\.hudson\jobs\GOES
13-15 SXI Level-1 Products Generation\workspace\level-1\nosetests.xml
is 2 days 19 hr old

Finished: FAILURE
-------------------------------------------------------------------

As a side note, my Hudson "global" configuration page contains:

cmd.exe

in the "Shell executable" section and

NOSEDIR
C:\Python26\Scripts

in the "Global properties" section.

-- jv
Maybe something is missing on the machine hosting hudson, did you try to
execute nosetests.exe on that machine ?

Hudson is running on my workstation (which also has python and nose
installed).
I'm also confused with something, you do not provide nosetests with the
location of your package, assuming the current directory contains that
package (my guess).

That is correct but see below ...
Instead of printing 'FOOO', try "import os ; print os.getcwd(); print
os.listdir(os.getcwd())" to know where you are exactly and if this dir
contains your python package.

great suggestion !

This showed the current working directory to be one level above where I
expected so that was definitely a problem so I changed my nose command,
in the Hudson Job configuration Execute shell box, to be

nosetests.exe --where=level-1 --with-xunit --verbose

and saved the configuration change.

This works as expected when run from a command shell in the Hudson
current working directory for this Hudson job.

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.

Thanks for thinking about this; I realize how difficult it is to
remotely troubleshoot a problem like this.

-- jv
 
S

Stefan Behnel

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

j vickroy

Thanks again, Stefan. My comments are below.

Stefan said:
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.
 
S

Stefan Behnel

j vickroy, 11.05.2010 16:46:
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.


.... although the shebang isn't really supported by cmd.exe, I guess ...

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
 
J

j vickroy

Stefan said:
j vickroy, 11.05.2010 16:46:

Then setting the "Shell executable" to "cmd.exe" will do the right thing
here.



... although the shebang isn't really supported by cmd.exe, I guess ...



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

j vickroy

Stefan said:
j vickroy, 11.05.2010 16:46:

Then setting the "Shell executable" to "cmd.exe" will do the right thing
here.



... although the shebang isn't really supported by cmd.exe, I guess ...



That's why I told you to configure nosetest to use an specific output
path for the unit test file.



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

Stefan Behnel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top