From the course: Intermediate Jenkins: Automate, Integrate, and Secure CI/CD Workflows at Scale

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Publish test results and code coverage reports

Publish test results and code coverage reports

Let's use Jenkins to publish test results and code coverage reports for a Python project. You can use the exercise files for this lesson to follow along. The first stages of the pipeline set up the project by checking out code, installing dependencies, and linting the code for syntax errors. The test stage runs tests and generates two reports, a test report in JUnit format and and a code coverage report in Cobertura format. The last two stages in the pipeline are placeholders to build and deploy the application. In the post section of the pipeline, the test and code coverage reports are processed for tracking and saved as artifacts. The JUnit plugin provides the functionality for test reporting. If you installed the suggested plugins when you set up your Jenkins server, then it should already be in place for your pipelines to use. Code coverage reporting is handled by the coverage plugin. The coverage plugin is not included in the suggested plugins, so you'll have to install this one…

Contents