Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Travis CI #46

Open
daknob opened this issue Oct 5, 2016 · 5 comments
Open

Add support for Travis CI #46

daknob opened this issue Oct 5, 2016 · 5 comments

Comments

@daknob
Copy link
Owner

daknob commented Oct 5, 2016

We should add support for Travis CI so all our Pull Requests, branches, and pushes are automatically built. It will help us avoid bad merges and will show the build: passing icon in the main page.

I have played with it a little bit but didn't manage to arrive to a correct .travis.yml file. There are two things I'd like to do with it:

  • Either install everything and execute the web server to make sure there are no Python non-runtime errors
  • Or have it build from the Dockerfile and run it

Of course, when we have tests, we can also run the tests there.

I managed to do the first one, however, the web server is running non-stop and therefore the build never stops. Any ideas on how to fix that?

About the second one, I will try some more, but running docker inside docker inside a VM can be complex and still has the same issues as before (web server never quits).

@daknob
Copy link
Owner Author

daknob commented Oct 5, 2016

An example .travis.yml file for Docker can be:

language: python
sudo: required
python:
    - "2.7"
services:
    - docker
install: true
script: docker build .

However this will only test if the Dockerfile works and the app can be packaged. Any ideas how to test the code inside? Running the container won't be of much help unless we find a way to stop it. I think all these problems will be solved by fixing #42 but let's see what we can do until then.

@frankcash
Copy link

I know just running an application without testing it will cause it to fail. I wonder if it could be ran and then do like a wget

@daknob
Copy link
Owner Author

daknob commented Oct 5, 2016

Correct. We can use either requests and run a python script or use wget and run a bash script.

@pokoli
Copy link

pokoli commented Oct 6, 2016

I think you must create a test suite using flask tools for that, and then run the standard test suite. So for me #42 should be fixed first.

Once the test suite is added, you can use tox to test the application in various python environment (i.e: several python versions (2.7, 3.3, 3.4, 3.5), diferent backends (if they are added), or a combination of both.

Once tox is added you can use this .travis.yml file:

language: python
install:
  - pip install tox 
script:
  - tox
env:
  - TOXENV=py27
  - TOXENV=py33
  - TOXENV=py34
  - TOXENV=py35

That will test (in paralel) tox py27,py33,py34 and py35 environments.

@daknob
Copy link
Owner Author

daknob commented Oct 19, 2016

I have added a very early stage .travis.yml which only checks if the files follow PEP8 or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants