Note that there are some explanatory texts on larger screens.

plurals
  1. POpython testing server-deployed application
    primarykey
    data
    text
    <p>I've got a small application (<a href="https://github.com/tkoomzaaskz/cherry-api" rel="nofollow">https://github.com/tkoomzaaskz/cherry-api</a>) and I would like to integrate it with travis. In fact, travis is probably not important here. My question is how can I configure a build/job to execute the following sequence:</p> <ul> <li>start the server that serves the application</li> <li>run tests</li> <li>close the server (which means close the build)</li> </ul> <p>The application is written in python/CherryPy (basic webapp framework). On my localhost I do it using two consoles. One runs the server and another one runs the tests - it's pretty easy and works fine. But when I want to execute all this in the CI environment, I fall in trouble - I'm unable to gain control after the server is started, because the server process waits for requests... and waits... and waits... and tests are never run (<a href="https://travis-ci.org/tkoomzaaskz/cherry-api/builds/10855029" rel="nofollow">https://travis-ci.org/tkoomzaaskz/cherry-api/builds/10855029</a> - this build is infinite). Additionally, I don't know how to close the server. This is my <code>.travis.yml</code>:</p> <pre><code>before_script: python src/hello.py script: nosetests </code></pre> <p><code>src/hello.py</code> starts the built-in CherryPy server (listens on <code>localhost:8080</code>). I know I can move it to the background by adding the <code>&amp;</code>: <code>before_script: python src/hello.py &amp;</code> but then I shall find the process ID in the CI-environment and kill the process which seems very very dirty solution and I guess there's something better than that.</p> <p>I'd appreciate any hints on how can I configure this.</p> <hr> <p>edit: I've configured this dirty run in the background and then kill the process in <a href="https://github.com/tkoomzaaskz/cherry-api/blob/1760412019df2450bf7b15b74521cc7a653b6894/.travis.yml" rel="nofollow">this file</a>. The build <a href="https://travis-ci.org/tkoomzaaskz/cherry-api/builds/10855631" rel="nofollow">passes now</a>. Still, I think it's ugly...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload