I want to force the developers to write unit tests for all new code they wrote. The code is written in python. I want to do it in the Jenkins pipeline. And here is a question. Is there any available Jenkins plugin that can do that? Or python library? I want to avoid sonar qube because I think, it's a little bit complex solution for the problem. I was thinking about a solution, that will detect changed files and check their code coverage percentage in generating a report.
2 Answers
I found a solution to my problem. There is a library diff-cover
which does exactly what i need. Here is a link -> https://diff-cover.readthedocs.io/en/latest/README.html
Many Python packages exist for that purpose, one of them is the popular coverage package.