So I was trying to do something like this, and I created this bash script 
which locally works perfectly fine.

However it doesn't seem to work at all with the error pasted below.
Is Jenkins able to run any bash script?
It seems like it should be I'm not sure why it gives this error though..

#!/bin/bash
SPOTLIGHT_PID="not"
API_PID="not"

function create_ve {
    if [ ! -d ve ]
    then virtualenv ve
    fi
}

function start_spotlight {
    cd wazoku-spotlight/spotlight
    create_ve
    ve/bin/pip install -r test-requirements.txt
    ve/bin/python manage.py runserver &
    SPOTLIGHT_PID=$!
    cd -
}

start_spotlight

cd wazoku-spotlight/spotlight
ve/bin/python manage.py test tests/integration --with-xunit

kill $SPOTLIGHT_PID

ERROR:

Pip.....................................................................................................................................................................................................................................................................................................................................done.
./run-tests-jenkins.sh: ve/bin/pip: "/var/lib/jenkins/jobs/spotlight: bad 
interpreter: No such file or directory
/var/lib/jenkins/jobs/spotlight integration and selenium/workspace
Traceback (most recent call last):
  File "run.py", line 1, in <module>
    from bottle import run
ImportError: No module named bottle
New python executable in ve/bin/python
Installing 
Setuptools..............................................................................................................................................................................................................................done.
Installing 

On Thursday, November 21, 2013 7:04:41 PM UTC, JonathanRRogers wrote:
>
> On Wednesday, November 20, 2013 6:48:26 AM UTC-5, andrea crotti wrote:
>>
>> Hello everyone,
>>
>> I'm trying to move some integration tests for our django app to Jenkins.
>>
>> I already succesfully managed to run integration tests for our business 
>> logic doing with coverage and violations as well, using something like:
>>
>> COVER_OPTIONS="--with-coverage --cover-package=company_core 
>> --cover-inclusive --cover-erase"
>>
>> ve/bin/pip install -r test-requirements.txt
>> source ve/bin/activate
>> nosetests --nologcapture --with-xunit $COVER_OPTIONS 
>> company_core/tests/unit company_core/tests/integration
>> python -m coverage xml -i
>> pylint -f parseable -d I0011,R0801 company_core | tee pylint.out
>>
>>
>> However for the app itself, we need something more, because I need to be 
>> able to run locally one API server on port 9797 and the django app itself 
>> on port 8000.
>>
>> So ideally the flow should be the following on Jenkins:
>> - checkout everything
>> - run api and app daemons
>> - run integration tests
>> - collect results and kill daemons
>>
>> I still haven't found a proper way to run the daemon processes though, 
>> any suggestions?
>> Thanks
>>
>
> AFAIK, managing daemons is outside of the scope of Jenkins unless there's 
> a plugin for managing a specific kind of daemon.  Just use ordinary 
> commands to start and stop daemons in a shell script within the job. It may 
> be necessary to set environment variable "BUILD_ID=dontKillMe" to tell 
> Jenkins not to kill a daemon process:
> <URL:https://wiki.jenkins-ci.org/display/JENKINS/ProcessTreeKiller>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to