How do I create a QA/Testing pipeline in my CI/CD process?
Asked by
TechieBear42
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!
Answers
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.
Reply to this answer
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.
Reply to this answer
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
Reply to this answer
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.
QuickDeploy45: Looks like you've got a solid plan! Thanks for breaking that down.
Reply to this answer
Add your answer
Answers are reviewed before publication.
CuriousCat33: This is exactly the kind of resource I was hoping to find! Thanks!