This is a creation in Article, where the information may have evolved or changed.
Go-srs with Travisci
Go test support is better, GitHub and Travisci integration is very good, so Go-srs not only can do TDD test drive, and can be very convenient ci, a little bit does not increase the cost of use.
GO Test
The premise of CI is that TDD is perfect, and go is good for test, execute command:
gogo test .
You can run the Go-srs test with the following results:
localhost:gogo test .ok _/Users/winlin/go-srs 0.004s
Go will find out all the test and execute it.
Travis CI
GitHub can add a service to the project's settings, in fact, each time pullrequest merge, if there is no integrated CI, will be prompted to add CI.
Travis CI after GitHub is turned on, you only need to add a file description file to your project .travis.yml
:
languagegogo: - 1.4
In fact, you can just need the first line.
This will automatically run CI every time Pullrequet, as well as push. Especially pullrequest, will be very convenient, if not pass test, will prompt error:
Once again update the code, such as in, update feature/ci
, push this branch, will automatically run CI and update pullrequest:
After a while, the build test succeeds:
Then the merge code is ready.
Documents for Travise CI: https://travis-ci.org/getting_started
Documents for Travise CI go language: http://docs.travis-ci.com/user/languages/go/
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.