public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Gilbert <floppym@gentoo.org>
To: idella4@gentoo.org
Cc: gentoo-python <gentoo-python@lists.gentoo.org>
Subject: [gentoo-python] Re: [gentoo-commits] gentoo-x86 commit in dev-python/django-tastypie: django-tastypie-0.9.15.ebuild
Date: Tue, 04 Jun 2013 12:07:56 -0400	[thread overview]
Message-ID: <51AE10DC.2040300@gentoo.org> (raw)
In-Reply-To: <20130603070829.CA5182171D@flycatcher.gentoo.org>

[-- 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 --]

           reply	other threads:[~2013-06-04 16:08 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20130603070829.CA5182171D@flycatcher.gentoo.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51AE10DC.2040300@gentoo.org \
    --to=floppym@gentoo.org \
    --cc=gentoo-python@lists.gentoo.org \
    --cc=idella4@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox