mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 08:56:43 -06:00
build: split circle test shell scripts
This commit is contained in:
parent
48f384dcf1
commit
1fd2270a93
@ -32,7 +32,8 @@ dependencies:
|
||||
|
||||
test:
|
||||
override:
|
||||
- bash scripts/circle-test.sh
|
||||
- bash scripts/circle-test-frontend.sh
|
||||
- bash scripts/circle-test-backend.sh
|
||||
|
||||
deployment:
|
||||
gh_branch:
|
||||
|
@ -22,7 +22,8 @@ func ValidateOrgAlert(c *middleware.Context) {
|
||||
if c.OrgId != query.Result.OrgId {
|
||||
c.JsonApiErr(403, "You are not allowed to edit/view alert", nil)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func GetAlertStatesForDashboard(c *middleware.Context) Response {
|
||||
|
@ -12,36 +12,22 @@ 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: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
|
||||
# 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
|
||||
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
|
25
scripts/circle-test-frontend.sh
Executable file
25
scripts/circle-test-frontend.sh
Executable 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
|
@ -1,5 +1,5 @@
|
||||
module.exports = function(config, grunt) {
|
||||
'use strict'
|
||||
'use strict';
|
||||
|
||||
var coverage = '';
|
||||
if (config.coverage) {
|
||||
@ -7,8 +7,8 @@ module.exports = function(config, grunt) {
|
||||
}
|
||||
|
||||
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,
|
||||
"webpack": "./node_modules/.bin/webpack --config scripts/webpack/webpack.prod.js",
|
||||
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_modules/.bin/webpack --config scripts/webpack/webpack.prod.js',
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user