Personal tools

buildout

Mar 11, 2013

E' uscito il Buildout 2.0! Posso rilanciare il mio buildout?

Scegli la tua soluzione

E' uscito il Buildout 2.0! Posso rilanciare il mio buildout?

Filed Under:

Viene rilasciata una nuova versione di un pacchetto, e per molti Plonisiti è il caos. Vediamo come usare (o non usare) il Buildout 2.0

Non è molto che è uscita la versione 2.0 di zc.buildout e, come spesso accade, i buildout, soprattutto quelli un po’ più vecchi, non prendono di buon grado l’aggiornamento.
Nel caso di questo pacchetto, le cause sono alcuni import che sono cambiati o sono stati spostati.

Il Buildout 2.0 fa un taglio netto con il passato che, con le versioni 1.6 e 1.7, aveva come obiettivo principale quello di isolare il più possibile il buildout dalla componente Python. Ma il compito si è rivelato troppo difficile da implementare, e quindi si è scelto di abbandonare questa strada e lasciare all’utilizzatore di decidere tramite l'utilizzo di virtualenv.

Non è però in questo articolo che voglio analizzare le modifiche apportate a questo componente (che potete comunque trovare qui). Oggi vediamo cosa fare per far funzionare i nostri bulidout.

read more

Feb 08, 2013

Come gestire e distribuire i vostri prodotti Plone?

Gestire il proprio codice in... relax!

Come gestire e distribuire i vostri prodotti Plone?

Un'esplorazione di tutti i (bizzarri) metodi con cui ho visto gestire il codice Plone (ma non solo), alla ricerca di una soluzione per ogni problema

Come gestire e distribuire i vostri prodotti Plone?

Sarà perché nella mia esperienza ho affrontato vari corsi di formazione per sviluppatori Plone, sarà perché non tutto il codice è sempre pronto per essere rilasciato, una cosa è certa: il rapporto tra il neofita e il codice da lui sviluppato è piuttosto combattuto.

Partiamo con una carrellata di quello che potete fare (ma in gran parte non dovete) fino ad arrivare alla soluzione dei casi più delicati.

read more

Jan 17, 2013

Break free from forefront TMG proxy

Can Loca ride?

Break free from forefront TMG proxy

Filed Under:

I was asked to install and configure a debian server to run a Plone site behind Microsoft Forefront TMG. Mission impossible? No... just a story to tell!

It was a dark and stormy night, me and the server, Loca, left all alone in a chilly room.

To let a linux server connect with Forefront I wanted to set up and run cntlm, which is a local proxy that authenticates to a Forefront gateway to allow internet traffic.

read more

Mar 13, 2012

Fix funkload report generation problems by upgrading gnuplot

Filed Under:

If your funkload tests are succesful, but you get the error "Report generation failed for ..." check your gnuplot version. Older versions are in conflict with our benchmarking tool. This is my way to fix the problem

After running funkload tests [1] on CentOS 5.7 I ran into a problem: I was not able to generate the reports.

Digging into the funkload internals, I realized that the problem was related to a syntax error raised by gnuplot, that was silently swallowed by the report generator command.

The funkload generated plot commands were in conflict with the gnuplot version installed by default on the system (4.0 patchlevel 0, a very old one!).

On my shiny kubuntu I had no problems with gnuplot version 4.4.4, so I solved this problem by adding an updated gnuplot version to my buildout.

Here is how I made it work:

[buildout]
extends = base.cfg
parts+= 
    gnuplot
   
[gnuplot]
recipe = zc.recipe.cmmi
url = http://sourceforge.net/projects/gnuplot/files/gnuplot/4.4.4/gnuplot-4.4.4.tar.gz/download 
configure-options =
    --bindir=${buildout:directory}/bin

 

For this trick to work properly, the bin directory inside the buildout folder should be in your PATH environment variable. If you are using virtualenv properly, you will probably stumble upon this.

[1] Version 1.11.0, the one that, to my knowledge, works best with collective.recipe.funkload as of version 0.3.1

May 04, 2010

New collective.funkload releases

I have recently released a new version of collective.funkload and collective.recipe.funkload. There is one major improvment - funkload recorder is now working properly with collective.funkload scripts.

Here @RedTurtle we are heavily using funkload for acceptance and benchmarking tests. We have started using it in 2008 just after Bristol Performance Sprint. We have found even more useful with buildout recipe. The only missing part was the recorder. It's built-in Funkload itself, but it was not enabled in the recipe. Well - now it is ;-)

/ If you want to know how to include funkload in buildout project - check my previous blog /

Starting a recorder is quite easy:

$ ./bin/funkload record -p 8080 MyTest


for full usage call:

$ ./bin/funkload record --help


This will start proxy on 8080 port and save all your browser requests to MyTest funkload scenario. Now open your browser, change proxy configuration to localhost:8080 and click-through test case. When you finish - stop the proxy with Ctrl-C. Funkload will generate a test_MyTest.py file and notify you where you can find it. It should be now collective.funkload compatible - you can lunch:

$ ./bin/funkload test /path/to/test_MyTest.py


To test it.

Another small improvement is a PloneFLTestCase. It extends default funkload test case, implementing two additional methods helping with Plone content creation. Right now instead of using this approach:

folder_portal_factory = self._browse(server_url + "/coreloadtests/Members/" + self.user_id +"/createObject?type_name=Folder",
                                             method='get', 
                                             follow_redirect=False,
                                             description = 'Get folder portal factory')

folder_edit_url = folder_portal_factory.headers.get('Location')        
folder_id = folder_edit_url.split('/')[-2]

folder_created = self.post(folder_edit_url, params=[
    ['id', folder_id],
    ['title', 'folder'],
    ['description', ''],
    ['description_text_format', 'text/plain'],
    ['subject_existing_keywords:default:list', ''],
    ['last_referer', 'http://localhost:8080/coreloadtests/Members/' + self.user_id + '/view'],
    ['form_submit', 'Save']],
    description="Post /coreloadtests/Members/user...280843853/atct_edit")

new_folder_id = folder_created.url.split('/')[-2]

 

you can just do:

new_folder_id = self.addContent(
        server_url, 
        portal_type='Folder', 
        params=[['id', 'id'],
                ['title', 'testing title'],
                ['description', 'testing description'],
                ['description_text_format', 'text/plain'],
                ['form.submitted', '1'],
                ['last_referer', ''],
                ['form_submit', 'Save']], 
        description='Create folder')

 

It doesn't do much, but for sure it helps you keep you test case readable.