1 |
On 6/3/2013 3:08 AM, Ian Delaney (idella4) wrote: |
2 |
> idella4 13/06/03 07:08:29 |
3 |
> |
4 |
> Modified: django-tastypie-0.9.15.ebuild |
5 |
> Log: |
6 |
> 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 |
7 |
> |
8 |
> (Portage version: 2.1.11.63/cvs/Linux x86_64, signed Manifest commit with key 0xB8072B0D) |
9 |
> |
10 |
|
11 |
Thanks for the cleanup, but you missed a few spots. ;) See below. |
12 |
|
13 |
> |
14 |
> -RESTRICT="test" |
15 |
> +python_prepare_all() { |
16 |
> + # skip run tests script |
17 |
> + use test && epatch "${FILESDIR}"/runtests.patch |
18 |
> + distutils-r1_python_prepare_all |
19 |
> +} |
20 |
> |
21 |
|
22 |
Do not apply patches conditionally if it can be avoided. There is no |
23 |
reason to do it conditionally in this case. |
24 |
|
25 |
> python_test() { |
26 |
> - # See tests/run_all_tests.sh |
27 |
> - local types=( core basic alphanumeric slashless namespaced related |
28 |
> - validation gis content_gfk authorization ) |
29 |
> - local failed type |
30 |
> - |
31 |
> - pushd tests > /dev/null || die |
32 |
> - for type in "${types[@]}"; do |
33 |
> - set -- django-admin.py test ${type} --settings=settings_${type} |
34 |
> - echo "$@" |
35 |
> - "$@" || failed=1 |
36 |
> - done |
37 |
> - popd > /dev/null || die |
38 |
> - |
39 |
> - [[ -z ${failed} ]] || die "Testing failed with ${EPYTHON}" |
40 |
> + PYTHONPATH=.:tests ./tests/run_all_tests.sh |
41 |
> } |
42 |
|
43 |
Where is your || die? |
44 |
|
45 |
> Index: runtests.patch |
46 |
> =================================================================== |
47 |
> The run tests bash script keeps going on a fail. Patch corrects this |
48 |
for gentoo |
49 |
> diff -ur django-tastypie-0.9.15.oirg/tests/run_all_tests.sh |
50 |
django-tastypie-0.9.15/tests/run_all_tests.sh |
51 |
> --- tests/run_all_tests.sh 2013-05-03 10:36:43.000000000 +0800 |
52 |
> +++ tests/run_all_tests.sh 2013-06-03 13:55:18.633474126 +0800 |
53 |
> @@ -26,15 +26,23 @@ |
54 |
> fi |
55 |
> |
56 |
> for type in $TYPES; do |
57 |
> - echo "** $type **" |
58 |
> + echo "** running test $type **" |
59 |
> |
60 |
> if [ $type == 'related' ]; then |
61 |
> - django-admin.py test ${type}_resource --settings=settings_$type |
62 |
> - continue |
63 |
> + if django-admin.py test ${type}_resource --settings=settings_$type; then |
64 |
> + continue |
65 |
> + else |
66 |
> + echo "Test ${type} failed" |
67 |
> + exit -1 |
68 |
> + fi |
69 |
> elif [ $type == 'gis' ]; then |
70 |
> - createdb -T template_postgis tastypie.db |
71 |
> + createdb -T template_posttastypie.db |
72 |
> fi |
73 |
> |
74 |
> - django-admin.py test $type --settings=settings_$type |
75 |
> - echo; echo |
76 |
> + if ! django-admin.py test $type --settings=settings_$type; then |
77 |
> + echo "Test ${type} failed" |
78 |
> + exit -1 |
79 |
> + else |
80 |
> + echo; echo |
81 |
> + fi |
82 |
> done |
83 |
|
84 |
Exiting with a negative value (-1) is not POSIX compliant and does not |
85 |
actually work on some operating systems. Please change this to a |
86 |
positive value between 1 and 255. |
87 |
|
88 |
http://en.wikipedia.org/wiki/Exit_status |