Class: Datadog::CI::TestImpactAnalysis::NullComponent

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/ci/test_impact_analysis/null_component.rb

Overview

No-op implementation used when test impact analysis is disabled.

Constant Summary collapse

FILE_STORAGE_KEY =
"test_impact_analysis_component_state"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ NullComponent

Returns a new instance of NullComponent.



17
18
19
20
21
22
23
24
25
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 17

def initialize
  @enabled = false
  @test_skipping_enabled = false
  @code_coverage_enabled = false
  @skippable_tests = Set.new
  @skippable_suites = Set.new
  @correlation_id = nil
  @test_skipping_mode = Ext::Test::TIATestSkippingMode::TEST
end

Instance Attribute Details

#code_coverage_enabled ⇒ Object (readonly)

Returns the value of attribute code_coverage_enabled.



14
15
16
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 14

def code_coverage_enabled
  @code_coverage_enabled
end

#correlation_id ⇒ Object (readonly)

Returns the value of attribute correlation_id.



14
15
16
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 14

def correlation_id
  @correlation_id
end

#enabled ⇒ Object (readonly)

Returns the value of attribute enabled.



14
15
16
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 14

def enabled
  @enabled
end

#skippable_suites ⇒ Object (readonly)

Returns the value of attribute skippable_suites.



14
15
16
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 14

def skippable_suites
  @skippable_suites
end

#skippable_tests ⇒ Object (readonly)

Returns the value of attribute skippable_tests.



14
15
16
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 14

def skippable_tests
  @skippable_tests
end

#test_skipping_enabled ⇒ Object (readonly)

Returns the value of attribute test_skipping_enabled.



14
15
16
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 14

def test_skipping_enabled
  @test_skipping_enabled
end

#test_skipping_mode ⇒ Object (readonly)

Returns the value of attribute test_skipping_mode.



14
15
16
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 14

def test_skipping_mode
  @test_skipping_mode
end

Instance Method Details

#clear_context_coverage(_context_id) ⇒ Object



78
79
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 78

def clear_context_coverage(_context_id)
end

#code_coverage? ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 50

def code_coverage?
  false
end

#configure(_remote_configuration = nil, _test_session = nil) ⇒ Object



27
28
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 27

def configure(_remote_configuration = nil, _test_session = nil)
end

#context_coverage_enabled? ⇒ Boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 81

def context_coverage_enabled?
  false
end

#enabled? ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 30

def enabled?
  false
end

#mark_if_skippable(_test) ⇒ Object



85
86
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 85

def mark_if_skippable(_test)
end

#mark_if_suite_skippable(_test_suite) ⇒ Object



99
100
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 99

def mark_if_suite_skippable(_test_suite)
end

#on_test_context_started(_context_id) ⇒ Object



61
62
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 61

def on_test_context_started(_context_id)
end

#on_test_finished(_test, _context) ⇒ Object



67
68
69
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 67

def on_test_finished(_test, _context)
  nil
end

#on_test_started(_test) ⇒ Object



64
65
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 64

def on_test_started(_test)
end

#on_test_suite_finished(_test_suite, _context) ⇒ Object



74
75
76
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 74

def on_test_suite_finished(_test_suite, _context)
  nil
end

#on_test_suite_started(_test_suite) ⇒ Object



71
72
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 71

def on_test_suite_started(_test_suite)
end

#restore_state(_state) ⇒ Object



113
114
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 113

def restore_state(_state)
end

#restore_state_from_datadog_test_runner ⇒ Object



120
121
122
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 120

def restore_state_from_datadog_test_runner
  false
end

#serialize_state ⇒ Object



105
106
107
108
109
110
111
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 105

def serialize_state
  {
    correlation_id: @correlation_id,
    skippable_tests: @skippable_tests,
    skippable_suites: @skippable_suites
  }
end

#shutdown! ⇒ Object



102
103
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 102

def shutdown!
end

#skippable?(_datadog_test_id) ⇒ Boolean

Returns:

  • (Boolean)


88
89
90
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 88

def skippable?(_datadog_test_id)
  false
end

#skippable_suite?(_test_suite_name) ⇒ Boolean

Returns:

  • (Boolean)


92
93
94
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 92

def skippable_suite?(_test_suite_name)
  false
end

#skipping_suites? ⇒ Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 38

def skipping_suites?
  false
end

#skipping_tests? ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 34

def skipping_tests?
  false
end

#start_coverage ⇒ Object



54
55
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 54

def start_coverage
end

#stop_coverage ⇒ Object



57
58
59
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 57

def stop_coverage
  nil
end

#storage_key ⇒ Object



116
117
118
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 116

def storage_key
  FILE_STORAGE_KEY
end

#suite_skipping_mode? ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 46

def suite_skipping_mode?
  false
end

#test_skipping_mode? ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 42

def test_skipping_mode?
  false
end

#write_test_session_tags(_test_session, _skipped_tests_count) ⇒ Object



96
97
# File 'lib/datadog/ci/test_impact_analysis/null_component.rb', line 96

def write_test_session_tags(_test_session, _skipped_tests_count)
end