Skip to content

Commit

Permalink
Set atomic coverage mode and configure CircleCI to wait for all build…
Browse files Browse the repository at this point in the history
…s before publishing coverage (#3369)
  • Loading branch information
anorth authored Sep 11, 2019
1 parent 40c92d8 commit 222d7a1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ jobs:
unit_test_linux:
docker:
- image: circleci/golang:1.12.1-stretch
parallelism: 3
parallelism: 2 # Check .codecov.yml "after_n_builds" if changing this
working_directory: /go/src/github.com/filecoin-project/go-filecoin
resource_class: large
steps:
Expand Down Expand Up @@ -270,7 +270,7 @@ jobs:
integration_test_linux:
docker:
- image: circleci/golang:1.12.1-stretch
parallelism: 3
parallelism: 2 # Check .codecov.yml "after_n_builds" if changing this
working_directory: /go/src/github.com/filecoin-project/go-filecoin
resource_class: xlarge
steps:
Expand Down Expand Up @@ -784,7 +784,7 @@ commands:
trap "go run github.com/jstemmer/go-junit-report < test-results/go-test-suite/go-test.out > test-results/go-test-suite/go-test-report.xml" EXIT
export TEST_PACKAGES="$(go list ./... | circleci tests split)"
# Parallelism and timeout set to support medium-class containers, for builds on forked repos.
go run ./build test -cover -coverprofile coverage.out -timeout=30m -parallel=4 -functional=<< parameters.functional >> -integration=<< parameters.integration >> -sectorbuilder=<< parameters.sector_builder_tests >> -unit=<< parameters.unit >> -v 2>&1 | tee test-results/go-test-suite/go-test.out
go run ./build test -cover -coverprofile coverage.out -covermode=atomic -timeout=30m -parallel=4 -functional=<< parameters.functional >> -integration=<< parameters.integration >> -sectorbuilder=<< parameters.sector_builder_tests >> -unit=<< parameters.unit >> -v 2>&1 | tee test-results/go-test-suite/go-test.out
mkdir -p /tmp/artifacts
mv coverage.out /tmp/artifacts/coverage.out
- codecov/upload:
Expand Down
32 changes: 22 additions & 10 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
# "documentation": https://gist.github.com/stevepeak/53bee7b2c326b24a9b4a
coverage:
range: 50..100
round: down
precision: 0

status:
project: off
patch: off
changes: off
project: false
patch: false
changes: false

comment: off
# layout: "diff, flags, files"
# behavior: default
# require_changes: false # if true: only post the comment if coverage changes
# require_base: yes # [yes :: must have a base report to post]
# require_head: yes # [yes :: must have a head report to post]
# branches: null # branch names that can post comment
# https://docs.codecov.io/docs/pull-request-comments
comment:
layout: "diff" # "diff, flags, files"
behavior: default
require_changes: false # if true: only post the comment if coverage changes
require_base: true # [yes :: must have a base report to post]
require_head: true # [yes :: must have a head report to post]
branches: [] # branch names that can post comment

ignore:
- "*/testing.go"

codecov:
notify:
# yes: will delay sending notifications until all ci is finished
# no: will send notifications without checking ci status and wait till "after_n_builds" are uploaded
require_ci_to_pass: false
# number of expected builds to receive before sending notifications
# we can set this to prevent notifications of partial results due to CI parallelism
# set this with respect to the unit- and integration-test parallelism in Circle CI configuration
after_n_builds: 4

0 comments on commit 222d7a1

Please sign in to comment.