Skip to content

Commit

Permalink
Added codecov (#777)
Browse files Browse the repository at this point in the history
  • Loading branch information
delvedor committed Mar 15, 2019
1 parent 12626fe commit a58d2ed
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .ci/docker-compose.yml
Expand Up @@ -7,6 +7,7 @@ services:
dockerfile: .ci/Dockerfile
args:
NODE_JS_VERSION: ${NODE_JS_VERSION:-10}
CODECOV_TOKEN: ${CODECOV_TOKEN}
environment:
- "TEST_ES_SERVER=http://elasticsearch-oss:9200"
volumes:
Expand Down Expand Up @@ -54,6 +55,8 @@ services:
- esnet-platinum
depends_on:
- elasticsearch-platinum
# there is not need to run again also the unit test
command: ["npm", "run", "test:integration"]

elasticsearch-platinum:
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:5.6.15}
Expand Down
4 changes: 4 additions & 0 deletions .ci/jobs/defaults.yml
Expand Up @@ -30,6 +30,10 @@
wipe-workspace: 'True'
triggers:
- 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:
- axis:
type: slave
Expand Down
6 changes: 6 additions & 0 deletions .ci/run-tests
Expand Up @@ -10,6 +10,12 @@
# - $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-platinum
14 changes: 14 additions & 0 deletions .codecov.yml
@@ -0,0 +1,14 @@
comment: off

coverage:
precision: 2
round: down
range: "90...100"

status:
project: yes
patch: yes
changes: no

ignore:
- "api"
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -22,11 +22,10 @@
"test:integration": "tap test/integration/index.js -T --harmony --no-esm",
"test:types": "tsc --project ./test/types/tsconfig.json",
"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:fix": "standard --fix",
"generate": "node scripts/run.js",
"elasticsearch": "./scripts/es-docker.sh",
"ci": "npm run license-checker && npm test && npm run test:integration",
"ci": "npm run license-checker && npm test && npm run test:integration && npm run test:coverage",
"license-checker": "license-checker --production --onlyAllow='MIT;Apache-2.0;Apache1.1;ISC;BSD-3-Clause;BSD-2-Clause'"
},
"author": {
Expand All @@ -39,6 +38,7 @@
},
"devDependencies": {
"@types/node": "^10.12.24",
"codecov": "^3.2.0",
"convert-hrtime": "^2.0.0",
"dedent": "^0.7.0",
"deepmerge": "^3.1.0",
Expand Down

0 comments on commit a58d2ed

Please sign in to comment.