Re: [openstack-dev] [horizon] Support for Django 1.7: there's a bit of work, though it looks fixable to me...

2014-08-05 Thread Thomas Goirand
On 08/05/2014 04:06 PM, Julie Pichon wrote:
> On 05/08/14 08:11, Thomas Goirand wrote:
>> And there's also test_change_password_shows_message_on_login_page which
>> fails. Here's the end of the stack dump:
>>
>>   File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line
>> 375, in send
>> raise ConnectionError(e, request=request)
>> ConnectionError: HTTPConnectionPool(host='public.nova.example.com',
>> port=8774): Max retries exceeded with url: /v2/extensions (Caused by
>> : [Errno -2] Name or service not known)
> 
> This particular test is currently being skipped [1] due to issues with
> the test itself. It's going to be replaced by an integration test.
> 
> Julie
> 
> [1] https://review.openstack.org/#/c/101857/

Thanks Julie! I then disabled the tests in the Debian package too.

I'm now down to only a single error not solved:

==
FAIL: test_update_project_when_default_role_does_not_exist
(openstack_dashboard.dashboards.admin.projects.tests.UpdateProjectWorkflowTests)
--
Traceback (most recent call last):
  File
"/home/zigo/sources/openstack/icehouse/horizon/build-area/horizon-2014.1.1/openstack_dashboard/test/helpers.py",
line 83, in instance_stub_out
return fn(self, *args, **kwargs)
  File
"/home/zigo/sources/openstack/icehouse/horizon/build-area/horizon-2014.1.1/openstack_dashboard/dashboards/admin/projects/tests.py",
line 1458, in test_update_project_when_default_role_does_not_exist
self.client.get(url)
AssertionError: NotFound not raised

Any idea?

Cheers,

Thomas Goirand (zigo)


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [horizon] Support for Django 1.7: there's a bit of work, though it looks fixable to me...

2014-08-05 Thread Julie Pichon
On 05/08/14 08:11, Thomas Goirand wrote:
> And there's also test_change_password_shows_message_on_login_page which
> fails. Here's the end of the stack dump:
> 
>   File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line
> 375, in send
> raise ConnectionError(e, request=request)
> ConnectionError: HTTPConnectionPool(host='public.nova.example.com',
> port=8774): Max retries exceeded with url: /v2/extensions (Caused by
> : [Errno -2] Name or service not known)

This particular test is currently being skipped [1] due to issues with
the test itself. It's going to be replaced by an integration test.

Julie

[1] https://review.openstack.org/#/c/101857/


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [horizon] Support for Django 1.7: there's a bit of work, though it looks fixable to me...

2014-08-05 Thread Thomas Goirand
On 08/04/2014 05:05 PM, Romain Hardouin wrote:
> Hi,
> 
> Note that Django 1.7 requires Python 2.7 or above[1] while Juno still 
> requires to be compatible with Python 2.6 (Suse ES 11 uses 2.6 if my memory 
> serves me).
> 
> [1] https://docs.djangoproject.com/en/dev/releases/1.7/#python-compatibility
> 
> Best,
> 
> Romain

Hi,

I'm not asking for *switching* to Django 1.7, but just support it. :)

A bit of update here...

Here's the list of fixes that I propose, thanks to the awesome help of
Raphael Hertzog:

https://review.openstack.org/111561 <--- TEMPLATE_DIRS fix
https://review.openstack.org/111930 <--- Rename conflicting add_error()
https://review.openstack.org/111932 <--- Fix summation code
https://review.openstack.org/111934 <--- SecurityGroup type error
https://review.openstack.org/111936 <--- Fix _detail_overview.html

I know we're not supposed to ask the list for code review, but I'll do
it this time still! :)

I believe this one, which I reported previously, can be ignored:

> "/home/zigo/sources/openstack/icehouse/horizon/build-area/horizon-2014.1.1/horizon/test/helpers.py",
> line 184, in 
> class JasmineTests(SeleniumTestCase):
> TypeError: Error when calling the metaclass bases
> function() argument 1 must be code, not str

after cleaning my build env, it didn't do it again, so it must be fine.

Now, there's still this one which isn't fixed, and which Raphael and I
didn't understand yet how to fix:

FAIL: test_update_project_when_default_role_does_not_exist
(openstack_dashboard.dashboards.admin.projects.tests.UpdateProjectWorkflowTests)
--
Traceback (most recent call last):
  File
