I have added the project to Travis CI which is great free tool to build and integration test. The following image shows current status of build/ test run:
It runs every time a new push is made to the Github repository. This image is actually dynamic and shows current status of Cosmos Framework. If you can not see it look here.
Setting up TravisCI is easy. First login to https://travis-ci.org/ using your Github account and Travis CI will show the list of public repositories. Now enable any repository Travis should track. Then we need to add a file named
.travis.yml
at the root of the repository. This file contains basic settings like language and script to run. For cosmos
we need MongoDB which can also be added usnder required services. Here is the first version of the configuration file being currently used to run build and tests:
language: python python: - "2.7" # command to install dependencies install: - pip install tornado - pip install motor - pip install mongolog - pip install mock - pip install requests services: - mongodb before_script: #This mongodb command should not have a newline in real file - mongo 127.0.0.1/cosmos --eval 'db.cosmos.users.insert( { "username":"admin", "roles": ["43425097-e630-41ea-88eb-17b339339706"], "email":"admin@cosmosframework.com", "password":"hmac:1ddb4e6b0b810f59018babbb5dc0eed4" });' # command to run tests script: python setup.py test
We are installing the required python packages and adding mongodb as required service. Before running script we want to add our admin user to mongodb which is done in
before_script
section.When we add this file, commit and push the change to Github, Travis gets notification using webhook about the change and start deploying a system and run tests. It shows the status using an image (as shown above) that changes based on the build/test result.
This is a very nice free service which you may use for your opensource project and for each change it will run your tests and report if anything is broken.
Nice post
ReplyDeleteThere are numerous Continuous Integration apparatuses accessible to developers, and Travis-CI is only one of those accessible unreservedly to the Open Source people group. Travis-CI is uninhibitedly accessible and is typically designed to run consequently when pushing code, yet it must be arranged before first utilize.
ReplyDelete