django / django-box

VM to run the Django test suite. ARCHIVED Please use https://github.com/django/django-docker-box
BSD 3-Clause "New" or "Revised" License
67 stars 22 forks source link

Tests don't work on 1.9.x branch it's still officially supported #23

Closed olivierdalang closed 7 years ago

olivierdalang commented 7 years ago

Hi !

Thanks to your help, I'm currently able to test my patches for django master.

However, I can't make the tests work properly for the 1.9.x branch (probably the same for older versions). I think while we're at providing a box to make testing easy, it should support not only the master branch, but all supported releases. I guess any work about bug fixing (where the fix has to be backported) has to be tested on all the supported versions as well, and any work on new features that the dev wants to roll out to his current projects has also to be tested on the current project's versions.

My naive approach was to checkout 1.9.x, and do runtests35-sqlite. Here are the problems: `

First problem :

1.9.x has no tox.ini file.

Solution

This is easily solved by copying master's tox.ini file.

Second problem :

The runtestsXX-yyyy aliases use the --selenium=firefox argument which doesn't work with 1.9.x's tests (where --selenium must be used).

Solution

Activate the virtualenv manually (if it has been created by tox previously when we used the runtestsXX-yyyy alias) : source /django/.tox/py35/bin/activate And run the tests manually : python /django/tests/runtests.py --selenium

Third problem

I get some failing tests (while there shouldn't be, as it's the release branch I was testing). With this command python /django/tests/runtests.py admin_inlines --selenium, the selenium tests still skip. I'm not really sure what's happening, but it seems it doesn't find the executables for chrome, firefox and IE. Verbose output gives

Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x7f9c9859b828>>
Traceback (most recent call last):
  File "/django/.tox/py35/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 173, in __del__
    self.stop()
  File "/django/.tox/py35/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 145, in stop
    if self.process is None:
AttributeError: 'Service' object has no attribute 'process'
skipped 'Selenium webdriver "selenium.webdriver.firefox.webdriver.WebDriver" not installed or not operational: Message: \'geckodriver\' executable needs to be in PATH. \n'
Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.ie.service.Service object at 0x7f9c9859b080>>
Traceback (most recent call last):
  File "/django/.tox/py35/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 173, in __del__
    self.stop()
  File "/django/.tox/py35/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 145, in stop
    if self.process is None:
AttributeError: 'Service' object has no attribute 'process'
skipped 'Selenium webdriver "selenium.webdriver.ie.webdriver.WebDriver" not installed or not operational: Message: \'IEDriverServer.exe\' executable needs to be in PATH. Please download from http://selenium-release.storage.googleapis.com/index.html and read up at https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver\n'

This one I didn't know how to fix.

Thanks !

timgraham commented 7 years ago

This box isn't supporting older versions of Django and I don't think it's worthwhile at this point. Only data loss fixes and security issues are backported at this point and those can be tested with Jenkins.

jarshwah commented 7 years ago

@olivierdalang I get your point, but getting all dependencies and versions of software installed for multiple versions of Django is a fairly big task. I agree that in an ideal world, this image would support all supported Django versions.

Moving forward, testing an older version of Django will involve specifying the version of django-box that corresponds to the version of Django in your VagrantFile. That's why I specifically started versioning at 1.11. Each box release will be tied to a specific MAJOR.MINOR release of Django.