diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 95d8adb5e..fe7cdf91f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,6 +51,12 @@ docker-compose -f build/docker/docker-compose.yml up --build -d make test ``` +You can automatically check the programmatic and stylistic errors of your code. + +```sh +make lint +``` + ## Design Documents For developers, [design documents](design/README.md) about core features are provided. You can refer to the docs for understanding the overall structure of Yorkie. @@ -88,6 +94,13 @@ There are multiple types of tests. The location of the test code varies with typ - Integration: These tests cover interactions of package components or interactions between Yorkie packages and some other non-Yorkie system resource (eg: MongoDB, ETCD). - Benchmark: These confirm that the performance of the implemented function. +### Code Coverage +We are using [Codecov](https://about.codecov.io) for analyzing PR's code coverage. If you want to check the coverage of your code in local browser, you can run the command below. + +```sh +make coverage +``` + ## Contributor License Agreement (CLA) We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. @@ -98,6 +111,8 @@ Open a pull request ("PR") to any of our open source projects to sign the CLA. A Follow the steps given by the bot to sign the CLA. This will require you to log in with GitHub. We will only use this information for CLA tracking. You only have to sign the CLA once. Once you've signed the CLA, future contributions to the project will not require you to sign again. +If the bot still require you to sign the CLA although you had already signed, you can check your commit's author is equal to the Github account that you logged in. + ### Why Require a CLA? Agreeing to a CLA explicitly states that you are entitled to provide a contribution, that you cannot withdraw permission to use your contribution at a later date, and that Yorkie Team has permission to use your contribution. diff --git a/Makefile b/Makefile index b865a1793..b68b4ba1b 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,12 @@ fmt: ## applies format and simplify codes lint: ## runs the golang-ci lint, checks for lint violations golangci-lint run ./... +coverage: ## runs coverage tests + go clean -testcache + go test -tags integration -race -coverprofile=coverage.txt -covermode=atomic ./... + go tool cover -html=coverage.txt + rm -f coverage.txt + test: ## runs integration tests that require local applications such as MongoDB go clean -testcache go test -tags integration -race ./... diff --git a/server/backend/backend.go b/server/backend/backend.go index 19c5b19b3..55eeac5e9 100644 --- a/server/backend/backend.go +++ b/server/backend/backend.go @@ -163,7 +163,7 @@ func (b *Backend) Shutdown() error { logging.DefaultLogger().Error(err) } - logging.DefaultLogger().Infof("backend stoped: id: %s", b.serverInfo.ID) + logging.DefaultLogger().Infof("backend stopped: id: %s", b.serverInfo.ID) return nil }