Code

Opened 18 months ago

Closed 9 months ago

Last modified 9 months ago

#19196 closed New feature (fixed)

Add tests/requirements.txt

Reported by: akaariai Owned by: nobody
Component: Documentation Version: master
Severity: Normal Keywords:
Cc: timograham@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Adding testing requirements will make it easier to run all Django's tests. A first draft version available here: https://github.com/akaariai/django/compare/add_test_requirements

I have commented out those packages which either do not have py3 support or which require compiling. We might want to add all packages uncommented and let testers comment them out if they can't install some of the packages.

The list is based on http://apolloner.eu/~apollo13/django/before_script.sh

As said, this is just first draft. Some packages might be missing. The requires compiling/no py3 support comments might be inaccurate, too.

Attachments (0)

Change History (19)

comment:1 Changed 18 months ago by aaugustin

  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 18 months ago by timo

  • Cc timograham@… added

Might be nice if we could refer to this in the contributing tutorial (#16779).

comment:3 Changed 14 months ago by carljm

Some other things that could be mentioned here include python-memcached/pylibmc (also requires configuration in settings.CACHES to run memcached tests) and coverage (if you want to generate test coverage data).

One way to handle the compiled/non and py2/py3 differences would be with multiple requirements files; requirements files can also include each other with a -r line, so we could provide a requirements/all.txt that includes everything. Of course the downside here is that if we split along more than one axis, the number of requirements files can get silly...

comment:4 Changed 14 months ago by carljm

Also, in the draft patch I don't quite understand "Note that in some cases installing a package will activate an alternate set of tests. These packages are: pytz, enter more here." I think every requirement in this file (except the database adapters) will automatically enable some additional (not alternate) tests in the test suite, so I'm not sure why pytz is specifically called out. And I can't find any tests that are _disabled_ by installing pytz, so I don't think the word "alternate" is correct.

comment:5 Changed 13 months ago by aaugustin

  • Component changed from Uncategorized to Documentation
  • Type changed from Uncategorized to New feature

comment:6 Changed 13 months ago by timo

  • Patch needs improvement set

comment:7 Changed 10 months ago by timo

We also need bcrypt instead of py-bcrypt for Django 1.6+ due to 8f0a4665d67868dce2e204dd592b0f133edf7943.

comment:8 Changed 10 months ago by timo

There's also the list that the djangocore-box uses below. I was going to send a pull request there to add bcrypt, but I thought it may be more productive to try to complete this ticket and that modify djangocore-box to use Django's included requirements. Any thoughts on how we can move forward with this?

https://github.com/jphalip/djangocore-box/tree/master/requirements

comment:9 Changed 10 months ago by timo

  • Patch needs improvement unset

Here's my proposal: https://github.com/timgraham/django/commit/ac14164267829091f2af705a42580da7dc3b8d80

Would this breakdown be sufficient for use on Jenkins? I can work on versions for 1.5/1.4 if this looks good.

I think we also need to add the requirements for GeoDjango -- probably makes sense to add it as a separate file?

Last edited 10 months ago by timo (previous) (diff)

comment:10 Changed 10 months ago by timo

feedback from apollo13 in IRC: I am not sure if it's worth to add requirements-database.txt -- or at least structure it under an requirements directory.

Using a directory makes sense to me. My thought regarding the individual database requirements files is that it would allow automated installation of selected databases in environments such as the djangocore-box, which doesn't have Oracle support as of now.

comment:11 Changed 9 months ago by timo

Updated in a pull request.

comment:12 Changed 9 months ago by loic84

  • Triage Stage changed from Accepted to Ready for checkin

Looks good to me; I've tried the various requirements files in a fresh virtualenv.

Optionally for GeoDjango we could have a paragraph in internals/contributing/writing-code/unit-tests.txt that links to https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/.

comment:13 Changed 9 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 4d92a0bd8630affbb6f289317f71d60607d26369:

Fixed #19196 -- Added test/requirements

comment:14 Changed 9 months ago by Tim Graham <timograham@…>

In aecbaaed0c1a0d7da99a8d3deb9328ad2b5c601d:

[1.6.x] Fixed #19196 -- Added test/requirements

Backport of 4d92a0bd86 from master.

comment:15 Changed 9 months ago by Tim Graham <timograham@…>

In 13546cae9c7922088266c32a5be2bda77545a04b:

[1.5.x] Fixed #19196 -- Added test/requirements

Backport of 4d92a0bd86 from master.

comment:16 Changed 9 months ago by Tim Graham <timograham@…>

In 77856dc875ca17cc86944e028e4c9a36b0b46dbe:

Added some missing test requirements in the docs; refs #19196

comment:17 Changed 9 months ago by Tim Graham <timograham@…>

In 2e3250fc90499b2977c39ca8af8d0c245c9bcd77:

[1.6.x] Added some missing test requirements in the docs; refs #19196

Backport of 77856dc875 from master

comment:18 Changed 9 months ago by Tim Graham <timograham@…>

In 14b50739787d9bb69e763894f78b10971fe2bc63:

[1.5.x] Added a missing test requirement in the docs; refs #19196

comment:19 Changed 9 months ago by Tim Graham <timograham@…>

In e8971345b4bf0e7ce2124d033ee3385919f47309:

[1.4.x] Fixed #19196 -- Added test/requirements

Backport of 4d92a0bd86 from master

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.