Continuous integration research afternoon
- development practice that requires developers to integrate code to a shared repository several times a day. Each check in is then verified by an automated build which allows teams to detect problems earlier.
- by integrating regularly you can detect errors quickly and locate them easily
- early detection of errors
- cheaper, shorter periods between integrations
- spend less time debugging
- stop waiting to find out if your code’s going to work
- frequent commits
- hard to divide into tiny chunks
- hard to write tests
- if project is already ongoing difficult to implement CI
- every time you commit and push to github travis will run the test script automatically
- must have node.js installed locally
- sign up using github
- authorise application
- turn on the repository you want travis to build
- create project files
.travis.yml
with:
language: node_js
node_js: 8.2.1
- run
npm init
to create package.json - specify test script eg
"scripts": {
"test": "istanbul cover tape test.js | tap-spec"
}
This is the output you can expect from a failing test.
Failing travis tests on github.
This is the output you can expect when all the tests pass.
Passing tests on github.