dgraph-operator-archive icon indicating copy to clipboard operation
dgraph-operator-archive copied to clipboard

Add unit tests to for dgraph operator

Open fristonio opened this issue 5 years ago • 1 comments

The unit tests added in this PR use gomega for assertions. I have been looking at the alternatives we can use for testing purposes within the operator. As discussed offline I think that we can use ginkgo with gomega. Though using go test alone can work for us, I think it makes more sense to use a more verbose testing framework for the operator end to end tests. Ginkgo is already being popularly adopted by the Kubernetes community with a lot of CNCF projects already using it including kubernetes itself. Ginkgo provides a lot of benefits for writing e2e test framework for the project which includes:

  • Focusing on a particular test and running it with the specified parallelism.
  • Running each test spec in a clean copy of the state to avoid leakage between tests.

Apart from this, the syntax used for writing ginkgo tests is quite verbose. A lot of popular operators are also using ginkgo for testing like tidb-operator.


This change is Reviewable

fristonio avatar Feb 12 '20 15:02 fristonio

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Apr 29 '22 07:04 CLAassistant