Reputation: 277
Having an internal debate as we move into CI.
One side argues that only unit tests should be included on the CI server whereas the other side argues that both unit and integration tests should be run on the server.
Just to be clear: I consider unit tests to be tests that have NO external/3rd party system dependencies (i.e., DB, File systems, web services, etc) and integration tests are those that do.
Thank you for any guidance. If you could provide references to your side of the argument, that would be appreciated.
Thanks, NB
Upvotes: 1
Views: 228
Reputation: 2427
The general idea would definitely be that integration tests should NOT be included.
However, that's a general rule and may not be true in your case. If your integration tests are stable enough that the benefit from running them regularly out weighs the disadvantages of having to maintain them, then you should include them.
I consider integration tests to be tests that rely on anything that is not included in the build output, which sounds like basically the same as your definition.
Its also not a black and white issue. There are different degrees of stability. For example in decreasing order:
Some people may suggest that with the correct use of dependency injection and mocking frameworks that there should never be a need for integration tests. I'll leave that for your team to debate.
There are also different degrees of consequences of including tests. For example failing the build upon failure of tests, or simply sending notifications and/or requiring some sort of approval point.
Here's a possible approach:
hope that helps!
Upvotes: 0