Module: Datadog::CI::Configuration::Components

Defined in:
lib/datadog/ci/configuration/components.rb

Overview

Adds CI behavior to Datadog trace components

Instance Method Summary collapse

Instance Method Details

#activate_ci_mode!(settings) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/datadog/ci/configuration/components.rb', line 17

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

  # Choose user defined ContextFlush or default to CI ContextFlush
  settings.test_mode.context_flush = settings.ci_mode.context_flush \
                                     || Datadog::CI::ContextFlush::Finished.new

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

#initialize(settings) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/datadog/ci/configuration/components.rb', line 9

def initialize(settings)
  # Activate CI mode if enabled
  activate_ci_mode!(settings) if settings.ci_mode.enabled

  # Initialize normally
  super
end