django / django-box Goto Github PK
View Code? Open in Web Editor NEWVM to run the Django test suite. ARCHIVED Please use https://github.com/django/django-docker-box
License: BSD 3-Clause "New" or "Revised" License
VM to run the Django test suite. ARCHIVED Please use https://github.com/django/django-docker-box
License: BSD 3-Clause "New" or "Revised" License
Using b9eb4f0 of this repo (latest master at time of posting), I get:
[~/src/django-box]$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'django-box-1.11' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly...
==> default: Adding box 'django-box-1.11' (v0) for provider: virtualbox
default: Downloading: django-box-1.11
default:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Couldn't open file /C:/Users/Ed/src/django-box/django-box-1.11
==> default: VM not created. Moving on...
This occurs even if I uncomment the box_url
pref in Vagrantfile
.
It's worth noting that since a box URL isn't set, Vagrant will only look on https://atlas.hashicorp.com/boxes/search - where the box doesn't exist.
This isn't high on my to-do list because it's not exactly easy, especially on debian based systems. There's also non-trivial licensing concerns with the various libraries needed from oracle that require click through license acceptance.
After going through the setup process as documented on an Ubuntu 16.04 host, the vagrant up command ends with a non zero exit status with:
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o vers=3,udp 1.2.3.1:/home/wayne/Documents/Programming/git/django /django
Stdout from the command:
Stderr from the command:
mount.nfs: access denied by server while mounting 1.2.3.1:/home/wayne/Documents/Programming/git/django
As discussed at hashicorp/vagrant#5424, this issue appears to be an issue with NFS being unable to share a folder that is part of an encrypted (ecryptfs) volume. In my case /home/wayne is an ecryptfs volume
Due to the failure of the NFS share, /django in the test box is empty and therefore no tests can be run
Hello,
i need to create a mysql database but I didn't put a root password (the install did not ask). now when i do mysql -u root -p where can i find this paswword.
Thanks
The README is outdated after 94e157c.
As of 500668c the ansible provisioner will now rely on tox from /django
to provide virtualenvironments and requirements files for each environment. In an effort to avoid repetition I've generated each alias using nested variables:
django-box/roles/python/tasks/main.yml
Line 62 in 500668c
The problem with this is that it's extremely brittle, particularly the replace()
filter that removes -sqlite3
from the tox environment name if it exists. This is currently necessary because the py{2,3}
environments are natively sqlite anyway. The tox file hasn't been designed with this vagrant image in mind.
I've tried to match up the database names with the aliases and settings module names with as little processing required. I don't think we can just reuse the sqlite
name, because those settings already exist within the test/
directory. Perhaps the explicit PYTHONPATH will take precedence though?
Current runtest aliases are inconsistent with jenkins CI configuration matrix.
Current:
runtests35-sqlite3
runtests35-sqlite3-gis
runtests35-mysql
runtests35-mysql-gis
runtests35-postgres
runtests35-postgres-gis
Change to:
runtests35-sqlite3
runtests35-spatialite
runtests35-mysql
runtests35-mysql_gis
runtests35-postgres
runtests35-postgis
From #26 (comment)
A tox.ini
is now available in Django 1.11 (master), and includes environments for running flake
, isort
spelling
and docs
tasks. If we're already going to be using tox for these things, then it probably makes sense to use it for running the regular test suite.
--selenium
to the regular test envcd
into /django
Rather than copying the content of all the requirements from /django/tests/requirements* locally, we can just refer directly to them via the nfs share. It has the added benefit of possibly being able to build new boxes by simply changing the version of django linked.
The jenkins ansible scripts include the provisioning of the firefox driver. It should be a straight forward copy into this setup.
When running time runtests35-sqlite3
one test fails, and this is the output:
FAIL: test_makemessages_no_settings (i18n.test_extraction.NoSettingsExtractionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.5/unittest/case.py", line 58, in testPartExecutor
yield
File "/usr/lib/python3.5/unittest/case.py", line 600, in run
testMethod()
File "/django/tests/i18n/test_extraction.py", line 723, in test_makemessages_no_settings
self.assertNoOutput(err)
File "/django/tests/admin_scripts/tests.py", line 203, in assertNoOutput
self.assertEqual(len(stream), 0, "Stream should be empty: actually contains '%s'" % stream)
File "/usr/lib/python3.5/unittest/case.py", line 820, in assertEqual
assertion_func(first, second, msg=msg)
File "/usr/lib/python3.5/unittest/case.py", line 813, in _baseAssertEqual
raise self.failureException(msg)
AssertionError: 96 != 0 : Stream should be empty: actually contains 'CommandError: Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed.
As it reported gettext being missing I tried installing it, to no avail:
apt-cache policy get text
N: Unable to locate package get text
Adding the optional repo in /etc/apt/sources.list and doing an update fixes it:
sudo vi /etc/apt/sources.list
sudo apt-get update
sudo apt-get install gettext
The tox.ini provides a javascript
environment, but the test environment relies on an old version of NPM: https://code.djangoproject.com/ticket/25803
This should probably be fixed upstream in some way. The grunt qunit test runner looks abandoned, so it might be necessary to look into something else. Once that is done, we can properly alias a command to run the javascript tests, just as we've done for docs/isort/flake8.
Selenium tests currently do not work.
Run with the command runtests27-sqlite3 admin_widgets --selenium chrome
or directly from the django test directory with ./runtests.py admin_widgets --selenium chrome
they fail with one of these errors:
======================================================================
ERROR: test_many_to_many (admin_widgets.tests.AdminRawIdWidgetSeleniumTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.5/unittest/suite.py", line 163, in _handleClassSetUp
setUpClass()
File "/django/django/test/selenium.py", line 64, in setUpClass
cls.selenium = cls.create_webdriver()
File "/django/django/test/selenium.py", line 55, in create_webdriver
return self.import_webdriver(self.browser)()
File "/home/vagrant/venv/lib/python3.5/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
desired_capabilities=desired_capabilities)
File "/home/vagrant/venv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 92, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/home/vagrant/venv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 179, in start_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "/home/vagrant/venv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "/home/vagrant/venv/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"7814.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2840.90)
(Driver info: chromedriver=2.22.397932 (282ed7cf89cf0053b6542e0d0f039d4123bbb6ad),platform=Linux 4.4.0-38-generic x86_64)
or
======================================================================
ERROR: test_date_time_picker_shortcuts (admin_widgets.tests.DateTimePickerAltTimezoneSeleniumTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.5/unittest/suite.py", line 163, in _handleClassSetUp
setUpClass()
File "/django/django/test/selenium.py", line 64, in setUpClass
cls.selenium = cls.create_webdriver()
File "/django/django/test/selenium.py", line 55, in create_webdriver
return self.import_webdriver(self.browser)()
File "/home/vagrant/venv/lib/python3.5/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
desired_capabilities=desired_capabilities)
File "/home/vagrant/venv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 92, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/home/vagrant/venv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 179, in start_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "/home/vagrant/venv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 234, in execute
response = self.command_executor.execute(driver_command, params)
File "/home/vagrant/venv/lib/python3.5/site-packages/selenium/webdriver/remote/remote_connection.py", line 407, in execute
return self._request(command_info[0], url, body=data)
File "/home/vagrant/venv/lib/python3.5/site-packages/selenium/webdriver/remote/remote_connection.py", line 439, in _request
resp = self._conn.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1197, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
or
======================================================================
ERROR: test_refresh_page (admin_widgets.tests.HorizontalVerticalFilterSeleniumTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/suite.py", line 146, in _handleClassSetUp
setUpClass()
File "/django/django/test/selenium.py", line 64, in setUpClass
cls.selenium = cls.create_webdriver()
File "/django/django/test/selenium.py", line 55, in create_webdriver
return self.import_webdriver(self.browser)()
File "/django/.tox/py27/local/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
desired_capabilities=desired_capabilities)
File "/django/.tox/py27/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 92, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/django/.tox/py27/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 179, in start_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "/django/.tox/py27/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 234, in execute
response = self.command_executor.execute(driver_command, params)
File "/django/.tox/py27/local/lib/python2.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 407, in execute
return self._request(command_info[0], url, body=data)
File "/django/.tox/py27/local/lib/python2.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 439, in _request
resp = self._conn.getresponse()
File "/usr/lib/python2.7/httplib.py", line 1136, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 453, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/httplib.py", line 417, in _read_status
raise BadStatusLine(line)
BadStatusLine: ''
I will continue investigating this problem.
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:
`
1.9.x has no tox.ini file.
This is easily solved by copying master's tox.ini file.
The runtestsXX-yyyy aliases use the --selenium=firefox
argument which doesn't work with 1.9.x's tests (where --selenium
must be used).
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
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 !
I tried to run this on ubuntu 16.04 with the default versions of vagrant (1.8.1+dfsg-1) and virtualbox (5.0.24-dfsg-0ubuntu1.16.04.1) and got this error when I ran vagrant up
:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'djangoproject/django-box-1.11'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'djangoproject/django-box-1.11' is up to date...
==> default: Setting the name of the VM: django-box_default_1473795778940_68676
==> default: Pruning invalid NFS exports. Administrator privileges will be required...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/ifdown eth1 2> /dev/null
Stdout from the command:
Stderr from the command:
mesg: ttyname failed: Inappropriate ioctl for device
This appears to be related to a vagrant bug, which suggests I should upgrade to the latest version of vagrant (1.8.5). This gets further, but still fails with a similar error:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'djangoproject/django-box-1.11' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
● nfs-server.service - NFS server and services
Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
Active: active (exited) since Tue 2016-09-13 20:38:51 BST; 13min ago
Main PID: 2903 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/nfs-server.service
Sep 13 20:38:51 quartic-XPS13-9333 systemd[1]: Starting NFS server and services...
Sep 13 20:38:51 quartic-XPS13-9333 exportfs[2899]: exportfs: Failed to stat /home/quartic/dev/django: No such file or directory
Sep 13 20:38:51 quartic-XPS13-9333 systemd[1]: Started NFS server and services.
exportfs: /home/quartic/dev/django does not support NFS export
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
set -e
mkdir -p /django
mount -o vers=3,udp 1.2.3.1:/home/quartic/dev/django /django
if command -v /sbin/init && /sbin/init --version | grep upstart; then
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/django
fi
Stdout from the command:
Stderr from the command:
mesg: ttyname failed: Inappropriate ioctl for device
mount.nfs: access denied by server while mounting 1.2.3.1:/home/quartic/dev/django
I finally tried to use the latest version of virtualbox (5.1.6-110634Ubuntuxenial amd64), but this also failed:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'djangoproject/django-box-1.11' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 5.0.20
default: VirtualBox Version: 5.1
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
● nfs-server.service - NFS server and services
Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
Active: active (exited) since Tue 2016-09-13 20:38:51 BST; 19min ago
Main PID: 2903 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/nfs-server.service
Sep 13 20:38:51 quartic-XPS13-9333 systemd[1]: Starting NFS server and services...
Sep 13 20:38:51 quartic-XPS13-9333 exportfs[2899]: exportfs: Failed to stat /home/quartic/dev/django: No such file or directory
Sep 13 20:38:51 quartic-XPS13-9333 systemd[1]: Started NFS server and services.
exportfs: /home/quartic/dev/django does not support NFS export
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
set -e
mkdir -p /django
mount -o vers=3,udp 1.2.3.1:/home/quartic/dev/django /django
if command -v /sbin/init && /sbin/init --version | grep upstart; then
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/django
fi
Stdout from the command:
Stderr from the command:
mesg: ttyname failed: Inappropriate ioctl for device
mount.nfs: access denied by server while mounting 1.2.3.1:/home/quartic/dev/django
Using b7765b6 I hit the same problem as #12 and am trying to build a box using
VAGRANT_VAGRANTFILE=Vagrantfile-build vagrant up
Everything goes well all the way through ansible provisioning, but I then get:
PLAY RECAP *********************************************************************
default : ok=56 changed=51 unreachable=0 failed=0
==> default: Running provisioner: shell...
default: Running: inline script
==> default: mesg: ttyname failed: Inappropriate ioctl for device
==> default: Reading package lists...
==> default: Building dependency tree...
==> default: Reading state information...
==> default: W
==> default: :
==> default: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/dl_google_com_linux_chrome_deb.list:1 and /etc/apt/sources.list.d/google-chrome.list:3
==> default: W
==> default: :
==> default: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/dl_google_com_linux_chrome_deb.list:1 and /etc/apt/sources.list.d/google-chrome.list:3
==> default: W
==> default: :
==> default: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/dl_google_com_linux_chrome_deb.list:1 and /etc/apt/sources.list.d/google-chrome.list:3
==> default: W
==> default: :
==> default: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/dl_google_com_linux_chrome_deb.list:1 and /etc/apt/sources.list.d/google-chrome.list:3
==> default: W
==> default: :
==> default: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list.d/dl_google_com_linux_chrome_deb.list:1 and /etc/apt/sources.list.d/google-chrome.list:3
==> default: 35165107+0 records in
==> default: 35165107+0 records out
==> default: 36009069568 bytes (36 GB, 34 GiB) copied, 93.241 s, 386 MB/s
==> default: 404196+0 records in
==> default: 404196+0 records out
==> default: 413896704 bytes (414 MB, 395 MiB) copied, 1.48731 s, 278 MB/s
==> default: dd:
==> default: writing to '/dev/dm-1'
==> default: : No space left on device
==> default: 1048577+0 records in
==> default: 1048576+0 records out
==> default: 536870912 bytes (537 MB, 512 MiB) copied, 14.2287 s, 37.7 MB/s
==> default: Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
==> default: no label, UUID=393fe33a-8094-49f4-8f28-e69ff6ff9a93
This is using Vagrant 1.8.5 and VirtualBox 5.1.4 on OS X 10.11.6.
My django repo is checked out at 14879ac.
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'djangoproject/django-box-2.0' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'djangoproject/django-box-2.0'
default: URL: https://vagrantcloud.com/djangoproject/django-box-2.0
==> default: Adding box 'djangoproject/django-box-2.0' (v2.0.0) for provider: virtualbox
default: Downloading: https://vagrantcloud.com/djangoproject/boxes/django-box-2.0/versions/2.0.0/providers/virtualbox.box
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104
vagrant@djangobox:~$ runtests36-mysql
Traceback (most recent call last):
File "/usr/local/bin/tox", line 11, in
sys.exit(cmdline())
File "/usr/local/lib/python3.5/dist-packages/tox/session.py", line 38, in main
config = prepare(args)
File "/usr/local/lib/python3.5/dist-packages/tox/session.py", line 26, in prepare
config = parseconfig(args)
File "/usr/local/lib/python3.5/dist-packages/tox/config.py", line 229, in parseconfig
parseini(config, inipath)
File "/usr/local/lib/python3.5/dist-packages/tox/config.py", line 644, in init
self._cfg = py.iniconfig.IniConfig(config.toxinipath)
File "/usr/local/lib/python3.5/dist-packages/py/_iniconfig.py", line 50, in init
f = open(self.path)
FileNotFoundError: [Errno 2] No such file or directory: '/django/tox.ini'
Hi,
Following the README.md, I was able to setup the vagrant VM, but the test commands don't work.
I downloaded the box manually from https://www.djangoproject.com/m/vms/djangocore-box-1.1.box (I have an unstable and slow connection, and stupidly, atlas.hashicorp doesn't support resuming downloads). I run Windows 10 64 bits, Virtualbox 5.0.20.
Disclaimer : I never used vagrant boxes before, so maybe I missed an implicit step.
~$ runtests2.7-mysql
fails with
Please install test dependencies first:
$ pip install -r requirements/py2.txt
Then
~$ pip install -r /django/tests/requirements/py2.txt
fails with
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 139, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 240, in run
for req in parse_requirements(filename, finder=finder, options=options):
File "/usr/local/lib/python2.7/dist-packages/pip/req.py", line 1314, in parse_requirements
for item in parse_requirements(req_url, finder, comes_from=filename, options=options):
File "/usr/local/lib/python2.7/dist-packages/pip/req.py", line 1356, in parse_requirements
req = InstallRequirement.from_line(line, comes_from)
File "/usr/local/lib/python2.7/dist-packages/pip/req.py", line 118, in from_line
return cls(req, comes_from, url=url)
File "/usr/local/lib/python2.7/dist-packages/pip/req.py", line 43, in __init__
req = pkg_resources.Requirement.parse(req)
File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.35-py2.7.egg/pkg_resources.py", line 2680, in parse
reqs = list(parse_requirements(s))
File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.35-py2.7.egg/pkg_resources.py", line 2605, in parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.35-py2.7.egg/pkg_resources.py", line 2573, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', "pylibmc; sys.platform != 'win32'", 'at', "; sys.platform != 'win32'")
Python3.3 tests have another problem :
~$ runtests3.3-mysql
fails with
Traceback (most recent call last):
File "/django/tests/runtests.py", line 13, in <module>
from django.apps import apps
File "/django/django/apps/__init__.py", line 1, in <module>
from .config import AppConfig
File "/django/django/apps/config.py", line 6, in <module>
from django.utils.module_loading import module_has_submodule
File "/django/django/utils/module_loading.py", line 67, in <module>
from importlib.util import find_spec as importlib_find
ImportError: cannot import name find_spec
https://app.vagrantup.com/bento/boxes/ubuntu-16.04/versions/201801.02.0
Hoping that this version has mitigations for recently documented vulnerabilities. If not, look for the next version that does.
During pycon AU we had several issues getting django box running on Linux. Let's document common issues with Linux and their resolution steps.
I recently had to commit some code to django and needed to make sure to run and test django.
I created this: https://gist.github.com/kingbuzzman/3784b49bffa4f14b2b08575541ed7a1e
I wonder if anyone is interested in it.
django
directory to where you run it from.If you find any issues with it, i'm all ears.
Hi,
It's great to have django-box, as it makes it easy to run test for new contributors. This only thing I find missing is a bit more guidance aimed at beginners. Some of it is covered on https://docs.djangoproject.com/en/1.10/topics/testing/overview/ but it doesn't seem to fully match with what's possible in django-box with the runtestsXX-xxx
shortcuts.
runtests35-mysql admin_views
(runtests35-mysql admin_views.UserAdminTest
or runtests35-mysql admin_views.UserAdminTest.test_user_fk_change_popup
don't seem to work though), but this still takes more than 2 minutes to setup, making code/test iterations quite slow. Is it possible to avoid deletion/recreation of the database each time (which seem to be the most time-consuming task) ?runtestsXX-xxxx
goes to the console, but not to the .tox directory, so that it's hard to get a clean overview of what happened.Thanks a lot for the box already, I think it's a big step towards getting more and better contributions to django ! (at least for me)
To reduce the size of the virtual machine, I'd like to include a build step which does some cleanup.
Others?
==> default: Configuring and enabling network interfaces...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
Password:
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o vers=3,udp 1.2.3.1:/Users/user/Documents/code/django-core/django /django
Stdout from the command:
Stderr from the command:
mount.nfs: Connection timed out
I tried the commands:
"vagrant destroy && sudo vagrant up"
to no avail.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.