Skip to content

Commit

Permalink
Set up istanbul with codeclimate and travis. (#1046)
Browse files Browse the repository at this point in the history
* Set up istanbul with codeclimate and travis.

* Put the codeclimate tocken inside .travis.yml
  • Loading branch information
bkyryliuk authored Aug 31, 2016
1 parent 3f88949 commit 85d03f5
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 6 deletions.
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@

language: python
addons:
code_climate:
repo_token: 5f3a06c425eef7be4b43627d7d07a3e46c45bdc07155217825ff7c49cb6a470c
apt:
sources:
- deadsnakes
packages:
- python3.5
code_climate:
repo_token: 5f3a06c425eef7be4b43627d7d07a3e46c45bdc07155217825ff7c49cb6a470c
cache:
directories:
- $HOME/.wheelhouse/
env:
global:
- TRAVIS_CACHE=$HOME/.travis_cache/
- TRAVIS_NODE_VERSION="5.11"
matrix:
#- TOX_ENV=py27-mysql
- TOX_ENV=py27-sqlite
Expand All @@ -22,12 +24,14 @@ env:
- TOX_ENV=py34-postgres
- TOX_ENV=javascript
before_install:
- npm install -g npm@'>=2.7.1'
- npm install -g npm@'>=3.9.5'
before_script:
- mysql -e 'drop database if exists caravel; create database caravel DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci' -u root
- psql -c 'create database caravel;' -U postgres
- export PATH=${PATH}:/tmp/hive/bin
install:
- pip install --upgrade pip
- pip install tox tox-travis
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- npm install
script: tox -e $TOX_ENV
1 change: 1 addition & 0 deletions caravel/assets/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ vendor/*
dist/*
stylesheets/*
spec/*
coverage/**
54 changes: 54 additions & 0 deletions caravel/assets/.istanbul.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
verbose: true
instrumentation:
root: './javascripts'
extensions: ['.js', '.jsx']
excludes: [
'dist/**'
]
embed-source: false
variable: __coverage__
compact: true
preserve-comments: false
complete-copy: false
save-baseline: true
baseline-file: ./coverage/coverage-baseline.json
include-all-sources: true
include-pid: false
es-modules: true
reporting:
print: summary
reports:
- lcov
dir: ./coverage
watermarks:
statements: [50, 80]
lines: [50, 80]
functions: [50, 80]
branches: [50, 80]
report-config:
clover: {file: clover.xml}
cobertura: {file: cobertura-coverage.xml}
json: {file: coverage-final.json}
json-summary: {file: coverage-summary.json}
lcovonly: {file: lcov.info}
teamcity: {file: null, blockName: Code Coverage Summary}
text: {file: null, maxCols: 0}
text-lcov: {file: lcov.info}
text-summary: {file: null}
hooks:
hook-run-in-context: false
post-require-hook: null
handle-sigint: false
check:
global:
statements: 0
lines: 0
branches: 0
functions: 0
excludes: []
each:
statements: 0
lines: 0
branches: 0
functions: 0
excludes: []
3 changes: 3 additions & 0 deletions caravel/assets/js_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
set -e
cd "$(dirname "$0")"
npm --version
node --version
npm install
npm run lint
npm run test
npm run prod
npm run cover
CODECLIMATE_REPO_TOKEN=5f3a06c425eef7be4b43627d7d07a3e46c45bdc07155217825ff7c49cb6a470c ./node_modules/.bin/codeclimate-test-reporter < ./coverage/lcov.info
6 changes: 5 additions & 1 deletion caravel/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"test": "spec"
},
"scripts": {
"test": "npm run lint && mocha --compilers js:babel-core/register --required spec/helpers/browser.js spec/**/*_spec.*",
"test": "npm run lint && mocha --compilers js:babel-core/register --require spec/helpers/browser.js --recursive spec/**/*_spec.*",
"cover": "babel-node ./node_modules/.bin/istanbul cover _mocha -- --require spec/helpers/browser.js --recursive spec/**/*_spec.*",
"dev": "NODE_ENV=dev webpack -d --watch --colors --progress",
"prod": "NODE_ENV=production webpack -p --colors --progress",
"lint": "npm run --silent lint:js",
Expand Down Expand Up @@ -36,6 +37,7 @@
"homepage": "https://github.com/airbnb/caravel#readme",
"dependencies": {
"autobind-decorator": "^1.3.3",
"babel-cli": "^6.14.0",
"bootstrap": "^3.3.6",
"bootstrap-datepicker": "^1.6.0",
"brace": "^0.7.0",
Expand Down Expand Up @@ -90,6 +92,7 @@
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.11.1",
"chai": "^3.5.0",
"codeclimate-test-reporter": "^0.3.3",
"css-loader": "^0.23.1",
"enzyme": "^2.0.0",
"eslint": "^2.13.1",
Expand All @@ -98,6 +101,7 @@
"eslint-plugin-jsx-a11y": "^2.0.1",
"eslint-plugin-react": "^5.2.2",
"exports-loader": "^0.6.3",
"istanbul": "^1.0.0-alpha",
"file-loader": "^0.8.5",
"imports-loader": "^0.6.5",
"jsdom": "^8.0.1",
Expand Down
2 changes: 0 additions & 2 deletions caravel/assets/spec/helpers/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ Object.keys(document.defaultView).forEach((property) => {
global.navigator = {
userAgent: 'node.js',
};

documentRef = document;

0 comments on commit 85d03f5

Please sign in to comment.