--
Ticket URL: <https://code.djangoproject.com/ticket/25364>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => akki
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/25364#comment:1>
* has_patch: 0 => 1
Comment:
PR: https://github.com/django/django/pull/6099
--
Ticket URL: <https://code.djangoproject.com/ticket/25364#comment:2>
Comment (by timgraham):
Left comments for improvement on the pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/25364#comment:3>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/25364#comment:4>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/25364#comment:5>
* needs_better_patch: 0 => 1
Comment:
Multiple browsers aren't working on Python 3. Zero tests are run for
`--selenium=firefox,chrome`.
--
Ticket URL: <https://code.djangoproject.com/ticket/25364#comment:6>
Comment (by MoritzS):
I may be a bit late for this, but I see a problem with this approach.
Right now the selenium browser is started in `setUpClass()` and closed in
`tearDownClass()`. This means that the browser has to be started once for
every test class.
This new approach does a bit of Meta class and method copying hacking to
provide a new method `test_foo__browser` for all test functions and
browsers. But then a single test class has tests for ''different''
browsers. This means that the selenium browser started can't be started in
`setUpClass()` so the logic for starting it was moved to `setUp()`. That
however means that the browser is started and closed once for '''every'''
test case. If you consider that starting the browser can take up to a few
seconds (especially on the CI system), I'd say that solution is not
acceptable.
I can think of a solution that works by creating a new test class for each
browser in the meta class' `__new__()` method and then return a proxy
class containing those newly created classes that knows how to run the
tests on all of them.
--
Ticket URL: <https://code.djangoproject.com/ticket/25364#comment:7>
Comment (by timgraham):
Yes, I agree that would be better.
--
Ticket URL: <https://code.djangoproject.com/ticket/25364#comment:8>
* cc: moritz.sichert@… (added)
Comment:
I ran all selenium tests with firefox and chrome on my 4-core machine and
got the following numbers:
On master branch:
{{{
Ran 67 tests in 124.703s
}}}
On the PR:
{{{
Ran 68 tests in 173.816s
}}}
That's an increase of about 40% even on a powerful desktop machine.
--
Ticket URL: <https://code.djangoproject.com/ticket/25364#comment:9>
* cc: charettes (added)
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/25364#comment:10>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/25364#comment:11>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"44c0ecdd9226d039a8c666b36ae320af2046a1c1" 44c0ecdd]:
{{{
#!CommitTicketReference repository=""
revision="44c0ecdd9226d039a8c666b36ae320af2046a1c1"
Fixed #25364 -- Added generic way to test on all browsers supported by
selenium.
Browser names should be passed as a comma separated list to the --selenium
flag.
Thanks Tim Graham, Simon Charette and Moritz Sichert for review and
discussion.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25364#comment:12>