Skip to content

Commit b7f6782

Browse files
committed
Merge pull request django-haystack#699 from acdha/tox-multiple-django-versions
Minor tox.ini & test runner tidying
2 parents 9d92d4d + bdc5c6a commit b7f6782

File tree

2 files changed

+54
-13
lines changed

2 files changed

+54
-13
lines changed

tests/run_all_tests.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
set -e
4+
35
if [ "$1" == "--help" ]; then
46
echo "Runs the test suite for all backends"
57
echo
@@ -15,38 +17,42 @@ else
1517
TEST_RUNNER=django-admin.py
1618
fi
1719

20+
export FAIL=0
21+
1822
echo "** CORE **"
19-
$TEST_RUNNER test core --settings=settings
23+
$TEST_RUNNER test core --settings=settings $TEST_RUNNER_ARGS || FAIL=1
2024
echo ""
2125

2226
echo "** DISCOVERY **"
23-
$TEST_RUNNER test discovery --settings=discovery_settings
27+
$TEST_RUNNER test discovery --settings=discovery_settings $TEST_RUNNER_ARGS || FAIL=1
2428
echo ""
2529

2630
echo "** OVERRIDES **"
27-
$TEST_RUNNER test overrides --settings=overrides_settings
31+
$TEST_RUNNER test overrides --settings=overrides_settings $TEST_RUNNER_ARGS || FAIL=1
2832
echo ""
2933

3034
echo "** SIMPLE **"
31-
$TEST_RUNNER test simple_tests --settings=simple_settings
35+
$TEST_RUNNER test simple_tests --settings=simple_settings $TEST_RUNNER_ARGS || FAIL=1
3236
echo ""
3337

3438
echo "** SOLR **"
35-
$TEST_RUNNER test solr_tests --settings=solr_settings
39+
$TEST_RUNNER test solr_tests --settings=solr_settings $TEST_RUNNER_ARGS || FAIL=1
3640
echo ""
3741

3842
echo "** Elasticsearch **"
39-
$TEST_RUNNER test elasticsearch_tests --settings=elasticsearch_settings
43+
$TEST_RUNNER test elasticsearch_tests --settings=elasticsearch_settings $TEST_RUNNER_ARGS || FAIL=1
4044
echo ""
4145

4246
echo "** WHOOSH **"
43-
$TEST_RUNNER test whoosh_tests --settings=whoosh_settings
47+
$TEST_RUNNER test whoosh_tests --settings=whoosh_settings $TEST_RUNNER_ARGS || FAIL=1
4448
echo ""
4549

4650
echo "** MULTIPLE INDEX **"
47-
$TEST_RUNNER test multipleindex --settings=multipleindex_settings
51+
$TEST_RUNNER test multipleindex --settings=multipleindex_settings $TEST_RUNNER_ARGS || FAIL=1
4852
echo ""
4953

5054
echo "** SPATIAL **"
51-
$TEST_RUNNER test spatial --settings=spatial_settings
55+
$TEST_RUNNER test spatial --settings=spatial_settings $TEST_RUNNER_ARGS || FAIL=1
5256
echo ""
57+
58+
exit $FAIL

tox.ini

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,49 @@
11
[tox]
2-
envlist = py25,py26,py27,docs
3-
downloadcache = .tox/_download/
2+
envlist = docs, py27-django-1.4, py27-django-1.3, py26-django-1.4, py26-django-1.3, py25-django-1.4, py25-django-1.3
3+
downloadcache = {envtmpdir}tox-downloadcache/
4+
5+
[base]
6+
deps =
7+
mock
8+
pysolr
9+
poster
10+
whoosh
11+
pyelasticsearch
12+
httplib2
13+
python-dateutil
14+
geopy
415

516
[testenv]
617
setenv =
718
PYTHONPATH = {toxinidir}/tests
19+
TEST_RUNNER_ARGS = -v0
820
commands =
921
{toxinidir}/tests/run_all_tests.sh
10-
deps =
11-
django==1.3
22+
deps = {[base]deps}
23+
24+
[testenv:py27-django-1.4]
25+
deps = django>=1.4,<1.5
26+
{[base]deps}
27+
28+
[testenv:py27-django-1.3]
29+
deps = django>=1.3,<1.4
30+
{[base]deps}
31+
32+
[testenv:py26-django-1.4]
33+
deps = django>=1.4,<1.5
34+
{[base]deps}
35+
36+
[testenv:py26-django-1.3]
37+
deps = django>=1.3,<1.4
38+
{[base]deps}
39+
40+
[testenv:py25-django-1.4]
41+
deps = django>=1.4,<1.5
42+
{[base]deps}
43+
44+
[testenv:py25-django-1.3]
45+
deps = django>=1.3,<1.4
46+
{[base]deps}
1247

1348
[testenv:docs]
1449
changedir = docs

0 commit comments

Comments
 (0)