pranay999000 / go-unit-test-and-ci

0 stars 0 forks source link

Test Case Review #1

Open adityapwr opened 1 year ago

adityapwr commented 1 year ago

https://github.com/pranay999000/go-unit-test-in-docker/blob/9adaf731ee39df9785c2935ac1c9278de1d99da9/Dockerfile#L13

I see you have created a go application, it lgtm. Let's first build our intuition about test cases... Why do we write a test case in the first place? What should one do with it?

pranay999000 commented 1 year ago

A test case is required to ensure that our code's functions are error-free. A programmer should write an efficient test case so that it covers every base case where our program can go wrong.

adityapwr commented 1 year ago

I see you build the test and then invoked it during container init. Can you try to run the test during build step

pranay999000 commented 1 year ago

https://github.com/pranay999000/go-unit-test-in-docker/blob/main/Dockerfile.multistage#L12

Sorry I didn't follow, I am running the test during docker image build.