Use Codecov (#8388)

* Use Codecov

Upload coverage reports to Codecov. For now, having Codecov comment on
PRs or enforcing a minimum coverage threshold are both disabled until
the Codecov coverage reports look reliable:
https://codecov.io/gh/apache/incubator-druid

* Split bash and curl into separate lines
This commit is contained in:
Chi Cao Minh 2019-08-28 08:49:30 -07:00 committed by Gian Merlino
parent 6327cb3d4c
commit 31e6280b75
7 changed files with 152 additions and 34 deletions

31
.codecov.yml Normal file
View File

@ -0,0 +1,31 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Documentation for Codecov yaml: https://docs.codecov.io/docs/codecov-yaml
#
# Validate changes with:
# curl --data-binary @.codecov.yml https://codecov.io/validate
# Documentation for pull request comments: https://docs.codecov.io/docs/pull-request-comments
# Consider enabling pull request comments after codecov reports look reliable.
comment: off
coverage:
# Documentation for commit status: https://docs.codecov.io/docs/commit-status
# Consider enabling commit status to enforce minimum coverage thresholds after codecov reports look reliable.
status:
project: off
patch: off

View File

@ -115,6 +115,11 @@ matrix:
${MAVEN_SKIP} -Dremoteresources.skip=true ${MAVEN_SKIP} -Dremoteresources.skip=true
- sh -c "dmesg | egrep -i '(oom|out of memory|kill process|killed).*' -C 1 || exit 0" - sh -c "dmesg | egrep -i '(oom|out of memory|kill process|killed).*' -C 1 || exit 0"
- free -m - free -m
after_success: &upload_java_unit_test_coverage
- ${MVN} -pl ${MAVEN_PROJECTS} jacoco:report
# retry in case of network error
- travis_retry curl -o codecov.sh -s https://codecov.io/bash
- travis_retry bash codecov.sh -X gcov
- name: "processing module test (SQL Compatibility)" - name: "processing module test (SQL Compatibility)"
env: *processing_env env: *processing_env
@ -127,43 +132,53 @@ matrix:
${MAVEN_SKIP} -Dremoteresources.skip=true ${MAVEN_SKIP} -Dremoteresources.skip=true
- sh -c "dmesg | egrep -i '(oom|out of memory|kill process|killed).*' -C 1 || exit 0" - sh -c "dmesg | egrep -i '(oom|out of memory|kill process|killed).*' -C 1 || exit 0"
- free -m - free -m
after_success: *upload_java_unit_test_coverage
- name: "indexing modules test" - name: "indexing modules test"
env: &indexing_env env: &indexing_env
- MAVEN_PROJECTS='indexing-hadoop,indexing-service,extensions-core/kafka-indexing-service,extensions-core/kinesis-indexing-service' - MAVEN_PROJECTS='indexing-hadoop,indexing-service,extensions-core/kafka-indexing-service,extensions-core/kinesis-indexing-service'
before_script: *setup_java_test before_script: *setup_java_test
script: *run_java_test script: *run_java_test
after_success: *upload_java_unit_test_coverage
- name: "indexing modules test (SQL Compatibility)" - name: "indexing modules test (SQL Compatibility)"
env: *indexing_env env: *indexing_env
before_script: *setup_java_test before_script: *setup_java_test
script: *run_java_sql_compat_test script: *run_java_sql_compat_test
after_success: *upload_java_unit_test_coverage
- name: "server module test" - name: "server module test"
env: &server_env env: &server_env
- MAVEN_PROJECTS='server' - MAVEN_PROJECTS='server'
before_script: *setup_java_test before_script: *setup_java_test
script: *run_java_test script: *run_java_test
after_success: *upload_java_unit_test_coverage
- name: "server module test (SQL Compatibility)" - name: "server module test (SQL Compatibility)"
env: *server_env env: *server_env
before_script: *setup_java_test before_script: *setup_java_test
script: *run_java_sql_compat_test script: *run_java_sql_compat_test
after_success: *upload_java_unit_test_coverage
- name: "other modules test" - name: "other modules test"
env: &other_env env: &other_env
- MAVEN_PROJECTS='!processing,!indexing-hadoop,!indexing-service,!extensions-core/kafka-indexing-service,!extensions-core/kinesis-indexing-service,!server,!web-console' - MAVEN_PROJECTS='!processing,!indexing-hadoop,!indexing-service,!extensions-core/kafka-indexing-service,!extensions-core/kinesis-indexing-service,!server,!web-console'
before_script: *setup_java_test before_script: *setup_java_test
script: *run_java_test script: *run_java_test
after_success: *upload_java_unit_test_coverage
- name: "other modules test (SQL Compatibility)" - name: "other modules test (SQL Compatibility)"
env: *other_env env: *other_env
before_script: *setup_java_test before_script: *setup_java_test
script: *run_java_sql_compat_test script: *run_java_sql_compat_test
after_success: *upload_java_unit_test_coverage
- name: "web console" - name: "web console"
install: skip install: skip
script: ${MVN} test -pl 'web-console' script:
- ${MVN} test -pl 'web-console'
after_success:
- (cd web-console && travis_retry npm run codecov) # retry in case of network error
- name: "docs" - name: "docs"
install: (cd website && npm install) install: (cd website && npm install)

View File

@ -20,9 +20,9 @@
[![Slack](https://img.shields.io/badge/slack-%23druid-72eff8?logo=slack)](https://druid.apache.org/community/join-slack) [![Slack](https://img.shields.io/badge/slack-%23druid-72eff8?logo=slack)](https://druid.apache.org/community/join-slack)
[![Build Status](https://travis-ci.org/apache/incubator-druid.svg?branch=master)](https://travis-ci.org/apache/incubator-druid) [![Build Status](https://travis-ci.org/apache/incubator-druid.svg?branch=master)](https://travis-ci.org/apache/incubator-druid)
[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/apache/incubator-druid.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/apache/incubator-druid/context:java) [![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/apache/incubator-druid.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/apache/incubator-druid/context:java)
[![Coverage Status](https://img.shields.io/codecov/c/gh/apache/incubator-druid)](https://codecov.io/gh/apache/incubator-druid)
[![Docker](https://img.shields.io/badge/container-docker-blue.svg)](https://hub.docker.com/r/apache/incubator-druid) [![Docker](https://img.shields.io/badge/container-docker-blue.svg)](https://hub.docker.com/r/apache/incubator-druid)
<!--- Following badges are disabled until they can be fixed: --> <!--- Following badges are disabled until they can be fixed: -->
<!--- [![Coverage Status](https://coveralls.io/repos/github/apache/incubator-druid/badge.svg?branch=master)](https://coveralls.io/github/apache/incubator-druid?branch=master) -->
<!--- [![Inspections Status](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/OpenSourceProjects_Druid_Inspections.svg?label=TeamCity%20inspections)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=OpenSourceProjects_Druid_Inspections) --> <!--- [![Inspections Status](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/OpenSourceProjects_Druid_Inspections.svg?label=TeamCity%20inspections)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=OpenSourceProjects_Druid_Inspections) -->
## Apache Druid (incubating) ## Apache Druid (incubating)

View File

@ -984,7 +984,8 @@
<exclude>org/apache/druid/data/input/influx/InfluxLineProtocol*</exclude> <!-- extensions-contrib/influx-extensions --> <exclude>org/apache/druid/data/input/influx/InfluxLineProtocol*</exclude> <!-- extensions-contrib/influx-extensions -->
<!-- Ignore non-production code --> <!-- Ignore non-production code -->
<exclude>org/apache/druid/**/*Benchmark.*</exclude> <!-- benchmarks --> <exclude>org/apache/druid/benchmark/**/*</exclude> <!-- benchmarks -->
<exclude>org/apache/druid/**/*Benchmark*</exclude> <!-- benchmarks -->
<exclude>org/testng/DruidTestRunnerFactory*</exclude> <!-- benchmarks --> <exclude>org/testng/DruidTestRunnerFactory*</exclude> <!-- benchmarks -->
<exclude>org/apache/druid/testing/**/*</exclude> <!-- integration-tests --> <exclude>org/apache/druid/testing/**/*</exclude> <!-- integration-tests -->
</excludes> </excludes>

View File

@ -1960,6 +1960,15 @@
"integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==",
"dev": true "dev": true
}, },
"agent-base": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz",
"integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==",
"dev": true,
"requires": {
"es6-promisify": "^5.0.0"
}
},
"airbnb-prop-types": { "airbnb-prop-types": {
"version": "2.14.0", "version": "2.14.0",
"resolved": "https://registry.npmjs.org/airbnb-prop-types/-/airbnb-prop-types-2.14.0.tgz", "resolved": "https://registry.npmjs.org/airbnb-prop-types/-/airbnb-prop-types-2.14.0.tgz",
@ -2125,6 +2134,12 @@
"sprintf-js": "~1.0.2" "sprintf-js": "~1.0.2"
} }
}, },
"argv": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/argv/-/argv-0.0.2.tgz",
"integrity": "sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=",
"dev": true
},
"aria-query": { "aria-query": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-3.0.0.tgz", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-3.0.0.tgz",
@ -3203,6 +3218,19 @@
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"dev": true "dev": true
}, },
"codecov": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/codecov/-/codecov-3.5.0.tgz",
"integrity": "sha512-/OsWOfIHaQIr7aeZ4pY0UC1PZT6kimoKFOFYFNb6wxo3iw12nRrh+mNGH72rnXxNsq6SGfesVPizm/6Q3XqcFQ==",
"dev": true,
"requires": {
"argv": "^0.0.2",
"ignore-walk": "^3.0.1",
"js-yaml": "^3.13.1",
"teeny-request": "^3.11.3",
"urlgrey": "^0.4.4"
}
},
"collapse-white-space": { "collapse-white-space": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.5.tgz", "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.5.tgz",
@ -4691,6 +4719,21 @@
"is-symbol": "^1.0.2" "is-symbol": "^1.0.2"
} }
}, },
"es6-promise": {
"version": "4.2.8",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
"integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==",
"dev": true
},
"es6-promisify": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
"integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=",
"dev": true,
"requires": {
"es6-promise": "^4.0.3"
}
},
"escape-html": { "escape-html": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
@ -5501,8 +5544,7 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -5523,14 +5565,12 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -5545,20 +5585,17 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -5675,8 +5712,7 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -5688,7 +5724,6 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -5703,7 +5738,6 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -5711,14 +5745,12 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -5737,7 +5769,6 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -5818,8 +5849,7 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -5831,7 +5861,6 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -5917,8 +5946,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -5954,7 +5982,6 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -5974,7 +6001,6 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -6018,14 +6044,12 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
} }
} }
}, },
@ -6684,6 +6708,16 @@
"integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=",
"dev": true "dev": true
}, },
"https-proxy-agent": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz",
"integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==",
"dev": true,
"requires": {
"agent-base": "^4.3.0",
"debug": "^3.1.0"
}
},
"iconv-lite": { "iconv-lite": {
"version": "0.4.24", "version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
@ -6734,6 +6768,15 @@
"integrity": "sha1-tJ7yJ0va/NikiAqWa/440aC/RnE=", "integrity": "sha1-tJ7yJ0va/NikiAqWa/440aC/RnE=",
"dev": true "dev": true
}, },
"ignore-walk": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz",
"integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==",
"dev": true,
"requires": {
"minimatch": "^3.0.4"
}
},
"import-cwd": { "import-cwd": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-2.1.0.tgz", "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-2.1.0.tgz",
@ -13302,6 +13345,25 @@
"inherits": "2" "inherits": "2"
} }
}, },
"teeny-request": {
"version": "3.11.3",
"resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-3.11.3.tgz",
"integrity": "sha512-CKncqSF7sH6p4rzCgkb/z/Pcos5efl0DmolzvlqRQUNcpRIruOhY9+T1FsIlyEbfWd7MsFpodROOwHYh2BaXzw==",
"dev": true,
"requires": {
"https-proxy-agent": "^2.2.1",
"node-fetch": "^2.2.0",
"uuid": "^3.3.2"
},
"dependencies": {
"node-fetch": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==",
"dev": true
}
}
},
"terser": { "terser": {
"version": "4.2.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/terser/-/terser-4.2.0.tgz", "resolved": "https://registry.npmjs.org/terser/-/terser-4.2.0.tgz",
@ -14120,6 +14182,12 @@
"requires-port": "^1.0.0" "requires-port": "^1.0.0"
} }
}, },
"urlgrey": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-0.4.4.tgz",
"integrity": "sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8=",
"dev": true
},
"use": { "use": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",

View File

@ -36,6 +36,8 @@
"compile": "./script/build", "compile": "./script/build",
"pretest": "./script/build", "pretest": "./script/build",
"test": "npm run tslint && npm run sasslint && jest --silent 2>&1", "test": "npm run tslint && npm run sasslint && jest --silent 2>&1",
"test-ci": "npm run tslint && npm run sasslint && jest --coverage",
"codecov": "codecov --disable=gcov -p ..",
"coverage": "jest --coverage", "coverage": "jest --coverage",
"update-snapshots": "jest -u", "update-snapshots": "jest -u",
"tslint": "./node_modules/.bin/tslint -c tslint.json --project tsconfig.json --formatters-dir ./node_modules/awesome-code-style/formatter 'src/**/*.ts?(x)'", "tslint": "./node_modules/.bin/tslint -c tslint.json --project tsconfig.json --formatters-dir ./node_modules/awesome-code-style/formatter 'src/**/*.ts?(x)'",
@ -104,6 +106,7 @@
"autoprefixer": "^9.6.1", "autoprefixer": "^9.6.1",
"awesome-code-style": "^1.4.3", "awesome-code-style": "^1.4.3",
"babel-loader": "^8.0.6", "babel-loader": "^8.0.6",
"codecov": "^3.5.0",
"css-loader": "^3.2.0", "css-loader": "^3.2.0",
"enzyme": "^3.10.0", "enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0", "enzyme-adapter-react-16": "^1.14.0",

View File

@ -84,7 +84,7 @@
</goals> </goals>
<phase>test</phase> <phase>test</phase>
<configuration> <configuration>
<arguments>test</arguments> <arguments>run test-ci</arguments>
<workingDirectory>${project.build.directory}</workingDirectory> <workingDirectory>${project.build.directory}</workingDirectory>
</configuration> </configuration>
</execution> </execution>