Jenkins nosetests FAILED

146 views
Skip to first unread message

Fedor Kompaniets

unread,
Oct 20, 2015, 10:36:43 AM10/20/15
to Jenkins Users
Hi, I have the next issue:


During my nose testing I have one test failed and Cubertura report didn't created:

-----------------------------------------------

Ran 155 tests in 37.580s

FAILED (failures=1)
Build step 'Execute shell' marked build as failure
Skipping Cobertura coverage report as build was not UNSTABLE or better ...
Recording test results
Finished: FAILURE

-----------------------------------------------


How can I configure my job to don't fail in when nosetests fail?

R. Tyler Croy

unread,
Oct 20, 2015, 2:01:37 PM10/20/15
to jenkins...@googlegroups.com
(replies inline)
This usually means that during an Execute Shell command something exited with a
status code of non-zero, e.g. `nosetest` probably sets a -1 on test failure.


You can swallow this error code, and let Jenkins scan the generated reports for
failures with a little shell magic:


nosetest || true

That will ensure that it always returns a zero status code


Hope that helps


- R. Tyler Croy

------------------------------------------------------
Code: <https://github.com/rtyler>
Chatter: <https://twitter.com/agentdero>

% gpg --keyserver keys.gnupg.net --recv-key 3F51E16F
------------------------------------------------------
signature.asc

Mark Waite

unread,
Oct 20, 2015, 2:17:20 PM10/20/15
to jenkins...@googlegroups.com
On Tue, Oct 20, 2015 at 12:01 PM R. Tyler Croy <ty...@monkeypox.org> wrote:
(replies inline)

On Tue, 20 Oct 2015, Fedor Kompaniets wrote:

> During my nose testing I have one test failed and Cubertura report didn't
> created:
>
> -----------------------------------------------
>
>
> Ran 155 tests in 37.580s
>
> FAILED (failures=1)
> Build step 'Execute shell' marked build as failure
> Skipping Cobertura coverage report as build was not UNSTABLE or better ...
> Recording test results
> Finished: FAILURE
>
>
> -----------------------------------------------
>
>
>
> How can I configure my job to don't fail in when nosetests fail?


This usually means that during an Execute Shell command something exited with a
status code of non-zero, e.g. `nosetest` probably sets a -1 on test failure.


The Python nosetests documentation describes a few other alternatives to R. Tyler's technique.  Refer to http://nose.readthedocs.org/en/latest/usage.html for a description of alternate ways to not return a failure through the operating system process on test failure.

R. Tyler's technique is valid and useful and requires no change to your test scripts.  The techniques on the nose documentation page assume you can change the test scripts.

Mark Waite
 

You can swallow this error code, and let Jenkins scan the generated reports for
failures with a little shell magic:


    nosetest || true

That will ensure that it always returns a zero status code


Hope that helps


- R. Tyler Croy

------------------------------------------------------
     Code: <https://github.com/rtyler>
  Chatter: <https://twitter.com/agentdero>

  % gpg --keyserver keys.gnupg.net --recv-key 3F51E16F
------------------------------------------------------

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/20151020180003.GC2450%40blackberry.coupleofllamas.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages