The Unit Test Case Guideline Of Golang Gin

At this post, I have brief introduced how to test our gin APIs. And one test case tests one API, maybe this API including thousands functions, this kind of test we allways call Integration Test. The Integration Test always care whether the API works well or not, it does’t care the codes coverage and whether a certain function works as expect or not. So, we need to write Unit Test to ensure our program robust and keeps the issues number at a very low level....

August 24, 2023 · 10 min · wuqiangroy

How to test the APIs of your Go-Gin service?

As the pre-post said, Gin is a famouse web framework writen by Go. I love it and always use it. When I wrote a web server using Go-Gin, how do I test the APIs? This may confused me, only use a command-line tool to verify them? It’s seems ridiculous and non-product. We need to have a full-check for the APIs and it’s better to make it automatic, then we need to integrate it in the CI-CD pipline, make sure that it will run automaticly after we commit codes....

January 3, 2023 · 5 min · wuqiangroy