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.
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>
* 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>
Comment (by Tom Forbes):
Initial PR: https://github.com/django/django/pull/10725
--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:3>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:4>
* needs_docs: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:5>
* owner: nobody => Tom Forbes
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:6>
* 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>
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>
* needs_better_patch: 1 => 0
Comment:
[https://github.com/django/django/pull/11838 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/30010#comment:9>
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>
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>
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>
* 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>