Sha256: f398588adc2337a7425a38fa2400616fa782ee2e910574d7ecbc4529bcee69e9

Contents?: true

Size: 887 Bytes

Versions: 12

Compression:

Stored size: 887 Bytes

Contents

# typed: true

require_relative '../flush'

module Datadog
  module CI
    module Configuration
      # Adds CI behavior to Datadog trace components
      module Components
        def initialize(settings)
          # Activate CI mode if enabled
          activate_ci!(settings) if settings.ci.enabled

          # Initialize normally
          super
        end

        def activate_ci!(settings)
          # Activate underlying tracing test mode
          settings.tracing.test_mode.enabled = true

          # Choose user defined TraceFlush or default to CI TraceFlush
          settings.tracing.test_mode.trace_flush = settings.ci.trace_flush \
                                             || CI::Flush::Finished.new

          # Pass through any other options
          settings.tracing.test_mode.writer_options = settings.ci.writer_options
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ddtrace-1.9.0 lib/datadog/ci/configuration/components.rb
ddtrace-1.8.0 lib/datadog/ci/configuration/components.rb
ddtrace-1.7.0 lib/datadog/ci/configuration/components.rb
ddtrace-1.6.1 lib/datadog/ci/configuration/components.rb
ddtrace-1.6.0 lib/datadog/ci/configuration/components.rb
ddtrace-1.5.2 lib/datadog/ci/configuration/components.rb
ddtrace-1.5.1 lib/datadog/ci/configuration/components.rb
ddtrace-1.5.0 lib/datadog/ci/configuration/components.rb
ddtrace-1.4.2 lib/datadog/ci/configuration/components.rb
ddtrace-1.4.1 lib/datadog/ci/configuration/components.rb
ddtrace-1.4.0 lib/datadog/ci/configuration/components.rb
ddtrace-1.3.0 lib/datadog/ci/configuration/components.rb