spec/runners/transactions.rb in mongo-2.13.0.beta1 vs spec/runners/transactions.rb in mongo-2.13.0.rc1

- old
+ new

@@ -10,11 +10,10 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -require 'runners/transactions/context' require 'runners/transactions/operation' require 'runners/transactions/spec' require 'runners/transactions/test' def define_transactions_spec_tests(test_paths) @@ -24,24 +23,25 @@ spec = Mongo::Transactions::Spec.new(file) context(spec.description) do define_spec_tests_with_requirements(spec) do |req| + spec.tests.each do |test| - before do - if ClusterConfig.instance.topology == :sharded - if test.multiple_mongoses? && SpecConfig.instance.addresses.length == 1 - skip "Test requires multiple mongoses" - elsif !test.multiple_mongoses? && SpecConfig.instance.addresses.length > 1 - # Many transaction spec tests that do not specifically deal with - # sharded transactions fail when run against a multi-mongos cluster - skip "Test does not specify multiple mongoses" + context(test.description) do + + before(:all) do + if ClusterConfig.instance.topology == :sharded + if test.multiple_mongoses? && SpecConfig.instance.addresses.length == 1 + skip "Test requires multiple mongoses" + elsif !test.multiple_mongoses? && SpecConfig.instance.addresses.length > 1 + # Many transaction spec tests that do not specifically deal with + # sharded transactions fail when run against a multi-mongos cluster + skip "Test does not specify multiple mongoses" + end end end - end - - context(test.description) do if test.skip_reason before(:all) do skip test.skip_reason end