litmuschaos/admission-controllers

Add BDD and unit testcases

Opened this issue · 5 comments

Needed to build some BDD and unit testcases for admission webhook.

Tracking this here: litmuschaos/litmus#2182

@rahulchheda Can you help with getting started with this issue.

Hey @Abhishek-kumar09, sorry for the delay. So, we need to create unit tests for each of the file which is easy to do if we can leverage the use of https://godoc.org/k8s.io/client-go/kubernetes/fake. Mainly we focus on the file webhook.go which is responsible for the validation. The steps we perform for creating a Validation Webhook should be done using Fake Client, and then testcases (or choasengines and the resources it refers) should be created to check the behaviour of Admission Controllers.

@rahulchheda when adding the copyright & license info to the test file should i use 2020 or 2019 as year?

I think 2019 would be good.
WDYT @ksatchit ?

@rahulchheda, can I take this issue if it hasn’t been completed ?