Actually, it sort of looks like the commands might have been running in what is effectively a virtualenv anyway. I am not sure I can comment properly on what is going on there.

I suspect that the source command fails because there is no binary associated with it. You might find that replacing

   system('source %(activate)s' % ENVIRONMENT)

with

   system('. %(activate)s' % ENVIRONMENT)

might work better, although I would not be certain that it has an effect that lasts into the commands that follow.

Given that things appear to pip install despite the source command failing, it looks like the ImportError exception should be taken at face value.. That trac is not actually installed. And closer at the output of the pip install command, it fails with:

   Cannot find command 'svn'

Before it can actually starts to install the packages. At the moment TracAccountManager, TracThemeEngine and TracPermRedirect are all specified to be pulled from the trac-hacks svn server. We would have to check if we can get appropriate versions elsewhere if we want to change this.

Cheers,
    Gary

On 07/12/2012 09:00 AM, Gary Martin wrote:
Hi,

I think that to run through virtualenv you would have to resort to the kind of 
trickery that I was using in the old installer.py but I am not convinced that 
is the best plan.

If you have a throw-away VM as your slave then you could ignore the virtualenv 
part and pip install to the system instead.

Cheers,
     Gary

Olemis Lang <[email protected]> wrote:

Hi !

I've been playing with Jenkins for a while . I created a job [1]_ .
Its execution is restricted to a slave running Ubuntu (i.e.
kumar-ubuntu node) , but that may change later e.g. to test it in a
windows slave . Build job has a single step executing a python script
[2]_ shown below

{{{
#!python

>from os import system
>from os.path import join, abspath
import sys

scripts_folder = 'Scripts' if sys.platform == 'win32' else 'bin'
vcs_root = '.'

folder_ws = abspath('.')
folder_installer = join(folder_ws, vcs_root, 'installer')

venv = join(folder_installer, 'bloodhound')
bin = join(venv, scripts_folder)
activate = join(bin, 'activate')
easy_install = join(bin, 'easy_install')
pip = join(bin, 'pip')
python = join(bin, 'python')

ENVIRONMENT = {
        'folder_ws' : folder_ws,
        'folder_installer' : folder_installer,
        'venv' : venv,
        'bin' : bin,
        'activate' : activate,
        'easy_install' : easy_install,
        'pip' : pip,
        'python' : python,
    }

system('wget http://peak.telecommunity.com/dist/virtual-python.py')
system('wget http://peak.telecommunity.com/dist/ez_setup.py')

#system('python2.6 ./virtual-python.py  --no-site-packages
--install-dir=%(venv)s' % ENVIRONMENT)
system('virtualenv --no-site-packages %(venv)s' % ENVIRONMENT)

system('%(python)s ./ez_setup.py' % ENVIRONMENT)
system('%(easy_install)s pip' % ENVIRONMENT)

system('cd %(folder_installer)s' % ENVIRONMENT)
if sys.platform != 'win32':
    system('source %(activate)s' % ENVIRONMENT)
system('%(pip)s install -r requirements-dev.txt' % ENVIRONMENT)
system('''%(python)s bloodhound_setup.py
            -d sqlite --database-string="sqlite:db/trac.db"
            --admin-password="testrun" --admin-user="bhadmin"
            --repository-type=svn --repository-path=
            ''' % ENVIRONMENT)

}}}

I've been trying to make it check out code from svn and execute the
installer in order to run tests (... or coverage , or ...) later, in
theory, using makefile . Nonetheless this is what I notice in console
output [3]_ regarding the installation process .

  - The command `source ./bloodhound/bin/activate` , mentioned in
    installation instructions , fails with message
    `sh: source: not found` ... so I guess we should have
    a more generic way to do this ? ... or fix the script ;)
  - Maybe that's the reason why I get this message immediately after ?

{{{
#!python

Traceback (most recent call last):
  File "bloodhound_setup.py", line 34, in <module>
    from trac.admin.console import TracAdmin
ImportError: No module named trac.admin.console
Post install setup requires that Bloodhound is properly installed
Traceback for error follows:
}}}

I look forward to your comments .

.. [1] Run Trac test suite in Apache(TM) Blodhound repository
        (http://hudson.testrun.org/job/bh-trac-test/)

.. [2] Configure bh-trac-test
        (http://hudson.testrun.org/job/bh-trac-test/configure)

.. [3] Build results (#11)
        (http://hudson.testrun.org/job/bh-trac-test/11/console)

--
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:


Reply via email to