Skipping and Testify Package
Learn about skipping tests and the testify/assert package.
We'll cover the following...
Skipping tests
Sometimes, we don’t want to execute all of our tests and would instead like to select only the relevant ones for our current needs. Some real-world examples of when this might be the case are:
- We have extremely long-running tests that should only be run intermittently.
- We have tests that only have to be run in certain environments (development, test, UAT, production, and so on).
- We want to exclude some tests in our CI/CD pipeline.
- We want to exclude some tests that rely on external resources that may not always be reliable or running.
Let’s see two ways for skipping tests that Go provides us.