"/home/rhertzog/tmp/django17/horizon/openstack_dashboard/test/helpers.py",
line 83, in instance_stub_out
return fn(self, *args, **kwargs)
  File
"/home/rhertzog/tmp/django17/horizon/openstack_dashboard/dashboards/admin/projects/tests.py",
line 1458, in test_update_project_when_default_role_does_not_exist
self.client.get(url)
AssertionError: NotFound not raised

And there's also test_change_password_shows_message_on_login_page which
fails. Here's the end of the stack dump:

  File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line
375, in send
raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='public.nova.example.com',
port=8774): Max retries exceeded with url: /v2/extensions (Caused by
: [Errno -2] Name or service not known)

Help fixing the above 2 remaining unit test errors would be greatly
appreciated!

Cheers,

Thomas Goirand (zigo)


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [horizon] Support for Django 1.7: there's a bit of work, though it looks fixable to me...

2014-08-04 Thread Romain Hardouin
Hi,

Note that Django 1.7 requires Python 2.7 or above[1] while Juno still requires 
to be compatible with Python 2.6 (Suse ES 11 uses 2.6 if my memory serves me).

[1] https://docs.djangoproject.com/en/dev/releases/1.7/#python-compatibility

Best,

Romain


- Original Message -
From: "Thomas Goirand" 
To: "OpenStack Development Mailing List" 
Sent: Sunday, August 3, 2014 12:55:19 PM
Subject: [openstack-dev] [horizon] Support for Django 1.7: there's a bit of 
work, though it looks fixable to me...

Hi,

The Debian maintainer of Django would like to upload Django 1.7 before
Jessie is frozen on the 5th of November. As for OpenStack, I would like
Icehouse to be in Jessie, since it will be supported by major companies
(RedHat and Canonical both will use Icehouse as LTS, and will work on
security for a longer time than previously planned in the OpenStack
community).

Though Horizon Icehouse doesn't currently work with Django 1.7. The
first thing to fix would be the TEMPLATE_DIRS thing:

./run_tests.sh -N -P || true
Running Horizon application tests
Traceback (most recent call last):
  File
"/home/zigo/sources/openstack/icehouse/horizon/build-area/horizon-2014.1.1/manage.py",
line 25, in 
execute_from_command_line(sys.argv)
  File
"/usr/lib/python2.7/dist-packages/django/core/management/__init__.py",
line 385, in execute_from_command_line
utility.execute()
[... not useful stack dump ...]
  File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line
42, in _setup
self._wrapped = Settings(settings_module)
  File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line
110, in __init__
"Please fix your settings." % setting)
django.core.exceptions.ImproperlyConfigured: The TEMPLATE_DIRS setting
must be a tuple. Please fix your settings.
Running openstack_dashboard tests
WARNING:root:No local_settings file found.

Then of course, the rest of the tests are completely broken because
there's no local_settings. Adding a comma at the end of:

TEMPLATE_DIRS = (os.path.join(ROOT_PATH, 'tests', 'templates'))

in horizon/test/settings.py fixes the issue. Note that this works in
both Django 1.6 and 1.7. Some other TEMPLATE_DIRS declaration already
have the comma, so I guess it's fine to add it. Which is why I did this:
https://review.openstack.org/111561

FYI, there's this document that talks about it:
https://docs.djangoproject.com/en/1.7/releases/1.7/#backwards-incompatible-changes-in-1-7

Then, after fixing this, I get this error:
==
ERROR: Failure: TypeError (Error when calling the metaclass bases
function() argument 1 must be code, not str)
--
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 414, in
loadTestsFromName
addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 47, in
importFromPath
return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 94, in
importFromDir
mod = load_module(part_fqname, fh, filename, desc)
  File
"/home/zigo/sources/openstack/icehouse/horizon/build-area/horizon-2014.1.1/horizon/test/tests/tables.py",
line 28, in 
from horizon.test import helpers as test
  File
"/home/zigo/sources/openstack/icehouse/horizon/build-area/horizon-2014.1.1/horizon/test/helpers.py",
line 184, in 
class JasmineTests(SeleniumTestCase):
TypeError: Error when calling the metaclass bases
function() argument 1 must be code, not str

There's the same issue in the definition of SeleniumTestCase() in
openstack_dashboard/test/helpers.py (line 365 in Icehouse).

Since I don't really care about selenium (it can't be tested in Debian
because it's non-free), I commented out the class
JasmineTests(SeleniumTestCase), then I get more errors. A few instances
of this one:

  File
