Added codecov (#777)

This commit is contained in:
Tomas Della Vedova
2019-03-15 15:55:34 +01:00
committed by delvedor
parent 0f5ac8127c
commit 91935905b6
5 changed files with 30 additions and 3 deletions

View File

@ -7,6 +7,7 @@ services:
dockerfile: .ci/Dockerfile dockerfile: .ci/Dockerfile
args: args:
NODE_JS_VERSION: ${NODE_JS_VERSION:-10} NODE_JS_VERSION: ${NODE_JS_VERSION:-10}
CODECOV_TOKEN: ${CODECOV_TOKEN}
environment: environment:
- "TEST_ES_SERVER=http://elasticsearch-oss:9200" - "TEST_ES_SERVER=http://elasticsearch-oss:9200"
volumes: volumes:
@ -54,6 +55,8 @@ services:
- esnet-platinum - esnet-platinum
depends_on: depends_on:
- elasticsearch-platinum - elasticsearch-platinum
# there is not need to run again also the unit test
command: ["npm", "run", "test:integration"]
elasticsearch-platinum: elasticsearch-platinum:
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-7.0.0-beta1} image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-7.0.0-beta1}

View File

@ -30,6 +30,10 @@
wipe-workspace: 'True' wipe-workspace: 'True'
triggers: triggers:
- github - github
vault:
url: https://secrets.elastic.co:8200
# vault read auth/approle/role/clients-ci/role-id
role_id: ddbd0d44-0e51-105b-177a-c8fdfd445126
axes: axes:
- axis: - axis:
type: slave type: slave

View File

@ -10,6 +10,12 @@
# - $NODE_JS_VERSION # - $NODE_JS_VERSION
# #
set +x
export VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id="$VAULT_ROLE_ID" secret_id="$VAULT_SECRET_ID")
export CODECOV_TOKEN=$(vault read -field=token secret/clients-ci/elasticsearch-js/codecov)
unset VAULT_ROLE_ID VAULT_SECRET_ID VAULT_TOKEN
set -x
ELASTICSEARCH_VERSION=${ELASTICSEARCH_VERSION} NODE_JS_VERSION=${NODE_JS_VERSION} docker-compose -f .ci/docker-compose.yml run client-oss ELASTICSEARCH_VERSION=${ELASTICSEARCH_VERSION} NODE_JS_VERSION=${NODE_JS_VERSION} docker-compose -f .ci/docker-compose.yml run client-oss
ELASTICSEARCH_VERSION=${ELASTICSEARCH_VERSION} NODE_JS_VERSION=${NODE_JS_VERSION} docker-compose -f .ci/docker-compose.yml run client-platinum ELASTICSEARCH_VERSION=${ELASTICSEARCH_VERSION} NODE_JS_VERSION=${NODE_JS_VERSION} docker-compose -f .ci/docker-compose.yml run client-platinum

14
.codecov.yml Normal file
View File

@ -0,0 +1,14 @@
comment: off
coverage:
precision: 2
round: down
range: "90...100"
status:
project: yes
patch: yes
changes: no
ignore:
- "api"

View File

@ -22,11 +22,10 @@
"test:integration": "tap test/integration/index.js -T --harmony --no-esm", "test:integration": "tap test/integration/index.js -T --harmony --no-esm",
"test:types": "tsc --project ./test/types/tsconfig.json", "test:types": "tsc --project ./test/types/tsconfig.json",
"test:benchmarks": "nanobench test/benchmarks/*.bench.js", "test:benchmarks": "nanobench test/benchmarks/*.bench.js",
"test:coverage": "tap test/unit/*.test.js -J -t 300 --cov --coverage-report=text-lcov && codecov",
"lint": "standard", "lint": "standard",
"lint:fix": "standard --fix", "lint:fix": "standard --fix",
"generate": "node scripts/run.js", "ci": "npm run license-checker && npm test && npm run test:integration && npm run test:coverage",
"elasticsearch": "./scripts/es-docker.sh",
"ci": "npm run license-checker && npm test && npm run test:integration",
"license-checker": "license-checker --production --onlyAllow='MIT;Apache-2.0;Apache1.1;ISC;BSD-3-Clause;BSD-2-Clause'" "license-checker": "license-checker --production --onlyAllow='MIT;Apache-2.0;Apache1.1;ISC;BSD-3-Clause;BSD-2-Clause'"
}, },
"author": { "author": {
@ -39,6 +38,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^10.12.24", "@types/node": "^10.12.24",
"codecov": "^3.2.0",
"convert-hrtime": "^2.0.0", "convert-hrtime": "^2.0.0",
"dedent": "^0.7.0", "dedent": "^0.7.0",
"deepmerge": "^3.1.0", "deepmerge": "^3.1.0",