Juan, You also might want to look into using a testing framework such as nose (https://nose.readthedocs.org/en/latest/) for running your unit tests. A number of scientific python packages use this package including scikit-image. If you name the file and functions/classes containing your unit tests correctly, nose will automatically collect and run your tests. In addition, you can use the handy nosetests command which will set the exit value correctly. If you look at the .travis.yml file for scikits-image you will see that on line 66 nosetests is used to run runs the unit tests. This same method is used in many other scientific python packages Cheers, - Jonathan On 01/21/2014 12:06 AM, Ralf Gommers wrote:
On Tue, Jan 21, 2014 at 2:00 AM, Juan Nunez-Iglesias <jni.soma@gmail.com <mailto:jni.soma@gmail.com>> wrote:
Hi guys,
A bit off-topic but I hope someone will be able to help trivially...
I'm trying to run Travis on my own gala repository (you might remember gala from my scipy2012 talk, when it was called ray). It appeared to be working fine, but actually it's giving me a little green dot when in fact a bunch of tests are failing!
https://travis-ci.org/jni/gala/builds/16860892
Last line:"Done. Your build exited with 0."
Here's the corresponding .travis.yml file:
https://github.com/jni/gala/blob/tree-agglo/.travis.yml
What am I doing wrong? How can I make it so the test failures result in build failures?
You need your test script to have a nonzero exit status. You also need to run all your tests from a single script for that to work properly. You could copy and adapt https://github.com/scipy/scipy/blob/master/runtests.py for your project.
Cheers, Ralf
Thanks,
Juan.
-- You received this message because you are subscribed to the Google Groups "scikit-image" group. To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe@googlegroups.com <mailto:scikit-image%2Bunsubscribe@googlegroups.com>. For more options, visit https://groups.google.com/groups/opt_out.
-- You received this message because you are subscribed to the Google Groups "scikit-image" group. To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Ralf, Jonathan, Thanks for your help — the exit code was indeed the problem, and nosetests the solution. Running the test files with python -m nose or just nosetests indeed resolved the problem. (Though not the running-from-a-single-file problem... But I can deal with that later. This will at least tell me what the first test to fail is. =) Thanks! Juan. On Wed, Jan 22, 2014 at 2:55 AM, Jonathan Helmus <jjhelmus@gmail.com> wrote:
Juan,
You also might want to look into using a testing framework such as nose (https://nose.readthedocs.org/en/latest/) for running your unit tests. A number of scientific python packages use this package including scikit-image. If you name the file and functions/classes containing your unit tests correctly, nose will automatically collect and run your tests. In addition, you can use the handy nosetests command which will set the exit value correctly. If you look at the .travis.yml file for scikits-image you will see that on line 66 nosetests is used to run runs the unit tests. This same method is used in many other scientific python packages
Cheers,
- Jonathan
On 01/21/2014 12:06 AM, Ralf Gommers wrote:
On Tue, Jan 21, 2014 at 2:00 AM, Juan Nunez-Iglesias <jni.soma@gmail.com>wrote:
Hi guys,
A bit off-topic but I hope someone will be able to help trivially...
I'm trying to run Travis on my own gala repository (you might remember gala from my scipy2012 talk, when it was called ray). It appeared to be working fine, but actually it's giving me a little green dot when in fact a bunch of tests are failing!
Last line: "Done. Your build exited with 0."
Here's the corresponding .travis.yml file:
https://github.com/jni/gala/blob/tree-agglo/.travis.yml
What am I doing wrong? How can I make it so the test failures result in build failures?
You need your test script to have a nonzero exit status. You also need to run all your tests from a single script for that to work properly. You could copy and adapt https://github.com/scipy/scipy/blob/master/runtests.py for your project.
Cheers, Ralf
Thanks,
Juan.
-- You received this message because you are subscribed to the Google Groups "scikit-image" group. To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
-- You received this message because you are subscribed to the Google Groups "scikit-image" group. To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
-- You received this message because you are subscribed to the Google Groups "scikit-image" group. To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
participants (2)
-
Jonathan Helmus
-
Juan Nunez-Iglesias