diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2017-10-09 12:08:50 +0300 |
---|---|---|
committer | Jacob Vosmaer (GitLab) <jacob@gitlab.com> | 2017-10-09 12:08:50 +0300 |
commit | 8fa34beb8aff6cfc0ab75ad88fc8495c85816b16 (patch) | |
tree | 7777dae2c79a3d8b8aee8114d77de75bee05eaae | |
parent | 7d83fffa7bdf55e9e0536e756545747d0c86453f (diff) |
Use codecov for better code coverage reporting
-rw-r--r-- | .codecov.yml | 10 | ||||
-rw-r--r-- | .gitlab-ci.yml | 2 | ||||
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | internal/middleware/limithandler/concurrency_limiter_test.go | 2 |
5 files changed, 20 insertions, 8 deletions
diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 000000000..19eed7b0b --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,10 @@ +ignore: + - "_support" + - "_build" + - "vendor" + - "ruby/vendor" + +comment: + layout: "diff, flags, files" + require_changes: fale + behavior: default diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f004335b9..2250c4c2b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,6 +41,8 @@ cover: stage: build_test script: - make cover + after_script: + - bash <(curl -s https://codecov.io/bash) -t "${CODECOV_TOKEN}" -f _build/cover/all.merged -F unittests artifacts: paths: - _build/cover/all.html @@ -84,17 +84,17 @@ govendor-status: $(TARGET_SETUP) $(GOVENDOR) $(TEST_REPO): git clone --bare https://gitlab.com/gitlab-org/gitlab-test.git $@ +.PHONY: prepare-tests +prepare-tests: $(TARGET_SETUP) $(TEST_REPO) .ruby-bundle + .PHONY: test -test: $(TARGET_SETUP) $(TEST_REPO) prepare-tests .ruby-bundle +test: prepare-tests @go test $(LOCAL_PACKAGES) .PHONY: test-changes -test-changes: $(TARGET_SETUP) $(TEST_REPO) prepare-tests .ruby-bundle +test-changes: prepare-tests cd $(PKG_BUILD_DIR) && go test $(CHANGED_LOCAL_GO_PACKAGES) -.PHONY: prepare-tests -prepare-tests: $(TARGET_SETUP) $(TEST_REPO) - .PHONY: lint lint: $(GOLINT) go run _support/lint.go @@ -134,7 +134,7 @@ clean: rm -rf $(TARGET_DIR) $(TEST_REPO) $(TEST_REPO_STORAGE_PATH) ./internal/service/ssh/gitaly-*-pack .ruby-bundle .PHONY: cover -cover: $(TARGET_SETUP) $(TEST_REPO) $(GOCOVMERGE) +cover: prepare-tests $(GOCOVMERGE) @echo "NOTE: make cover does not exit 1 on failure, don't use it to check for tests success!" mkdir -p "$(COVERAGE_DIR)" rm -f $(COVERAGE_DIR)/*.out "$(COVERAGE_DIR)/all.merged" "$(COVERAGE_DIR)/all.html" @@ -1,6 +1,6 @@ # ![Gitaly](https://gitlab.com/gitlab-org/gitaly/uploads/509123ed56bd51247996038c858db006/gitaly-wordmark-small.png) -[![build status](https://gitlab.com/gitlab-org/gitaly/badges/master/build.svg)](https://gitlab.com/gitlab-org/gitaly/commits/master) [![Gem Version](https://badge.fury.io/rb/gitaly.svg)](https://badge.fury.io/rb/gitaly) [![coverage report](https://gitlab.com/gitlab-org/gitaly/badges/master/coverage.svg)](https://gitlab.com/gitlab-org/gitaly/commits/master) +[![build status](https://gitlab.com/gitlab-org/gitaly/badges/master/build.svg)](https://gitlab.com/gitlab-org/gitaly/commits/master) [![Gem Version](https://badge.fury.io/rb/gitaly.svg)](https://badge.fury.io/rb/gitaly) [![coverage report](https://gitlab.com/gitlab-org/gitaly/badges/master/coverage.svg)](https://codecov.io/gl/gitlab-org/gitaly) **Quick Links**: [**Migration Board**](https://gitlab.com/gitlab-org/gitaly/boards/331341?scope=all&utf8=%E2%9C%93&state=opened&label_name[]=Migration) | diff --git a/internal/middleware/limithandler/concurrency_limiter_test.go b/internal/middleware/limithandler/concurrency_limiter_test.go index be7acb8f4..d11449e34 100644 --- a/internal/middleware/limithandler/concurrency_limiter_test.go +++ b/internal/middleware/limithandler/concurrency_limiter_test.go @@ -110,7 +110,7 @@ func TestLimiter(t *testing.T) { iterations: 200, delay: 1000 * time.Nanosecond, buckets: 1, - wantMaxRange: []int{10, 10}, + wantMaxRange: []int{8, 10}, wantMonitorCalls: false, }, { |