Merge branch 'master' into develop

This commit is contained in:
Torkel Ödegaard
2017-10-24 09:06:09 +02:00
69 changed files with 1284 additions and 654 deletions

View File

@ -12,37 +12,23 @@ function exit_if_fail {
cd /home/ubuntu/.go_workspace/src/github.com/grafana/grafana
rm -rf node_modules
npm install -g yarn --quiet
yarn install --pure-lockfile --no-progress
exit_if_fail npm run test-ci
exit_if_fail npm run build
# publish code coverage
echo "Publishing javascript code coverage"
bash <(curl -s https://codecov.io/bash) -cF javascript
rm -rf coverage
# npm install -g codecov
# codecov
# cat ./coverage/lcov.info | node ./node_modules/coveralls/bin/coveralls.js
echo "running go fmt"
exit_if_fail test -z "$(gofmt -s -l ./pkg | tee /dev/stderr)"
echo "running go vet"
exit_if_fail test -z "$(go vet ./pkg/... | tee /dev/stderr)"
echo "building binaries"
exit_if_fail go run build.go build
cd ~/dev/go/src/github.com/grafana/grafana
echo "building backend with install to cache pkgs"
exit_if_fail time go install ./pkg/cmd/grafana-server
echo "running go test"
set -e
echo "" > coverage.txt
for d in $(go list ./pkg/...); do
exit_if_fail go test -race -coverprofile=profile.out -covermode=atomic $d
time for d in $(go list ./pkg/...); do
exit_if_fail go test -coverprofile=profile.out -covermode=atomic $d
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out

25
scripts/circle-test-frontend.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
function exit_if_fail {
command=$@
echo "Executing '$command'"
eval $command
rc=$?
if [ $rc -ne 0 ]; then
echo "'$command' returned $rc."
exit $rc
fi
}
cd /home/ubuntu/.go_workspace/src/github.com/grafana/grafana
rm -rf node_modules
npm install -g yarn --quiet
yarn install --pure-lockfile --no-progress
exit_if_fail npm run test:coverage
exit_if_fail npm run build
# publish code coverage
echo "Publishing javascript code coverage"
bash <(curl -s https://codecov.io/bash) -cF javascript
rm -rf coverage

View File

@ -7,7 +7,7 @@ module.exports = function(grunt) {
'clean:release',
'clean:build',
'phantomjs',
'webpack:prod',
'exec:webpack',
]);
};

View File

@ -19,6 +19,12 @@ module.exports = function(grunt) {
'no-only-tests'
]);
grunt.registerTask('precommit', [
'sasslint',
'exec:tslint',
'no-only-tests'
]);
grunt.registerTask('no-only-tests', function() {
var files = grunt.file.expand('public/**/*_specs\.ts', 'public/**/*_specs\.js');

View File

@ -1,13 +1,14 @@
module.exports = function(config, grunt) {
'use strict'
'use strict';
var coverage = '';
if (config.coverage) {
coverage = '--coverage';
coverage = '--coverage --maxWorkers 2';
}
return {
tslint : "node ./node_modules/tslint/lib/tslint-cli.js -c tslint.json --project ./tsconfig.json",
jest : "node ./node_modules/jest-cli/bin/jest.js " + coverage,
tslint: 'node ./node_modules/tslint/lib/tslint-cli.js -c tslint.json --project ./tsconfig.json',
jest: 'node ./node_modules/jest-cli/bin/jest.js ' + coverage,
webpack: 'node ./node_modules/webpack/bin/webpack.js --config scripts/webpack/webpack.prod.js',
};
};

View File

@ -5,7 +5,7 @@ module.exports = function() {
'use strict';
return {
options: {
stats: !process.env.NODE_ENV || process.env.NODE_ENV === 'development'
stats: false,
},
dev: dev,
prod: prod

View File

@ -27,7 +27,10 @@ module.exports = merge(common, {
},
devServer: {
stats: 'errors-only',
noInfo: true,
stats: {
chunks: false,
},
},
plugins: [