spec/lite_spec_helper.rb in mongo-2.14.0.rc1 vs spec/lite_spec_helper.rb in mongo-2.14.0
- old
+ new
@@ -1,5 +1,7 @@
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "shared", "lib"))
+
COVERAGE_MIN = 90
CURRENT_PATH = File.expand_path(File.dirname(__FILE__))
SERVER_DISCOVERY_TESTS = Dir.glob("#{CURRENT_PATH}/spec_tests/data/sdam/**/*.yml").sort
SDAM_MONITORING_TESTS = Dir.glob("#{CURRENT_PATH}/spec_tests/data/sdam_monitoring/*.yml").sort
@@ -65,12 +67,12 @@
unless SpecConfig.instance.client_debug?
Mongo::Logger.logger.level = Logger::INFO
end
Encoding.default_external = Encoding::UTF_8
+require 'mrss/lite_constraints'
require 'support/matchers'
-require 'support/lite_constraints'
require 'support/event_subscriber'
require 'support/common_shortcuts'
require 'support/client_registry'
require 'support/client_registry_macros'
require 'support/crypt'
@@ -87,11 +89,11 @@
end
RSpec.configure do |config|
config.extend(CommonShortcuts::ClassMethods)
config.include(CommonShortcuts::InstanceMethods)
- config.extend(LiteConstraints)
+ config.extend(Mrss::LiteConstraints)
config.include(ClientRegistryMacros)
if SpecConfig.instance.ci?
SdamFormatterIntegration.subscribe
config.add_formatter(JsonExtFormatter, File.join(File.dirname(__FILE__), '../tmp/rspec.json'))
@@ -104,10 +106,10 @@
SdamFormatterIntegration.assign_log_entries(example.id)
end
end
end
- if SpecConfig.instance.ci?
+ if SpecConfig.instance.ci? && !%w(1 true yes).include?(ENV['INTERACTIVE']&.downcase)
# Allow a max of 30 seconds per test.
# Tests should take under 10 seconds ideally but it seems
# we have some that run for more than 10 seconds in CI.
config.around(:each) do |example|
timeout = if %w(1 true yes).include?(ENV['STRESS']&.downcase)