"/home/zigo/sources/openstack/icehouse/horizon/build-area/horizon-2014.1.1/horizon/tables/base.py",
line 206, in 
"average": lambda data: sum(data, 0.0) / len(data)
TypeError: unsupported operand type(s) for +: 'float' and 'str'

I'm not a Django expert, so I it'd be awesome to get help on this. Best
would be that:
1/ Support for Django 1.7 is added to Juno
2/ The changes are backported to Icehouse (even if this doesn't make it
into the stable branch because of "let's stay safe", I can add the
patches as Debian specific).

Thoughts from the Horizon team would be welcome.

Cheers,

Thomas Goirand (zigo)

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [horizon] Support for Django 1.7: there's a bit of work, though it looks fixable to me...

2014-08-03 Thread Thomas Goirand
Hi,

The Debian maintainer of Django would like to upload Django 1.7 before
Jessie is frozen on the 5th of November. As for OpenStack, I would like
Icehouse to be in Jessie, since it will be supported by major companies
(RedHat and Canonical both will use Icehouse as LTS, and will work on
security for a longer time than previously planned in the OpenStack
community).

Though Horizon Icehouse doesn't currently work with Django 1.7. The
first thing to fix would be the TEMPLATE_DIRS thing:

./run_tests.sh -N -P || true
Running Horizon application tests
Traceback (most recent call last):
  File
"/home/zigo/sources/openstack/icehouse/horizon/build-area/horizon-2014.1.1/manage.py",
line 25, in 
execute_from_command_line(sys.argv)
  File
"/usr/lib/python2.7/dist-packages/django/core/management/__init__.py",
line 385, in execute_from_command_line
utility.execute()
[... not useful stack dump ...]
  File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line
42, in _setup
self._wrapped = Settings(settings_module)
  File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line
110, in __init__
"Please fix your settings." % setting)
django.core.exceptions.ImproperlyConfigured: The TEMPLATE_DIRS setting
must be a tuple. Please fix your settings.
Running openstack_dashboard tests
WARNING:root:No local_settings file found.

Then of course, the rest of the tests are completely broken because
there's no local_settings. Adding a comma at the end of:

TEMPLATE_DIRS = (os.path.join(ROOT_PATH, 'tests', 'templates'))

in horizon/test/settings.py fixes the issue. Note that this works in
both Django 1.6 and 1.7. Some other TEMPLATE_DIRS declaration already
have the comma, so I guess it's fine to add it. Which is why I did this:
https://review.openstack.org/111561

FYI, there's this document that talks about it:
https://docs.djangoproject.com/en/1.7/releases/1.7/#backwards-incompatible-changes-in-1-7

Then, after fixing this, I get this error:
==
ERROR: Failure: TypeError (Error when calling the metaclass bases
function() argument 1 must be code, not str)
--
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 414, in
loadTestsFromName
addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 47, in
importFromPath
return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 94, in
importFromDir
mod = load_module(part_fqname, fh, filename, desc)
  File
"/home/zigo/sources/openstack/icehouse/horizon/build-area/horizon-2014.1.1/horizon/test/tests/tables.py",
line 28, in 
from horizon.test import helpers as test
  File
"/home/zigo/sources/openstack/icehouse/horizon/build-area/horizon-2014.1.1/horizon/test/helpers.py",
line 184, in 
class JasmineTests(SeleniumTestCase):
TypeError: Error when calling the metaclass bases
function() argument 1 must be code, not str

There's the same issue in the definition of SeleniumTestCase() in
openstack_dashboard/test/helpers.py (line 365 in Icehouse).

Since I don't really care about selenium (it can't be tested in Debian
because it's non-free), I commented out the class
JasmineTests(SeleniumTestCase), then I get more errors. A few instances
of this one:

  File
"/home/zigo/sources/openstack/icehouse/horizon/build-area/horizon-2014.1.1/horizon/tables/base.py",
line 206, in 
"average": lambda data: sum(data, 0.0) / len(data)
TypeError: unsupported operand type(s) for +: 'float' and 'str'

I'm not a Django expert, so I it'd be awesome to get help on this. Best
would be that:
1/ Support for Django 1.7 is added to Juno
2/ The changes are backported to Icehouse (even if this doesn't make it
into the stable branch because of "let's stay safe", I can add the
patches as Debian specific).

Thoughts from the Horizon team would be welcome.

Cheers,

Thomas Goirand (zigo)

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev