Opened 6 years ago

Closed 5 years ago

#30010 closed New feature (fixed)

Add support for running the test suite through docker with docker-compose

Reported by: Tom Forbes Owned by: Tom Forbes
Component: Testing framework Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tom Forbes)

As 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 django-docker-box. We would need to copy the docker-compose.yml file as well 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 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?

Change History (13)

comment:1 by Tom Forbes, 6 years ago

Description: modified (diff)

comment:2 by Simon Charette, 6 years ago

Needs documentation: set
Triage Stage: UnreviewedAccepted

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.

comment:4 by Tom Forbes, 6 years ago

Has patch: set

comment:5 by Tom Forbes, 6 years ago

Needs documentation: unset

comment:6 by Tom Forbes, 6 years ago

Owner: changed from nobody to Tom Forbes
Status: newassigned

comment:7 by Carlton Gibson, 6 years ago

Patch needs improvement: set

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

There's an ongoing discussion thread on django-docker-box which seems to be home to the conversation currently.

comment:8 by Johannes Maron, 6 years ago

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

comment:9 by Mariusz Felisiak, 5 years ago

Patch needs improvement: unset

comment:10 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In f7eb9fb:

Refs #30010 -- Doc'd running tests with django-docker-box.

comment:11 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In b6da319:

[3.0.x] Refs #30010 -- Doc'd running tests with django-docker-box.

Backport of f7eb9fb676d7afba16fc577283610b359718e644 from master

comment:12 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In 8ac918a9:

[2.2.x] Refs #30010 -- Doc'd running tests with django-docker-box.

Backport of f7eb9fb676d7afba16fc577283610b359718e644 from master

comment:13 by Mariusz Felisiak, 5 years ago

Resolution: fixed
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.
Back to Top