lib/coverband-service-client.rb in coverband-service-client-0.0.3 vs lib/coverband-service-client.rb in coverband-service-client-0.0.4
- old
+ new
@@ -5,12 +5,20 @@
COVERBAND_ENV = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || (defined?(Rails) ? Rails.env : 'unknown')
COVERBAND_SERVICE_URL = ENV['COVERBAND_URL'] ||
((COVERBAND_ENV == 'development') ? 'http://127.0.0.1:3456' : 'https://coverband-service.herokuapp.com')
# TODO: This id is still hard coded
-COVERBAND_ID = ENV['COVERBAND_ID'] || 'coverband-service/coverband_service_demo'
+COVERBAND_ID = ENV['COVERBAND_ID'] || 'error/set_COVERBAND_ID'
+
module Coverband
+
+ if COVERBAND_ENV == 'test' && !ENV['COVERBAND_ENABLE_TEST_MODE']
+ def self.report_coverage
+ # for now disable coverband reporting in test env by default
+ end
+ end
+
module Adapters
###
# Take Coverband data and store a merged coverage set to the Coverband service
#
# NOTES:
@@ -168,7 +176,11 @@
# Use The Test Service Adapter
config.store = Coverband::Adapters::Service.new(COVERBAND_SERVICE_URL)
# default to tracking views true
- config.track_views = ENV['COVERBAND_DISABLE_VIEW_TRACKER'] ? false : true
+ config.track_views = ENV['COVERBAND_ENABLE_VIEW_TRACKER'] ? true : false
+
+ if COVERBAND_ENV == 'test'
+ config.background_reporting_enabled = false
+ end
end