1
1
[tox]
2
+ requires =
3
+ tox-docker
2
4
envlist =
3
5
coverage-clean,
4
6
py35-{django22}-{sqlite,postgres},
5
7
py36-{django22,django30,django31}-{sqlite,postgres},
6
8
py37-{django22,django30,django31}-{sqlite,postgres},
7
9
py38-{django22,django30,django31}-{sqlite,postgres},
8
- py39-{django22,django30,django31}-{sqlite,postgres},
10
+ py39-{django11, django22,django30,django31}-{sqlite,postgres},
9
11
coverage-report,
10
12
py39-flake8
11
13
@@ -14,6 +16,7 @@ commands = coverage run --include='*/timezone_field/*' {envbindir}/django-admin.
14
16
deps =
15
17
coverage
16
18
djangorestframework>=3.0.0
19
+ django11: django>=1.11.29,<2.0
17
20
django22: django>=2.2.17,<2.3
18
21
django30: django>=3.0.0,<3.1
19
22
django31: django>=3.1.0,<3.2
@@ -24,6 +27,10 @@ setenv =
24
27
sqlite: TEST_DB_ENGINE =sqlite
25
28
postgres: TEST_DB_ENGINE =postgres
26
29
30
+ [testenv:py{35,36,37,38,39}-{django11,django22,django30,django31}-postgres]
31
+ docker =
32
+ db
33
+
27
34
[testenv:py39-flake8]
28
35
commands = flake8
29
36
deps = flake8
@@ -35,3 +42,26 @@ commands = coverage erase
35
42
commands =
36
43
coverage report
37
44
coverage html
45
+
46
+ [docker:db]
47
+ image = docker.io/bitnami/postgresql:13-debian-10
48
+ # Environment variables are passed to the container. They are only
49
+ # available to that container, and not to the testenv, other
50
+ # containers, or as replacements in other parts of tox.ini
51
+ environment =
52
+ POSTGRESQL_USERNAME =test_user
53
+ POSTGRESQL_PASSWORD =test_user
54
+ POSTGRESQL_DATABASE =timezone_field_tests
55
+ POSTGRES_INITDB_ARGS =--encoding =UTF-8
56
+ ports =
57
+ 5599:5432/tcp
58
+ # The healthcheck ensures that tox-docker won't run tests until the
59
+ # container is up and the command finishes with exit code 0 (success)
60
+ healthcheck_cmd = PGPASSWORD =$POSTGRESQL_PASSWORD psql \
61
+ --user =$POSTGRESQL_USERNAME --dbname =$POSTGRESQL_DATABASE \
62
+ --host =127.0.0.1 --quiet --no-align --tuples-only \
63
+ -1 --command =" SELECT 1"
64
+ healthcheck_timeout = 1
65
+ healthcheck_retries = 30
66
+ healthcheck_interval = 1
67
+ healthcheck_start_period = 1
0 commit comments