The Sample Application

For testing out various CI tools, we have made a simple Python web application suing flask framework. The application is available freely at Github. This web application returns the IP address of the client.
Check out the code below:
We will use this application to setup continuous integration. We have written a unit test using Python unittest library and a functionality test.

The unit test checks for the response code of /get_my_ip.
The functionality test checks the actual json string for the local IP.

Order of execution for the CI would be:

  1. Start flask server in background.
  2. Sleep for one second to give flask time to start the application properly.
  3. Execute unit test.
  4. Execute functional test.