Should release/deployment builds run tests again?

In many configurations of CI/CD pipelines I encounter, things run somewhat like this: compilation and tests are run on a pull request after merging, the build is triggered on the main branch, which runs the compilation and tests again when we want to deploy, we create a tag, which triggers a build that will also compile and test before deploying I sometimes wonder if running the tests in the last build isn't overkill. Sometimes, developers complain that it slows down the process. They argue that the tests have already been run for that commit. Is there anything regarded as best practice here?

Mar 31, 2025 - 09:19
 0
Should release/deployment builds run tests again?

In many configurations of CI/CD pipelines I encounter, things run somewhat like this:

  • compilation and tests are run on a pull request
  • after merging, the build is triggered on the main branch, which runs the compilation and tests again
  • when we want to deploy, we create a tag, which triggers a build that will also compile and test before deploying

I sometimes wonder if running the tests in the last build isn't overkill. Sometimes, developers complain that it slows down the process. They argue that the tests have already been run for that commit.

Is there anything regarded as best practice here?