Skip to content

Commit

Permalink
Update codecov and pushing coverage for trend per package (istio#4160)
Browse files Browse the repository at this point in the history
* Adds encrypted file for service account

* Update codecov requirement

* Re-enable codecov and publish trends on postsubmit
  • Loading branch information
sebastienvas authored Mar 12, 2018
1 parent 134f4e1 commit 1b58979
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 46 deletions.
Binary file not shown.
2 changes: 0 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,6 @@ jobs:
environment:
KUBECONFIG: /go/src/istio.io/istio/.circleci/config
ISTIO_BIN: /go/bin
# Skip enforcement of coverage until integration tests are measured.
CODECOV_NO_ENFORCE: true
steps:
- checkout
- run: make submodule-sync
Expand Down
29 changes: 16 additions & 13 deletions bin/codecov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ parse_skipped_tests

echo "Code coverage test (concurrency ${MAXPROCS})"
for P in $(go list ${DIR} | grep -v vendor); do
#FIXME remove mixer tools exclusion after tests can be run without bazel
if echo ${P} | grep -q "${SKIPPED_TESTS_GREP_ARGS}"; then
echo "Skipped ${P}"
continue
Expand Down Expand Up @@ -100,19 +99,23 @@ if [[ -n ${FAILED_TESTS:-} ]]; then
exit 1
fi

PKG_CHECK_ARGS=(--bucket='' )
if [[ -n "${CIRCLE_BUILD_NUM:-}" ]]; then
if [[ -z "${CIRCLE_PR_NUMBER:-}" ]]; then
TMP_SA_JSON=$(mktemp /tmp/XXXXX.json)
ENCRYPTED_SA_JSON="${ROOTDIR}/.circleci/accounts/istio-circle-ci.gcp.serviceaccount"
openssl aes-256-cbc -d -in "${ENCRYPTED_SA_JSON}" -out "${TMP_SA_JSON}" -k "${GCS_BUCKET_TOKEN}"
# only pushing data on post submit
PKG_CHECK_ARGS=( --build_id="${CIRCLE_BUILD_NUM}"
--job_name="istio/${CIRCLE_JOB}_${CIRCLE_BRANCH}"
--service_account="${TMP_SA_JSON}"
)
fi
fi

echo 'Checking package coverage'
go get -u istio.io/test-infra/toolbox/pkg_check

if [ "$CODECOV_NO_ENFORCE" == "true" ] ; then
# Coverage doesn't yet take into account files used for or covered by integration tests,
# only looks for unit test coverage. It can be enforced once real coverage can be measured.
pkg_check \
--bucket= \
--report_file=/go/out/codecov/codecov.report \
--requirement_file=codecov.requirement || true
else
pkg_check \
--bucket= \
--report_file=${FINAL_CODECOV_DIR}/codecov.report \
--requirement_file=codecov.requirement
fi
--alsologtostderr \
--requirement_file=codecov.requirement "${PKG_CHECK_ARGS[@]}"
61 changes: 30 additions & 31 deletions codecov.requirement
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ istio.io/istio/broker/cmd/brks/cmd:0 [0.0]
istio.io/istio/broker/cmd/shared:0 [0.0]
istio.io/istio/broker/pkg/controller:38 [40.7]
istio.io/istio/broker/pkg/model/config:57 [59.0]
istio.io/istio/broker/pkg/model/osb:98 [100.0]
istio.io/istio/broker/pkg/model/osb:100 [100.0]
istio.io/istio/broker/pkg/platform/kube/crd:58 [60.7]
istio.io/istio/broker/pkg/server:0 [0.0]
istio.io/istio/broker/pkg/testing/mock:0 [0.0]
Expand All @@ -19,11 +19,11 @@ istio.io/istio/galley/pkg:0 [0.0]
istio.io/istio/istioctl/cmd/istioctl:0 [0.0]
istio.io/istio/istioctl/cmd/istioctl/gendeployment:26 [28.4]
istio.io/istio/mixer/adapter:0 [0.0]
istio.io/istio/mixer/adapter/circonus:61 [63.9]
istio.io/istio/mixer/adapter/circonus:61 [68.9]
istio.io/istio/mixer/adapter/circonus/config:0 [0.0]
istio.io/istio/mixer/adapter/denier:100 [100.0]
istio.io/istio/mixer/adapter/denier/config:0 [0.0]
istio.io/istio/mixer/adapter/dogstatsd:98 [100.0]
istio.io/istio/mixer/adapter/dogstatsd:100 [100.0]
istio.io/istio/mixer/adapter/dogstatsd/config:0 [0.0]
istio.io/istio/mixer/adapter/fluentd:72 [74.4]
istio.io/istio/mixer/adapter/fluentd/config:0 [0.0]
Expand All @@ -34,7 +34,7 @@ istio.io/istio/mixer/adapter/list:100 [100.0]
istio.io/istio/mixer/adapter/list/config:0 [0.0]
istio.io/istio/mixer/adapter/memquota:100 [100.0]
istio.io/istio/mixer/adapter/memquota/config:0 [0.0]
istio.io/istio/mixer/adapter/noop:98 [100.0]
istio.io/istio/mixer/adapter/noop:100 [100.0]
istio.io/istio/mixer/adapter/opa:78 [80.4]
istio.io/istio/mixer/adapter/opa/config:0 [0.0]
istio.io/istio/mixer/adapter/prometheus:83 [85.7]
Expand All @@ -48,7 +48,7 @@ istio.io/istio/mixer/adapter/servicecontrol/config:0 [0.0]
istio.io/istio/mixer/adapter/servicecontrol/template/servicecontrolreport:0 [0.0]
istio.io/istio/mixer/adapter/solarwinds:48 [50.9]
istio.io/istio/mixer/adapter/solarwinds/config:0 [0.0]
istio.io/istio/mixer/adapter/solarwinds/internal/appoptics:70 [72.5]
istio.io/istio/mixer/adapter/solarwinds/internal/appoptics:76 [78.9]
istio.io/istio/mixer/adapter/solarwinds/internal/papertrail:55 [57.7]
istio.io/istio/mixer/adapter/stackdriver:70 [72.7]
istio.io/istio/mixer/adapter/stackdriver/config:0 [0.0]
Expand All @@ -69,7 +69,7 @@ istio.io/istio/mixer/pkg/adapter/test:0 [0.0]
istio.io/istio/mixer/pkg/api:78 [80.3]
istio.io/istio/mixer/pkg/attribute:100 [100.0]
istio.io/istio/mixer/pkg/config:84 [86.1]
istio.io/istio/mixer/pkg/config/crd:66 [68.5]
istio.io/istio/mixer/pkg/config/crd:66 [68.2]
istio.io/istio/mixer/pkg/config/store:90 [92.1]
istio.io/istio/mixer/pkg/config/storetest:63 [65.5]
istio.io/istio/mixer/pkg/expr:95 [97.2]
Expand All @@ -83,17 +83,17 @@ istio.io/istio/mixer/pkg/il/testing:0 [0.0]
istio.io/istio/mixer/pkg/il/text:94 [96.5]
istio.io/istio/mixer/pkg/mockapi:87 [89.9]
istio.io/istio/mixer/pkg/perf:72 [74.9]
istio.io/istio/mixer/pkg/pool:98 [100.0]
istio.io/istio/mixer/pkg/pool:100 [100.0]
istio.io/istio/mixer/pkg/runtime:90 [92.8]
istio.io/istio/mixer/pkg/runtime2:98 [100.0]
istio.io/istio/mixer/pkg/runtime2/config:98 [100.0]
istio.io/istio/mixer/pkg/runtime2:100 [100.0]
istio.io/istio/mixer/pkg/runtime2/config:100 [100.0]
istio.io/istio/mixer/pkg/runtime2/dispatcher:96 [98.4]
istio.io/istio/mixer/pkg/runtime2/handler:94 [96.9]
istio.io/istio/mixer/pkg/runtime2/routing:98 [100.0]
istio.io/istio/mixer/pkg/runtime2/testing/data:0 [0.0]
istio.io/istio/mixer/pkg/runtime2/routing:100 [100.0]
istio.io/istio/mixer/pkg/runtime2/testing/data:2 [4.6]
istio.io/istio/mixer/pkg/runtime2/testing/util:0 [0.0]
istio.io/istio/mixer/pkg/server:83 [85.3]
istio.io/istio/mixer/pkg/status:99 [99.1]
istio.io/istio/mixer/pkg/server:97 [99.4]
istio.io/istio/mixer/pkg/status:77 [79.3]
istio.io/istio/mixer/pkg/template:46 [48.9]
istio.io/istio/mixer/template:0 [0.0]
istio.io/istio/mixer/template/apikey:0 [0.0]
Expand Down Expand Up @@ -143,40 +143,39 @@ istio.io/istio/pilot/cmd:0 [0.0]
istio.io/istio/pilot/cmd/pilot-agent:0 [0.0]
istio.io/istio/pilot/cmd/pilot-discovery:0 [0.0]
istio.io/istio/pilot/cmd/sidecar-injector:0 [0.0]
istio.io/istio/pilot/pkg/bootstrap:50 [52.3]
istio.io/istio/pilot/pkg/config/aggregate:64 [66.7]
istio.io/istio/pilot/pkg/bootstrap:52 [54.2]
istio.io/istio/pilot/pkg/config/aggregate:79 [81.5]
istio.io/istio/pilot/pkg/config/clusterregistry:73 [75.9]
istio.io/istio/pilot/pkg/config/kube/crd:69 [71.7]
istio.io/istio/pilot/pkg/config/kube/crd:70 [72.0]
istio.io/istio/pilot/pkg/config/kube/ingress:94 [96.5]
istio.io/istio/pilot/pkg/config/memory:94 [96.4]
istio.io/istio/pilot/pkg/config/monitor:81 [83.3]
istio.io/istio/pilot/pkg/kube/admit:50 [52.8]
istio.io/istio/pilot/pkg/kube/admit/testcerts:0 [0.0]
istio.io/istio/pilot/pkg/kube/inject:82 [84.1]
istio.io/istio/pilot/pkg/model:85 [87.6]
istio.io/istio/pilot/pkg/model:85 [87.9]
istio.io/istio/pilot/pkg/model/test:0 [0.0]
istio.io/istio/pilot/pkg/model/v2:0 [0.0]
istio.io/istio/pilot/pkg/proxy:63 [65.1]
istio.io/istio/pilot/pkg/proxy/envoy/v1:83 [85.3]
istio.io/istio/pilot/pkg/proxy/envoy/v1/mock:44 [46.9]
istio.io/istio/pilot/pkg/proxy/envoy/v2:65 [67.4]
istio.io/istio/pilot/pkg/proxy/envoy/v2/rds:0 [0.0]
istio.io/istio/pilot/pkg/proxy/envoy/v1:83 [85.8]
istio.io/istio/pilot/pkg/proxy/envoy/v1/mock:44 [46.2]
istio.io/istio/pilot/pkg/proxy/envoy/v2:28 [30.8]
istio.io/istio/pilot/pkg/serviceregistry:0 [0.0]
istio.io/istio/pilot/pkg/serviceregistry/aggregate:75 [77.8]
istio.io/istio/pilot/pkg/serviceregistry/cloudfoundry:90 [92.2]
istio.io/istio/pilot/pkg/serviceregistry/consul:59 [61.2]
istio.io/istio/pilot/pkg/serviceregistry/eureka:85 [87.3]
istio.io/istio/pilot/pkg/serviceregistry/kube:66 [68.1]
istio.io/istio/pilot/pkg/serviceregistry/kube:66 [68.5]
istio.io/istio/pilot/test/client:0 [0.0]
istio.io/istio/pilot/test/eurekamirror:0 [0.0]
istio.io/istio/pilot/test/grpcecho:0 [0.0]
istio.io/istio/pilot/test/mock:0 [0.0]
istio.io/istio/pilot/test/server:0 [0.0]
istio.io/istio/pilot/test/util:0 [0.0]
istio.io/istio/pkg/bootstrap:81 [83.9]
istio.io/istio/pilot/tools:0 [0.0]
istio.io/istio/pkg/bootstrap:51 [53.7]
istio.io/istio/pkg/cache:100 [100.0]
istio.io/istio/pkg/collateral:0 [0.0]
istio.io/istio/pkg/log:9100 [100.0]
istio.io/istio/pkg/log:100 [100.0]
istio.io/istio/pkg/probe:88 [90.0]
istio.io/istio/pkg/tracing:100 [100.0]
istio.io/istio/pkg/util:0 [0.0]
Expand All @@ -198,21 +197,21 @@ istio.io/istio/security/cmd/node_agent_k8s/workloadhandler:0 [0.0]
istio.io/istio/security/pkg/caclient:89 [91.7]
istio.io/istio/security/pkg/caclient/grpc:91 [93.8]
istio.io/istio/security/pkg/caclient/grpc/mock:0 [0.0]
istio.io/istio/security/pkg/cmd:12 [14.3]
istio.io/istio/security/pkg/cmd:62 [64.3]
istio.io/istio/security/pkg/credential:0 [0.0]
istio.io/istio/security/pkg/pki/ca:68 [70.7]
istio.io/istio/security/pkg/pki/ca/controller:75 [77.3]
istio.io/istio/security/pkg/pki/ca/mock:0 [0.0]
istio.io/istio/security/pkg/pki/util:76 [78.7]
istio.io/istio/security/pkg/pki/util:88 [90.4]
istio.io/istio/security/pkg/pki/util/mock:0 [0.0]
istio.io/istio/security/pkg/platform:71 [73.7]
istio.io/istio/security/pkg/platform/mock:0 [0.0]
istio.io/istio/security/pkg/probe:68 [70.9]
istio.io/istio/security/pkg/registry:78 [80.8]
istio.io/istio/security/pkg/registry/kube:74 [76.5]
istio.io/istio/security/pkg/server/grpc:76 [78.8]
istio.io/istio/security/pkg/registry:100 [100.0]
istio.io/istio/security/pkg/registry/kube:78 [80.4]
istio.io/istio/security/pkg/server/grpc:87 [89.4]
istio.io/istio/security/pkg/util:83 [85.7]
istio.io/istio/security/pkg/util/mock:0 [0.0]
istio.io/istio/security/pkg/workload:59 [61.4]
istio.io/istio/security/pkg/workload:73 [75.8]
istio.io/istio/security/proto:0 [0.0]
istio.io/istio/tools/githubContrib:4 [6.6]

0 comments on commit 1b58979

Please sign in to comment.