8 Running automated tests with Jenkins

 

This chapter covers

  • Implementing CI pipelines for Python, Go, Node.js, and Angular-based services
  • Running pre-integration tests and automated UI testing with Headless Chrome
  • Executing SonarQube static code analysis within Jenkins pipelines
  • Running unit tests inside a Docker container and publishing code coverage reports
  • Integrating dependency checks in a Jenkins pipeline and injecting security in DevOps

In the previous chapter, you learned how to set up multibranch pipeline jobs for containerized microservices and for continuously triggering Jenkins upon push events with webhooks. In this chapter, we will run automated tests within the CI pipeline. Figure 8.1 summarizes the current CI workflow stages.

Figure 8.1 The test stages covered in this chapter

Test automation is widely considered a cornerstone of Agile development. If you want to release fast—even daily—with reasonable quality, you have to move to automated testing. On the other hand, giving less importance to testing can result in customer dissatisfaction and a delayed product. However, automating the testing process is a bit more difficult than automating the build, release, and deployment processes. Automating nearly all the test cases used in an application usually takes a lot of effort. It is an activity that matures over time. It is not always possible to automate all the testing. But the idea is to automate whatever testing is possible.

8.1 Running unit tests inside Docker containers

8.2 Automating code linter integration with Jenkins

8.3 Generating code coverage reports

8.4 Injecting security in the CI pipeline

8.5 Running parallel tests with Jenkins

8.6 Improving quality with code analysis

8.7 Running mocked database tests

8.8 Generating HTML coverage reports

8.9 Automating UI testing with Headless Chrome

8.10 Integrating SonarQube Scanner with Jenkins

Summary

sitemap