<div dir="ltr"><div><div>How do you configure a builder to run a specific script in your source?<br><br>I have a "runtests" script in my code which creates the Python virtualenv, creates an in-memory test database, and runs all unittests, but when I enter a builder command like "cd src/myproject; runtests", I get the error:<br><br>    Upon execvpe cd src/myproject; ./runtests ['cd src/myproject; ./runtests'] in environment id 140610380051352<br>    :Traceback (most recent call last):<br>      File "/usr/lib/python2.7/dist-packages/twisted/internet/process.py", line 403, in _fork<br>        path, uid, gid, executable, args, environment)<br>      File "/usr/lib/python2.7/dist-packages/twisted/internet/process.py", line 453, in _execChild<br>        os.execvpe(executable, args, environment)<br>      File "/usr/lib/python2.7/os.py", line 353, in execvpe<br>        _execvpe(file, args, env)<br>      File "/usr/lib/python2.7/os.py", line 368, in _execvpe<br>        func(file, *argrest)<br>    OSError: [Errno 2] No such file or directory<br><br></div><div>presumably because Buildbot's default CWD is not the same as my code's clone directory.<br></div><div><br></div>The tutorial (<a href="http://docs.buildbot.net/current/tutorial/tour.html">http://docs.buildbot.net/current/tutorial/tour.html</a>) is a little confusing. It calls "trial pyflakes", which is a globally-accessible command, so it's not clear how Buildbot knows where anything is. How do I construct my command to reference Buildbot's CWD and the location where it checks-out my code?<br><br></div>My master.cfg looks like:<br><br>    c['change_source'] = []<br>    c['change_source'].append(changes.GitPoller(<br>            '<a href="https://myuser:mypass@bitbucket.org/myproject/myproject.git">https://myuser:mypass@bitbucket.org/myproject/myproject.git</a>',<br>            workdir='gitpoller-workdir',<br>            branch='master',<br>            pollinterval=300, # interval in seconds between polls<br>    ))<br><br>    ####### SCHEDULERS<br><br>    c['schedulers'] = []<br>    c['schedulers'].append(schedulers.SingleBranchScheduler(<br>        name="all",<br>        change_filter=util.ChangeFilter(branch='master'),<br>        #The scheduler will wait for this many seconds before starting the build. <br>        treeStableTimer=None,<br>        builderNames=["myproject_runtests"],<br>    ))<br>    c['schedulers'].append(schedulers.ForceScheduler(<br>        name="force",<br>        builderNames=["myproject_runtests"]))<br><br>    ####### BUILDERS<br><br>    factory = util.BuildFactory()<br>    factory.addStep(steps.Git(repourl='<a href="https://myuser:mypass@bitbucket.org/myproject/myproject.git">https://myuser:mypass@bitbucket.org/myproject/myproject.git</a>', mode='incremental'))<br>    factory.addStep(steps.ShellCommand(command=["cd src/myproject; ./runtests"]))<br><br>    c['builders'] = []<br>    c['builders'].append(<br>        util.BuilderConfig(name="myproject_runtests",<br>          slavenames=["example-slave"],<br>          factory=factory))<br><br></div>