* [gentoo-python] Re: [gentoo-commits] gentoo-x86 commit in dev-python/django-tastypie: django-tastypie-0.9.15.ebuild
[not found] <20130603070829.CA5182171D@flycatcher.gentoo.org>
@ 2013-06-04 16:07 ` Mike Gilbert
0 siblings, 0 replies; only message in thread
From: Mike Gilbert @ 2013-06-04 16:07 UTC (permalink / raw
To: idella4; +Cc: gentoo-python
[-- Attachment #1: Type: text/plain, Size: 2913 bytes --]
On 6/3/2013 3:08 AM, Ian Delaney (idella4) wrote:
> idella4 13/06/03 07:08:29
>
> Modified: django-tastypie-0.9.15.ebuild
> Log:
> Added needed deps, tarball from pypi substituted with 'proper' one from home site, patch for running testsuite to die on fail (shifts code from ebuild back to run script), test phase reduced to run on 1 line
>
> (Portage version: 2.1.11.63/cvs/Linux x86_64, signed Manifest commit with key 0xB8072B0D)
>
Thanks for the cleanup, but you missed a few spots. ;) See below.
>
> -RESTRICT="test"
> +python_prepare_all() {
> + # skip run tests script
> + use test && epatch "${FILESDIR}"/runtests.patch
> + distutils-r1_python_prepare_all
> +}
>
Do not apply patches conditionally if it can be avoided. There is no
reason to do it conditionally in this case.
> python_test() {
> - # See tests/run_all_tests.sh
> - local types=( core basic alphanumeric slashless namespaced related
> - validation gis content_gfk authorization )
> - local failed type
> -
> - pushd tests > /dev/null || die
> - for type in "${types[@]}"; do
> - set -- django-admin.py test ${type} --settings=settings_${type}
> - echo "$@"
> - "$@" || failed=1
> - done
> - popd > /dev/null || die
> -
> - [[ -z ${failed} ]] || die "Testing failed with ${EPYTHON}"
> + PYTHONPATH=.:tests ./tests/run_all_tests.sh
> }
Where is your || die?
> Index: runtests.patch
> ===================================================================
> The run tests bash script keeps going on a fail. Patch corrects this
for gentoo
> diff -ur django-tastypie-0.9.15.oirg/tests/run_all_tests.sh
django-tastypie-0.9.15/tests/run_all_tests.sh
> --- tests/run_all_tests.sh 2013-05-03 10:36:43.000000000 +0800
> +++ tests/run_all_tests.sh 2013-06-03 13:55:18.633474126 +0800
> @@ -26,15 +26,23 @@
> fi
>
> for type in $TYPES; do
> - echo "** $type **"
> + echo "** running test $type **"
>
> if [ $type == 'related' ]; then
> - django-admin.py test ${type}_resource --settings=settings_$type
> - continue
> + if django-admin.py test ${type}_resource --settings=settings_$type; then
> + continue
> + else
> + echo "Test ${type} failed"
> + exit -1
> + fi
> elif [ $type == 'gis' ]; then
> - createdb -T template_postgis tastypie.db
> + createdb -T template_posttastypie.db
> fi
>
> - django-admin.py test $type --settings=settings_$type
> - echo; echo
> + if ! django-admin.py test $type --settings=settings_$type; then
> + echo "Test ${type} failed"
> + exit -1
> + else
> + echo; echo
> + fi
> done
Exiting with a negative value (-1) is not POSIX compliant and does not
actually work on some operating systems. Please change this to a
positive value between 1 and 255.
http://en.wikipedia.org/wiki/Exit_status
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-06-04 16:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20130603070829.CA5182171D@flycatcher.gentoo.org>
2013-06-04 16:07 ` [gentoo-python] Re: [gentoo-commits] gentoo-x86 commit in dev-python/django-tastypie: django-tastypie-0.9.15.ebuild Mike Gilbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox