-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
add exclusion of transact test by name
Showing
5 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require "support/copy_cat" | ||
|
||
# CockroachDB doesn't update schema information when adding an | ||
# index until the transaction is done. Hence impossible to delete | ||
# this index before completion of the transaction. | ||
exclude_from_transactional_tests :test_in_batches_iterating_using_custom_columns | ||
exclude_from_transactional_tests :test_in_batches_with_custom_columns_raises_when_non_unique_columns | ||
exclude_from_transactional_tests :test_in_batches_when_loaded_iterates_using_custom_column |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,2 @@ | ||
require "support/copy_cat" | ||
|
||
class CockroachDB < MultiDbMigratorTest | ||
self.use_transactional_tests = false | ||
|
||
CopyCat.copy_methods(self, MultiDbMigratorTest, :test_internal_metadata_stores_environment) | ||
end | ||
|
||
exclude :test_internal_metadata_stores_environment, "We can't add " \ | ||
"and remove a column in the same transaction with CockroachDB" | ||
# We can't add and remove a column in the same transaction with CockroachDB | ||
exclude_from_transactional_tests :test_internal_metadata_stores_environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
# Allow exclusion of tests by name using #exclude_from_transactional_tests(test_name) | ||
module ExcludeFromTransactionalTests | ||
module ClassMethods | ||
def exclude_from_transactional_tests(name) | ||
@non_transactional_list ||= [] | ||
@non_transactional_list << name.to_s | ||
end | ||
|
||
def non_transactional_list | ||
@non_transactional_list ||= [] | ||
end | ||
end | ||
|
||
def self.prepended(base) | ||
base.extend ClassMethods | ||
end | ||
|
||
def before_setup | ||
# binding.irb if self.class.non_transactional_list.include?(@NAME.to_s) | ||
@old_use_transactional_tests = self.use_transactional_tests | ||
if @old_use_transactional_tests # stay false if false | ||
self.use_transactional_tests = !self.class.non_transactional_list.include?(@NAME.to_s) | ||
end | ||
super | ||
end | ||
|
||
def after_teardown | ||
super | ||
ensure | ||
self.use_transactional_tests = @old_use_transactional_tests | ||
end | ||
end |