I've set up CI/CD pipelines for Dev, Staging, and Production environments, but I've never actually built a pipeline focused on automated testing. I understand why a production pipeline usually doesn't include these tests—because the code is already vetted. However, I'm curious if anyone here has experience with building a dedicated QA/testing pipeline. What insights can you share about its integration with overall CI/CD processes? Also, I've only got about 1.5 years in DevOps, and this was my first full-time job!
4 Answers
When building your artifact, you can structure the pipeline like this:
```
unit tests/style linting/SAST/etc
-> (if pass) build
-> artifact testing (DAST, container image scans, etc.)
-> (if pass) deploy: dev
-> e2e tests: dev
-> (if pass) deploy: staging
-> e2e + regression + load tests
-> (if pass) deploy: prod
-> smoke tests
-> (if fail) roll back
```
This way, you can ensure each phase has the necessary tests.
Check out this example CI/CD pipeline that includes extensive testing: https://www.cogini.com/blog/breaking-up-the-monolith-building-testing-and-deploying-microservices/
The GitHub Actions code is really handy: https://github.com/cogini/phoenix_container_example/blob/main/.github/workflows/ci.yml
This is exactly the kind of resource I was hoping to find! Thanks!
If automated testing isn’t preventing broken changes from reaching production, you might want to reconsider its value. It’s often a good idea to integrate testing into your regular deployment pipeline as much as you can.
Start with the basics—automate your unit tests first, and then move on to integration tests. Don't overlook database testing; we use DBmaestro for that. For managing tests, platforms like GitHub Actions or Azure DevOps work great, and you can gradually expand your coverage as you get more comfortable.
Looks like you've got a solid plan! Thanks for breaking that down.