From 7fc83ad9d9cb465cc8ea9fb1c00059ecb6d9279a Mon Sep 17 00:00:00 2001 From: Anusha Hegde Date: Thu, 3 Mar 2022 03:11:19 +0000 Subject: [PATCH] Update Contributing Guidelines Add info on testing tools and libraries used in the project --- CONTRIBUTING.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dbcce7d1f..7d2bf280a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing Guidelines -## As a Developer +## As a Contributor ### Fork and branch Local development has to be done in the forked repo of [cluster-api-provider-bringyourownhost](https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost). Here are some examples of meaningful branch names * add-host-reservation-logic @@ -8,6 +8,13 @@ Local development has to be done in the forked repo of [cluster-api-provider-bri * fix-byomachine-controller-flakes * refactor-agent-unit-tests +### Writing tests +We expect our contributors to write unit / integration tests when making any code change. For tests like e2e, feel free to create a child issue and work on it separately. + +#### Testing Framework +- We use [Ginkgo](https://onsi.github.io/ginkgo/) and [Gomega](https://onsi.github.io/gomega/) extensively for testing (unit / integration and e2e) +- For mocking interfaces and methods, we use the [Counterfeiter](https://github.com/maxbrunsfeld/counterfeiter) tool. Use this to generate fake implementations for your unit tests. + ### Commit Message If you are pairing on a PR, make sure to use [git-duet](https://github.com/git-duet/git-duet) @@ -19,6 +26,7 @@ At the minimum, ### Raising a PR * all PRs should be raised against the main branch of [cluster-api-provider-bringyourownhost](https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost) +* all code changes should be accompanied with corresponding unit / integration tests (if for some reason, the code is not unit / integration testable, add enough justification in the PR. Although, this almost should never be the case.) ### Contributor License Agreement All contributors to this project must have a signed Contributor License