-
Notifications
You must be signed in to change notification settings - Fork 0
Travis CI integration
Intern is designed to easily integrate with the Travis CI continuous integration service. In order to enable Travis CI for your project, you must first create a .travis.yml in your repository root that will load and execute Intern. For a typical project using BrowserStack, it should look like this:
language: node_js
node_js:
- 0.10
env:
global:
- BROWSERSTACK_USERNAME: username
- BROWSERSTACK_ACCESS_KEY: access-key
script: node_modules/.bin/intern-runner config=tests/internIf you are not OK exposing your BrowserStack username and access key, you may use secure environment variables to encrypt them (travis encrypt "BROWSERSTACK_USERNAME=username BROWSERSTACK_ACCESS_KEY=access-key"). However, this will mean that pull requests are no longer tested.
Once you have a Travis configuration, you just need to actually start the thing:
- Go to https://travis-ci.org/
- Click “Sign in with GitHub” at the top-right
- Allow Travis CI to access your GitHub account
- Go to https://travis-ci.org/profile
- Click “Sync now”, if necessary, to list all your GitHub projects
- Click the “Profile” tab
- Copy the “Token” value to your clipboard
- Click the “Repositories” tab
- Click the on/off switch next to the repository you want to test
- Click the wrench icon next to the repository you want to test
- Find Travis in the list of services and click it
- Paste the token from your clipboard to the Token field
- Click “Save changes”
- Click “Test Hook”
If the test hook was successful (it may take several minutes for the test hook to trigger a build), you will be able to watch Intern happily execute all your tests directly from the Travis CI Web site. Any time you make a new commit, or a new pull request is issued, Travis will automatically re-run your test suite. Simple!