GithubHelp home page GithubHelp logo

xuezhou1998 / lab-travis-ci Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nyu-devops/lab-travis-ci

0.0 0.0 0.0 91 KB

This lab demonstrates how to use Travis CI with Redis for Continuous Integration

License: Apache License 2.0

Python 89.26% HTML 4.24% CSS 3.66% Dockerfile 2.84%

lab-travis-ci's Introduction

nyu-travis-ci

Build Status Codecov License

This is for NYU DevOps lab on using Travis CI with Redis for Continuous Integration

Introduction

This lab contains a .travis.yml file that shows you how to run your tests and request that a Redis service be attached while running them. It also uses Code Coverage to determine how complete your testng is.

Setup

To complete this lab you will need to Fork this repo because you need to make a change in order to trigger Travis CI. When making a Pull Request, you want to make sure that your request is merging with your Fork because the Pull Request of a Fork will default to come back to this repo and not your Fork.

If you want to run the tests locally

There is no need to run the tests locally because the purpose of this lab is to have Travis Ci run them for you but if you wanted to run them yourself, the easy setup is to have Vagrant and VirtualBox installed. Then all you have to do is clone this repo and invoke vagrant:

git clone https://github.com/nyu-devops/lab-travis-ci.git
cd lab-travis-ci
vagrant up
vagrant ssh
cd /vagrant

This should give you a good indication that the unit tests are passing that that you have good code coverage.

You can now run nosetests to run the TDD tests locally.

Manually running the Tests

Run the tests using nosetests and coverage

$ nosetests
$ coverage report -m

Nose is configured to automatically include the flags --rednose --with-spec --spec-color --with-coverage so that red-green-refactor is meaningful. If you are in a command shell that supports colors, passing tests will be green while failing tests will be red.

What's featured in the project?

* routes.py -- the main Service using Python Flask and Redis
* test_service.py -- test cases using unittest
* models.py -- the Pet model that wrappers the Redis database
* test_pets.py -- unit tests that only test the Pet model
* .travis.yml -- the Travis CI file that automates testing

This repository is part of the NYU class CSCI-GA.2810-001: DevOps and Agile Methodologies taught by John Rofrano, Adjunct Instructor, NYU Courant Institute of Mathematical Sciences, Graduate Division, Computer Science.

lab-travis-ci's People

Contributors

iltc avatar rofrano avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.