Add a way to mark tests as consul/consul exclusive

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.
This commit is contained in:
Javi Martín
2021-09-06 23:52:38 +02:00
parent a80c964121
commit fed82b0024
2 changed files with 10 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
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

View File

@@ -8,6 +8,7 @@ abort("The Rails environment is running in production mode!") if Rails.env.produ
require "rspec/rails" require "rspec/rails"
require "spec_helper" require "spec_helper"
require "custom_spec_helper"
require "capybara/rails" require "capybara/rails"
require "capybara/rspec" require "capybara/rspec"
require "selenium/webdriver" require "selenium/webdriver"