Merge lp:~didrocks/ubuntu-webcatalog/oneiric-support into lp:ubuntu-webcatalog

Proposed by Didier Roche-Tolomelli
Status: Merged
Merge reported by: Anthony Lenton
Merged at revision: not available
Proposed branch: lp:~didrocks/ubuntu-webcatalog/oneiric-support
Merge into: lp:ubuntu-webcatalog
Diff against target: 52 lines (+25/-8)
1 file modified
fabtasks/bootstrap.py (+25/-8)
To merge this branch: bzr merge lp:~didrocks/ubuntu-webcatalog/oneiric-support
Reviewer Review Type Date Requested Status
Canonical ISD hackers Pending
Review via email: mp+66945@code.launchpad.net

Description of the change

Support for oneiric.

Didn't make yet a more generic solution to avoir duplication between natty and oneiric as other files are subject to move as well

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Hi didrocks!

I was away when you proposed this - sorry it took a while to get some feedback.

It's really unfortunate that you had to fiddle with symlinks to set up a dev environment - it shouldn't be the case.

AFAICS, it's only necessary because we're testing the SVG->PNG rendering and that functionality is dependent on installed libs that we can't just put in the python virtualenv. We don't *need* this functionality in a dev server necessarily.

I wonder if a better solution would be to ensure that it is only a single test that requires the library (the code that does the actual rendering is already isolated to a single method, and we can mock that method in any other test), but automatically detect if the required svg->png method is available, and if not, skip the test with a warning or provide a config option to disable the test. That would mean that the test would be run by default (ie. on our jenkins server where the libs are installed - or can be) but the test can be disabled with a local config option (skip_gtk_render_tests or whatever). I don't like conditional tests either, but I'd prefer that than the solution we've currently got (which you've had to fiddle with to get tests running on oneiric).

What do you think? I'll chat with Anthony and see what he thinks too.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Hey Michael,
no worry on the time taken and I'm aware that platform has this kind of issue (same with launchpad sometimes) as the dev platform isn't supported yet. :)

I think you're right about your approach, seems way better to fiddle that on the test level that with all those symlinks (/!\ my django integration understanding level is pretty low, first time I touch to it).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'fabtasks/bootstrap.py'
2--- fabtasks/bootstrap.py 2011-07-05 16:09:31 +0000
3+++ fabtasks/bootstrap.py 2011-07-05 18:07:21 +0000
4@@ -59,23 +59,40 @@
5 (minor, basename))
6
7 _symlink_libs([
8- '/usr/lib/pymodules/python2.%s/gtk-2.0' % minor,
9 '/usr/lib/pymodules/python2.%s/cairo' % minor,
10 ])
11 pth_file_prenatty = '/usr/lib/pymodules/python2.%s/pygtk.pth' % minor
12 pth_file_natty = '/usr/share/pyshared/pygtk.pth'
13+ pth_file_preoneiric = '/usr/lib/pymodules/python2.%s/gtk-2.0' % minor
14+ pth_file_oneiric = '/usr/lib/python2.%s/dist-packages/gtk-2.0' % minor
15+
16 if os.path.exists(pth_file_prenatty):
17 _symlink_libs([
18 pth_file_prenatty,
19+ pth_file_preoneiric,
20 '/usr/lib/pymodules/python2.%s/pygtk.py' % minor,
21 ])
22- elif os.path.exists(pth_file_natty):
23- _symlink_libs([
24- pth_file_natty,
25- '/usr/lib/pymodules/python2.%s/cairo' % minor,
26- '/usr/lib/python2.%s/dist-packages/glib' % minor,
27- '/usr/lib/python2.%s/dist-packages/gobject' % minor,
28- '/usr/lib/python2.%s/dist-packages/gtk-2.0' % minor,
29+ elif os.path.exists(pth_file_natty) and not os.path.exists(pth_file_oneiric):
30+ _symlink_libs([
31+ pth_file_natty,
32+ pth_file_preoneiric,
33+ '/usr/lib/pymodules/python2.%s/cairo' % minor,
34+ '/usr/lib/python2.%s/dist-packages/glib' % minor,
35+ '/usr/lib/python2.%s/dist-packages/gobject' % minor,
36+ '/usr/lib/python2.%s/dist-packages/gtk-2.0-pysupport-compat.pth'
37+ % minor,
38+ '/usr/share/pyshared/pygtk.py',
39+ '/usr/lib/python2.%s/dist-packages/gtk-2.0/gio' % minor,
40+ '/usr/lib/python2.%s/dist-packages/gtk-2.0/LaunchpadIntegration'
41+ % minor,
42+ ])
43+ elif os.path.exists(pth_file_oneiric):
44+ _symlink_libs([
45+ pth_file_natty,
46+ pth_file_oneiric,
47+ '/usr/lib/pymodules/python2.%s/cairo' % minor,
48+ '/usr/lib/python2.%s/dist-packages/glib' % minor,
49+ '/usr/lib/python2.%s/dist-packages/gobject' % minor,
50 '/usr/lib/python2.%s/dist-packages/gtk-2.0-pysupport-compat.pth'
51 % minor,
52 '/usr/share/pyshared/pygtk.py',

Subscribers

People subscribed via source and target branches