Until now, when institutions made custom changes which made certain tests obsolete, they didn't have a clear way to deal with the failing tests. They would either: 1. Stop running the test suite 2. Run the test suite and get test failures 100% of the time 3. Comment the failing tests 4. Modify the failing tests in order to keep them in sync with the code Solution 1 would be suicide from a maintenance perspective, although it could work if only a couple of small custom changes were done. Solution 2 would make it really hard to differenciate between "false failures" and "real failures" when running the test suite. Solution 3 would cause many conflicts when updating to a newer version of Consul. Solution 4 could make sense sometimes (big tests where only one line needs to be changed), but it would also cause conflicts when updating Consul. So now, we're giving an alternative to solution 3 by making it easier to exclude a test. For tests that still need to be changed, when to use this solution combined with a custom test and when to use solution 4 will have to be decided on a per-case basis.
10 lines
392 B
Ruby
10 lines
392 B
Ruby
RSpec.configure do |config|
|
|
# Add the :consul tag to tests which make sense in the original
|
|
# version of CONSUL but don't make sense in your application due to
|
|
# the custom changes you've implemented.
|
|
#
|
|
# Using this tag will help maintaining the test suite when doing
|
|
# custom changes and when upgrading to a newer version of CONSUL
|
|
config.filter_run_excluding consul: true
|
|
end
|