[Django] #30010: Add support for running the test suite through docker with docker-compose

14 views
Skip to first unread message

Django

unread,
Dec 4, 2018, 6:31:00 PM12/4/18
to django-...@googlegroups.com
#30010: Add support for running the test suite through docker with docker-compose
---------------------------------------------+------------------------
Reporter: Tom Forbes | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------------+------------------------
As
[https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg
/django-developers/_SRnleXuyzI/KYYQXiPHDQAJ per a discussion on the
developers mailing list], I would like to propose adding docker-compose
support to Django.

Right now running the test suite across different databases is annoying at
best, and is a pain point for new developers wishing to join the project.
With a relatively small number of changes we can add a docker-compose
definition to the Django project itself which will allow anyone to quickly
run tests across any supported Python/database version.

One option is to add this to runtests.py, i.e `runtests.py --docker`. I do
not think this is a good approach as there are a large ecosystem of tools
that already work with docker, including editors, CLI tools and shells,
which will not work with runtests.py.

I've already done most of the work for this in [https://github.com/orf
/django-docker-box django-docker-box]. We would need to copy the
[https://github.com/orf/django-docker-box/blob/master/docker-compose.yml
docker-compose.yml] file as well [https://github.com/orf/django-docker-
box/blob/master/Dockerfile as the Dockerfile], and add documentation.

Getting this to work with Oracle would require more work and I believe it
can be done as a future ticket.

--
Ticket URL: <https://code.djangoproject.com/ticket/30010>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 4, 2018, 6:38:35 PM12/4/18
to django-...@googlegroups.com
#30010: Add support for running the test suite through docker with docker-compose
-----------------------------------+--------------------------------------

Reporter: Tom Forbes | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Description changed by Tom Forbes:

Old description:

> As
> [https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg
> /django-developers/_SRnleXuyzI/KYYQXiPHDQAJ per a discussion on the
> developers mailing list], I would like to propose adding docker-compose
> support to Django.
>
> Right now running the test suite across different databases is annoying
> at best, and is a pain point for new developers wishing to join the
> project. With a relatively small number of changes we can add a docker-

> compose definition to the Django project itself which will allow anyone


> to quickly run tests across any supported Python/database version.
>
> One option is to add this to runtests.py, i.e `runtests.py --docker`. I
> do not think this is a good approach as there are a large ecosystem of
> tools that already work with docker, including editors, CLI tools and
> shells, which will not work with runtests.py.
>
> I've already done most of the work for this in [https://github.com/orf
> /django-docker-box django-docker-box]. We would need to copy the
> [https://github.com/orf/django-docker-box/blob/master/docker-compose.yml
> docker-compose.yml] file as well [https://github.com/orf/django-docker-
> box/blob/master/Dockerfile as the Dockerfile], and add documentation.
>
> Getting this to work with Oracle would require more work and I believe it
> can be done as a future ticket.

New description:

As
[https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg
/django-developers/_SRnleXuyzI/KYYQXiPHDQAJ per a discussion on the
developers mailing list], I would like to propose adding docker-compose
support to Django.

Right now running the test suite across different databases is annoying at
best, and is a pain point for new developers wishing to join the project.
With a relatively small number of changes we can add a docker-compose
definition to the Django project itself which will allow anyone to quickly
run tests across any supported Python/database version.

One option is to add this to runtests.py, i.e `runtests.py --docker`. I do
not think this is a good approach as there are a large ecosystem of tools
that already work with docker, including editors, CLI tools and shells,
which will not work with runtests.py.

I've already done most of the work for this in [https://github.com/orf
/django-docker-box django-docker-box]. We would need to copy the
[https://github.com/orf/django-docker-box/blob/master/docker-compose.yml
docker-compose.yml] file as well [https://github.com/orf/django-docker-
box/blob/master/Dockerfile as the Dockerfile], and add documentation.

Getting this to work with Oracle would require more work and I believe it
can be done as a future ticket.

In django-docker-box I've had [https://github.com/orf/django-docker-
box/tree/master/settings to create specific settings files for each
backend]. I can't see a way around not including this in core as well,
perhaps under a `tests/settings/docker/` subdirectory?

--

--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:1>

Django

unread,
Dec 4, 2018, 6:41:17 PM12/4/18
to django-...@googlegroups.com
#30010: Add support for running the test suite through docker with docker-compose
-----------------------------------+------------------------------------

Reporter: Tom Forbes | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by Simon Charette):

* needs_docs: 0 => 1
* stage: Unreviewed => Accepted


Comment:

Accepting on the basis that I've used Tom's `django-docker-box`
extensively since I learned about it and it greatly simplified my testing
setup.

I assume it would help speeding up initial contributor setup as well.

--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:2>

Django

unread,
Dec 4, 2018, 8:16:07 PM12/4/18
to django-...@googlegroups.com
#30010: Add support for running the test suite through docker with docker-compose
-----------------------------------+------------------------------------

