Opened 6 years ago

Last modified 5 years ago

#30010 closed New feature

Add support for running the test suite through docker with docker-compose — at Version 1

Reported by: Tom Forbes Owned by: nobody
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 (1)

comment:1 by Tom Forbes, 6 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top