Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If I test a Pull Request build, do I need to run the same tests after merging?

I'm using Travis CI that has Pull Request builds and Branch builds. I'm sure this is common to other CI services.

If I have a develop branch and a feature/A branch then when I open a pull request from feature/A targeting develop, the pull request build runs my unit tests.

Assuming my unit tests pass, I merge the pull request and a branch build triggers because of the new commit made to develop. This branch build builds my container and deploys it to a develop environment.

Should I be running the same suite of unit tests on my branch build that I did during the pull request build or is it safe to assume that because the pull request tests passed, the branch build would too? Would running these tests be wasting cycles?

like image 823
Connor Graham Avatar asked May 21 '20 14:05

Connor Graham


1 Answers

This is actually a good question and not uncommon at all, in my experience is a good idea to run the tests again, unless you are the only one making pull requests to that branch, let's say your tests runs correctly but someone made a pull request right before you, and your feature-branch is not up to date with that code, is possible that some of the code merged into the develop-branch affect some of the flows you already tested, and that may cause a fail/misbehavior on your code. One way to avoid the push of these misbehaviors to a live environment, is to run the tests again right after accepting a pull request, this will add some cycles to your pipeline but I think it could mitigate hotfixes/issues.

like image 101
r4cc00n Avatar answered Sep 19 '22 15:09

r4cc00n