Reporter: Tom Forbes | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by Tom Forbes):

Initial PR: https://github.com/django/django/pull/10725

--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:3>

Django

unread,
Dec 6, 2018, 9:31:15 AM12/6/18
to django-...@googlegroups.com
#30010: Add support for running the test suite through docker with docker-compose
-----------------------------------+------------------------------------

Reporter: Tom Forbes | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by Tom Forbes):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:4>

Django

unread,
Dec 23, 2018, 11:14:23 AM12/23/18
to django-...@googlegroups.com
#30010: Add support for running the test suite through docker with docker-compose
-----------------------------------+------------------------------------

Reporter: Tom Forbes | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by Tom Forbes):

* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:5>

Django

unread,
Dec 23, 2018, 11:14:54 AM12/23/18
to django-...@googlegroups.com
#30010: Add support for running the test suite through docker with docker-compose
-----------------------------------+--------------------------------------
Reporter: Tom Forbes | Owner: Tom Forbes
Type: New feature | Status: assigned

Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by Tom Forbes):

* owner: nobody => Tom Forbes
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:6>

Django

unread,
Feb 18, 2019, 6:09:11 AM2/18/19
to django-...@googlegroups.com
#30010: Add support for running the test suite through docker with docker-compose
-----------------------------------+--------------------------------------
Reporter: Tom Forbes | Owner: Tom Forbes
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by Carlton Gibson):

* needs_better_patch: 0 => 1


Comment:

I'm marking this ''Patch needs improvement'' since there are
comments/issues on the PR and in the django-docker-box repo.

There's [https://github.com/orf/django-docker-box/issues/1 an ongoing
discussion thread on django-docker-box] which seems to be home to the
conversation currently.

--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:7>

Django

unread,
Feb 27, 2019, 4:56:13 AM2/27/19
to django-...@googlegroups.com
#30010: Add support for running the test suite through docker with docker-compose
-----------------------------------+--------------------------------------
Reporter: Tom Forbes | Owner: Tom Forbes
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by Johannes Hoppe):

FYI, there is an official Docker image for Oracle now. I added it to the
wiki too, seealso: https://code.djangoproject.com/wiki/OracleTestSetup

--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:8>

Django

unread,
Sep 27, 2019, 2:57:57 AM9/27/19
to django-...@googlegroups.com
#30010: Add support for running the test suite through docker with docker-compose
-----------------------------------+--------------------------------------
Reporter: Tom Forbes | Owner: Tom Forbes
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by felixxm):

* needs_better_patch: 1 => 0


Comment:

[https://github.com/django/django/pull/11838 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:9>

Django

unread,
Oct 2, 2019, 8:05:42 AM10/2/19
to django-...@googlegroups.com
#30010: Add support for running the test suite through docker with docker-compose
-----------------------------------+--------------------------------------
Reporter: Tom Forbes | Owner: Tom Forbes
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"f7eb9fb676d7afba16fc577283610b359718e644" f7eb9fb]:
{{{
#!CommitTicketReference repository=""
revision="f7eb9fb676d7afba16fc577283610b359718e644"
Refs #30010 -- Doc'd running tests with django-docker-box.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:10>

Django

unread,
Oct 2, 2019, 8:05:56 AM10/2/19
to django-...@googlegroups.com
#30010: Add support for running the test suite through docker with docker-compose
-----------------------------------+--------------------------------------
Reporter: Tom Forbes | Owner: Tom Forbes
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"b6da3192c0d7561dd1daf3c2a8e7b82c66204a51" b6da319]:
{{{
#!CommitTicketReference repository=""
revision="b6da3192c0d7561dd1daf3c2a8e7b82c66204a51"
[3.0.x] Refs #30010 -- Doc'd running tests with django-docker-box.

Backport of f7eb9fb676d7afba16fc577283610b359718e644 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:11>

Django

unread,
Oct 2, 2019, 8:06:27 AM10/2/19
to django-...@googlegroups.com
#30010: Add support for running the test suite through docker with docker-compose
-----------------------------------+--------------------------------------
Reporter: Tom Forbes | Owner: Tom Forbes
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"8ac918a91349df26d83264b37da9dbd0140aeede" 8ac918a9]:
{{{
#!CommitTicketReference repository=""
revision="8ac918a91349df26d83264b37da9dbd0140aeede"
[2.2.x] Refs #30010 -- Doc'd running tests with django-docker-box.

Backport of f7eb9fb676d7afba16fc577283610b359718e644 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:12>

Django

unread,
Oct 2, 2019, 8:09:00 AM10/2/19
to django-...@googlegroups.com
#30010: Add support for running the test suite through docker with docker-compose
-----------------------------------+--------------------------------------
Reporter: Tom Forbes | Owner: Tom Forbes
Type: New feature | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by felixxm):

* status: assigned => closed
* resolution: => fixed


Comment:

Using `django-docker-box` is now documented and we moved it into Django
org.

--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:13>

Reply all
Reply to author
Forward
0 new messages