datadog-ci 0.1.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -1
  3. data/LICENSE-3rdparty.csv +1 -0
  4. data/README.md +64 -0
  5. data/lib/datadog/ci/configuration/components.rb +72 -5
  6. data/lib/datadog/ci/configuration/settings.rb +36 -8
  7. data/lib/datadog/ci/contrib/cucumber/configuration/settings.rb +2 -3
  8. data/lib/datadog/ci/contrib/cucumber/formatter.rb +8 -10
  9. data/lib/datadog/ci/contrib/cucumber/integration.rb +3 -5
  10. data/lib/datadog/ci/contrib/integration.rb +149 -0
  11. data/lib/datadog/ci/contrib/minitest/configuration/settings.rb +2 -3
  12. data/lib/datadog/ci/contrib/minitest/hooks.rb +8 -4
  13. data/lib/datadog/ci/contrib/minitest/integration.rb +3 -5
  14. data/lib/datadog/ci/contrib/rspec/configuration/settings.rb +2 -3
  15. data/lib/datadog/ci/contrib/rspec/example.rb +5 -8
  16. data/lib/datadog/ci/contrib/rspec/integration.rb +3 -5
  17. data/lib/datadog/ci/contrib/settings.rb +33 -0
  18. data/lib/datadog/ci/ext/environment/providers/appveyor.rb +4 -0
  19. data/lib/datadog/ci/ext/environment/providers/aws_code_pipeline.rb +39 -0
  20. data/lib/datadog/ci/ext/environment/providers/azure.rb +4 -0
  21. data/lib/datadog/ci/ext/environment/providers/base.rb +4 -0
  22. data/lib/datadog/ci/ext/environment/providers/bitbucket.rb +4 -0
  23. data/lib/datadog/ci/ext/environment/providers/bitrise.rb +4 -0
  24. data/lib/datadog/ci/ext/environment/providers/buddy.rb +4 -0
  25. data/lib/datadog/ci/ext/environment/providers/buildkite.rb +4 -0
  26. data/lib/datadog/ci/ext/environment/providers/circleci.rb +4 -0
  27. data/lib/datadog/ci/ext/environment/providers/codefresh.rb +4 -0
  28. data/lib/datadog/ci/ext/environment/providers/github_actions.rb +4 -0
  29. data/lib/datadog/ci/ext/environment/providers/gitlab.rb +4 -0
  30. data/lib/datadog/ci/ext/environment/providers/jenkins.rb +4 -0
  31. data/lib/datadog/ci/ext/environment/providers/local_git.rb +7 -0
  32. data/lib/datadog/ci/ext/environment/providers/teamcity.rb +4 -0
  33. data/lib/datadog/ci/ext/environment/providers/travis.rb +4 -0
  34. data/lib/datadog/ci/ext/environment/providers.rb +16 -14
  35. data/lib/datadog/ci/ext/settings.rb +2 -0
  36. data/lib/datadog/ci/ext/transport.rb +24 -0
  37. data/lib/datadog/ci/{test.rb → recorder.rb} +6 -5
  38. data/lib/datadog/ci/test_visibility/flush.rb +40 -0
  39. data/lib/datadog/ci/test_visibility/serializers/base.rb +161 -0
  40. data/lib/datadog/ci/test_visibility/serializers/factories/test_level.rb +30 -0
  41. data/lib/datadog/ci/test_visibility/serializers/span.rb +51 -0
  42. data/lib/datadog/ci/test_visibility/serializers/test_v1.rb +60 -0
  43. data/lib/datadog/ci/test_visibility/transport.rb +151 -0
  44. data/lib/datadog/ci/transport/api/base.rb +36 -0
  45. data/lib/datadog/ci/transport/api/builder.rb +46 -0
  46. data/lib/datadog/ci/transport/api/ci_test_cycle.rb +30 -0
  47. data/lib/datadog/ci/transport/api/evp_proxy.rb +44 -0
  48. data/lib/datadog/ci/transport/gzip.rb +22 -0
  49. data/lib/datadog/ci/transport/http.rb +77 -0
  50. data/lib/datadog/ci/version.rb +2 -2
  51. data/sig/datadog/ci/configuration/components.rbs +4 -0
  52. data/sig/datadog/ci/configuration/settings.rbs +2 -0
  53. data/sig/datadog/ci/contrib/cucumber/configuration/settings.rbs +1 -1
  54. data/sig/datadog/ci/contrib/cucumber/integration.rbs +2 -1
  55. data/sig/datadog/ci/contrib/integration.rbs +44 -0
  56. data/sig/datadog/ci/contrib/minitest/configuration/settings.rbs +1 -1
  57. data/sig/datadog/ci/contrib/minitest/integration.rbs +4 -3
  58. data/sig/datadog/ci/contrib/rspec/configuration/settings.rbs +1 -1
  59. data/sig/datadog/ci/contrib/rspec/integration.rbs +3 -2
  60. data/sig/datadog/ci/contrib/settings.rbs +25 -0
  61. data/sig/datadog/ci/ext/environment/providers/aws_code_pipeline.rbs +19 -0
  62. data/sig/datadog/ci/ext/environment/providers/base.rbs +2 -0
  63. data/sig/datadog/ci/ext/environment/providers.rbs +1 -1
  64. data/sig/datadog/ci/ext/settings.rbs +2 -0
  65. data/sig/datadog/ci/ext/transport.rbs +29 -0
  66. data/sig/datadog/ci/{test.rbs → recorder.rbs} +1 -1
  67. data/sig/datadog/ci/test_visibility/flush.rbs +17 -0
  68. data/sig/datadog/ci/test_visibility/serializers/base.rbs +73 -0
  69. data/sig/datadog/ci/test_visibility/serializers/factories/test_level.rbs +13 -0
  70. data/sig/datadog/ci/test_visibility/serializers/span.rbs +18 -0
  71. data/sig/datadog/ci/test_visibility/serializers/test_v1.rbs +23 -0
  72. data/sig/datadog/ci/test_visibility/transport.rbs +35 -0
  73. data/sig/datadog/ci/transport/api/base.rbs +21 -0
  74. data/sig/datadog/ci/transport/api/builder.rbs +12 -0
  75. data/sig/datadog/ci/transport/api/ci_test_cycle.rbs +21 -0
  76. data/sig/datadog/ci/transport/api/evp_proxy.rbs +19 -0
  77. data/sig/datadog/ci/transport/gzip.rbs +9 -0
  78. data/sig/datadog/ci/transport/http.rbs +36 -0
  79. metadata +52 -8
  80. data/lib/datadog/ci/flush.rb +0 -38
  81. data/sig/datadog/ci/flush.rbs +0 -15
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+
5
+ module Datadog
6
+ module CI
7
+ module TestVisibility
8
+ module Serializers
9
+ class Span < Base
10
+ CONTENT_FIELDS = [
11
+ "trace_id", "span_id", "parent_id",
12
+ "name", "resource", "service",
13
+ "error", "start", "duration",
14
+ "meta", "metrics",
15
+ "type" => "span_type"
16
+ ].freeze
17
+
18
+ CONTENT_MAP_SIZE = calculate_content_map_size(CONTENT_FIELDS)
19
+
20
+ REQUIRED_FIELDS = [
21
+ "trace_id",
22
+ "span_id",
23
+ "error",
24
+ "name",
25
+ "resource",
26
+ "start",
27
+ "duration"
28
+ ].freeze
29
+
30
+ def content_fields
31
+ CONTENT_FIELDS
32
+ end
33
+
34
+ def content_map_size
35
+ CONTENT_MAP_SIZE
36
+ end
37
+
38
+ def type
39
+ "span"
40
+ end
41
+
42
+ private
43
+
44
+ def required_fields
45
+ REQUIRED_FIELDS
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+ require_relative "../../ext/test"
5
+
6
+ module Datadog
7
+ module CI
8
+ module TestVisibility
9
+ module Serializers
10
+ class TestV1 < Base
11
+ CONTENT_FIELDS = [
12
+ "trace_id", "span_id",
13
+ "name", "resource", "service",
14
+ "error", "start", "duration",
15
+ "meta", "metrics",
16
+ "type" => "span_type"
17
+ ].freeze
18
+
19
+ CONTENT_MAP_SIZE = calculate_content_map_size(CONTENT_FIELDS)
20
+
21
+ REQUIRED_FIELDS = [
22
+ "trace_id",
23
+ "span_id",
24
+ "error",
25
+ "name",
26
+ "resource",
27
+ "start",
28
+ "duration"
29
+ ].freeze
30
+
31
+ def content_fields
32
+ CONTENT_FIELDS
33
+ end
34
+
35
+ def content_map_size
36
+ CONTENT_MAP_SIZE
37
+ end
38
+
39
+ def type
40
+ "test"
41
+ end
42
+
43
+ def name
44
+ "#{@span.get_tag(Ext::Test::TAG_FRAMEWORK)}.test"
45
+ end
46
+
47
+ def resource
48
+ "#{@span.get_tag(Ext::Test::TAG_SUITE)}.#{@span.get_tag(Ext::Test::TAG_NAME)}"
49
+ end
50
+
51
+ private
52
+
53
+ def required_fields
54
+ REQUIRED_FIELDS
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,151 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "msgpack"
4
+ require "uri"
5
+
6
+ require "datadog/core/encoding"
7
+ require "datadog/core/environment/identity"
8
+ require "datadog/core/chunker"
9
+
10
+ require_relative "serializers/factories/test_level"
11
+ require_relative "../ext/transport"
12
+
13
+ module Datadog
14
+ module CI
15
+ module TestVisibility
16
+ class Transport
17
+ # CI test cycle intake's limit is 5.1MB uncompressed
18
+ # We will use a bit more conservative value 5MB
19
+ DEFAULT_MAX_PAYLOAD_SIZE = 5 * 1024 * 1024
20
+
21
+ attr_reader :serializers_factory,
22
+ :api,
23
+ :max_payload_size,
24
+ :dd_env
25
+
26
+ def initialize(
27
+ api:,
28
+ dd_env: nil,
29
+ serializers_factory: Datadog::CI::TestVisibility::Serializers::Factories::TestLevel,
30
+ max_payload_size: DEFAULT_MAX_PAYLOAD_SIZE
31
+ )
32
+ @serializers_factory = serializers_factory
33
+ @max_payload_size = max_payload_size
34
+ @dd_env = dd_env
35
+ @api = api
36
+ end
37
+
38
+ def send_traces(traces)
39
+ return [] if traces.nil? || traces.empty?
40
+
41
+ Datadog.logger.debug { "Sending #{traces.count} traces..." }
42
+
43
+ encoded_events = encode_traces(traces)
44
+ if encoded_events.empty?
45
+ Datadog.logger.debug { "Empty encoded events list, skipping send" }
46
+ return []
47
+ end
48
+
49
+ responses = []
50
+ Datadog::Core::Chunker.chunk_by_size(encoded_events, max_payload_size).map do |chunk|
51
+ encoded_payload = pack_events(chunk)
52
+ Datadog.logger.debug do
53
+ "Send chunk of #{chunk.count} events; payload size #{encoded_payload.size}"
54
+ end
55
+
56
+ response = send_payload(encoded_payload)
57
+
58
+ Datadog.logger.debug do
59
+ "Received server response: #{response.inspect}"
60
+ end
61
+
62
+ responses << response
63
+ end
64
+
65
+ responses
66
+ end
67
+
68
+ private
69
+
70
+ def send_payload(encoded_payload)
71
+ api.request(
72
+ path: Datadog::CI::Ext::Transport::TEST_VISIBILITY_INTAKE_PATH,
73
+ payload: encoded_payload
74
+ )
75
+ end
76
+
77
+ def encode_traces(traces)
78
+ traces.flat_map do |trace|
79
+ spans = trace.spans
80
+ # TODO: remove condition when 1.0 is released
81
+ if spans.respond_to?(:filter_map)
82
+ spans.filter_map { |span| encode_span(trace, span) }
83
+ else
84
+ trace.spans.map { |span| encode_span(trace, span) }.reject(&:nil?)
85
+ end
86
+ end
87
+ end
88
+
89
+ def encode_span(trace, span)
90
+ serializer = serializers_factory.serializer(trace, span)
91
+
92
+ if serializer.valid?
93
+ encoded = encoder.encode(serializer)
94
+
95
+ if encoded.size > max_payload_size
96
+ # This single event is too large, we can't flush it
97
+ Datadog.logger.debug { "Dropping test event. Payload too large: '#{span.inspect}'" }
98
+ Datadog.logger.debug { encoded }
99
+
100
+ return nil
101
+ end
102
+
103
+ encoded
104
+ else
105
+ Datadog.logger.debug { "Invalid span skipped: #{span}" }
106
+ nil
107
+ end
108
+ end
109
+
110
+ def encoder
111
+ Datadog::Core::Encoding::MsgpackEncoder
112
+ end
113
+
114
+ def pack_events(encoded_events)
115
+ packer = MessagePack::Packer.new
116
+
117
+ packer.write_map_header(3) # Set header with how many elements in the map
118
+
119
+ packer.write("version")
120
+ packer.write(1)
121
+
122
+ packer.write("metadata")
123
+ packer.write_map_header(1)
124
+
125
+ packer.write("*")
126
+ metadata_fields_count = dd_env ? 4 : 3
127
+ packer.write_map_header(metadata_fields_count)
128
+
129
+ if dd_env
130
+ packer.write("env")
131
+ packer.write(dd_env)
132
+ end
133
+
134
+ packer.write("runtime-id")
135
+ packer.write(Datadog::Core::Environment::Identity.id)
136
+
137
+ packer.write("language")
138
+ packer.write(Datadog::Core::Environment::Identity.lang)
139
+
140
+ packer.write("library_version")
141
+ packer.write(Datadog::CI::VERSION::STRING)
142
+
143
+ packer.write("events")
144
+ packer.write_array_header(encoded_events.size)
145
+
146
+ (packer.buffer.to_a + encoded_events).join
147
+ end
148
+ end
149
+ end
150
+ end
151
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../ext/transport"
4
+
5
+ module Datadog
6
+ module CI
7
+ module Transport
8
+ module Api
9
+ class Base
10
+ attr_reader :http
11
+
12
+ def initialize(http:)
13
+ @http = http
14
+ end
15
+
16
+ def request(path:, payload:, verb: "post")
17
+ http.request(
18
+ path: path,
19
+ payload: payload,
20
+ verb: verb,
21
+ headers: headers
22
+ )
23
+ end
24
+
25
+ private
26
+
27
+ def headers
28
+ {
29
+ Ext::Transport::HEADER_CONTENT_TYPE => Ext::Transport::CONTENT_TYPE_MESSAGEPACK
30
+ }
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "ci_test_cycle"
4
+ require_relative "evp_proxy"
5
+ require_relative "../http"
6
+ require_relative "../../ext/transport"
7
+
8
+ module Datadog
9
+ module CI
10
+ module Transport
11
+ module Api
12
+ module Builder
13
+ def self.build_ci_test_cycle_api(settings)
14
+ dd_site = settings.site || Ext::Transport::DEFAULT_DD_SITE
15
+ url = settings.ci.agentless_url ||
16
+ "https://#{Ext::Transport::TEST_VISIBILITY_INTAKE_HOST_PREFIX}.#{dd_site}:443"
17
+
18
+ uri = URI.parse(url)
19
+ raise "Invalid agentless mode URL: #{url}" if uri.host.nil?
20
+
21
+ http = Datadog::CI::Transport::HTTP.new(
22
+ host: uri.host,
23
+ port: uri.port,
24
+ ssl: uri.scheme == "https" || uri.port == 443,
25
+ compress: true
26
+ )
27
+
28
+ CiTestCycle.new(api_key: settings.api_key, http: http)
29
+ end
30
+
31
+ def self.build_evp_proxy_api(agent_settings)
32
+ http = Datadog::CI::Transport::HTTP.new(
33
+ host: agent_settings.hostname,
34
+ port: agent_settings.port,
35
+ ssl: agent_settings.ssl,
36
+ timeout: agent_settings.timeout_seconds,
37
+ compress: false
38
+ )
39
+
40
+ EvpProxy.new(http: http)
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+ require_relative "../../ext/transport"
5
+
6
+ module Datadog
7
+ module CI
8
+ module Transport
9
+ module Api
10
+ class CiTestCycle < Base
11
+ attr_reader :api_key
12
+
13
+ def initialize(api_key:, http:)
14
+ @api_key = api_key
15
+
16
+ super(http: http)
17
+ end
18
+
19
+ private
20
+
21
+ def headers
22
+ headers = super
23
+ headers[Ext::Transport::HEADER_DD_API_KEY] = api_key
24
+ headers
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "datadog/core/environment/container"
4
+
5
+ require_relative "base"
6
+ require_relative "../../ext/transport"
7
+
8
+ module Datadog
9
+ module CI
10
+ module Transport
11
+ module Api
12
+ class EvpProxy < Base
13
+ def request(path:, payload:, verb: "post")
14
+ path = "#{Ext::Transport::EVP_PROXY_PATH_PREFIX}#{path.sub(/^\//, "")}"
15
+
16
+ super(
17
+ path: path,
18
+ payload: payload,
19
+ verb: verb
20
+ )
21
+ end
22
+
23
+ private
24
+
25
+ def container_id
26
+ return @container_id if defined?(@container_id)
27
+
28
+ @container_id = Datadog::Core::Environment::Container.container_id
29
+ end
30
+
31
+ def headers
32
+ headers = super
33
+ headers[Ext::Transport::HEADER_EVP_SUBDOMAIN] = Ext::Transport::TEST_VISIBILITY_INTAKE_HOST_PREFIX
34
+
35
+ c_id = container_id
36
+ headers[Ext::Transport::HEADER_CONTAINER_ID] = c_id unless c_id.nil?
37
+
38
+ headers
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "zlib"
4
+ require "stringio"
5
+
6
+ module Datadog
7
+ module CI
8
+ module Transport
9
+ module Gzip
10
+ module_function
11
+
12
+ def compress(input)
13
+ sio = StringIO.new
14
+ gzip_writer = Zlib::GzipWriter.new(sio, Zlib::DEFAULT_COMPRESSION, Zlib::DEFAULT_STRATEGY)
15
+ gzip_writer << input
16
+ gzip_writer.close
17
+ sio.string
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "delegate"
4
+ require "datadog/core/transport/http/adapters/net"
5
+ require "datadog/core/transport/http/env"
6
+ require "datadog/core/transport/request"
7
+
8
+ require_relative "gzip"
9
+ require_relative "../ext/transport"
10
+
11
+ module Datadog
12
+ module CI
13
+ module Transport
14
+ class HTTP
15
+ attr_reader \
16
+ :host,
17
+ :port,
18
+ :ssl,
19
+ :timeout,
20
+ :compress
21
+
22
+ DEFAULT_TIMEOUT = 30
23
+
24
+ def initialize(host:, timeout: DEFAULT_TIMEOUT, port: nil, ssl: true, compress: false)
25
+ @host = host
26
+ @port = port
27
+ @timeout = timeout
28
+ @ssl = ssl.nil? ? true : ssl
29
+ @compress = compress.nil? ? false : compress
30
+ end
31
+
32
+ def request(path:, payload:, headers:, verb: "post")
33
+ if compress
34
+ headers[Ext::Transport::HEADER_CONTENT_ENCODING] = Ext::Transport::CONTENT_ENCODING_GZIP
35
+ payload = Gzip.compress(payload)
36
+ end
37
+
38
+ Datadog.logger.debug do
39
+ "Sending #{verb} request: host=#{host}; port=#{port}; ssl_enabled=#{ssl}; " \
40
+ "compression_enabled=#{compress}; path=#{path}; payload_size=#{payload.size}"
41
+ end
42
+
43
+ ResponseDecorator.new(
44
+ adapter.call(
45
+ build_env(path: path, payload: payload, headers: headers, verb: verb)
46
+ )
47
+ )
48
+ end
49
+
50
+ private
51
+
52
+ def build_env(path:, payload:, headers:, verb:)
53
+ env = Datadog::Core::Transport::HTTP::Env.new(
54
+ Datadog::Core::Transport::Request.new
55
+ )
56
+ env.body = payload
57
+ env.path = path
58
+ env.headers = headers
59
+ env.verb = verb
60
+ env
61
+ end
62
+
63
+ def adapter
64
+ @adapter ||= Datadog::Core::Transport::HTTP::Adapters::Net.new(host, port, timeout: timeout, ssl: ssl)
65
+ end
66
+
67
+ # this is needed because Datadog::Tracing::Writer is not fully compatiple with Datadog::Core::Transport
68
+ # TODO: remove before 1.0 when CI implements its own worker
69
+ class ResponseDecorator < ::SimpleDelegator
70
+ def trace_count
71
+ 0
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -4,8 +4,8 @@ module Datadog
4
4
  module CI
5
5
  module VERSION
6
6
  MAJOR = "0"
7
- MINOR = "1"
8
- PATCH = "1"
7
+ MINOR = "3"
8
+ PATCH = "0"
9
9
  PRE = nil
10
10
  BUILD = nil
11
11
  # PRE and BUILD above are modified for dev gems during gem build GHA workflow
@@ -5,6 +5,10 @@ module Datadog
5
5
  def initialize: (untyped settings) -> void
6
6
 
7
7
  def activate_ci!: (untyped settings) -> untyped
8
+
9
+ def build_agentless_transport: (untyped settings) -> Datadog::CI::TestVisibility::Transport?
10
+ def build_evp_proxy_transport: (untyped settings, untyped agent_settings) -> Datadog::CI::TestVisibility::Transport
11
+ def can_use_evp_proxy?: (untyped settings, untyped agent_settings) -> bool
8
12
  end
9
13
  end
10
14
  end
@@ -3,6 +3,8 @@ module Datadog
3
3
  module Configuration
4
4
  module Settings
5
5
  extend Datadog::Core::Configuration::Options::ClassMethods
6
+ include Datadog::Core::Configuration::Options::InstanceMethods
7
+
6
8
  extend Datadog::Core::Configuration::Base::ClassMethods
7
9
 
8
10
  def self.extended: (untyped base) -> untyped
@@ -3,7 +3,7 @@ module Datadog
3
3
  module Contrib
4
4
  module Cucumber
5
5
  module Configuration
6
- class Settings < Datadog::Tracing::Contrib::Configuration::Settings
6
+ class Settings < Datadog::CI::Contrib::Settings
7
7
  end
8
8
  end
9
9
  end
@@ -3,7 +3,8 @@ module Datadog
3
3
  module Contrib
4
4
  module Cucumber
5
5
  class Integration
6
- extend Datadog::Tracing::Contrib::Integration
6
+ extend Datadog::CI::Contrib::Integration::ClassMethods
7
+ include Datadog::CI::Contrib::Integration::InstanceMethods
7
8
 
8
9
  MINIMUM_VERSION: Gem::Version
9
10
 
@@ -0,0 +1,44 @@
1
+ module Datadog
2
+ module CI
3
+ module Contrib
4
+ module Integration
5
+ self.@registry: Hash[Symbol, untyped]
6
+
7
+ def self.included: (Module base) -> void
8
+
9
+ def self.register: (untyped integration, Symbol name) -> void
10
+
11
+ def self.registry: () -> Hash[Symbol, Struct[untyped]]
12
+
13
+ module ClassMethods
14
+ def register_as: (Symbol name) -> void
15
+
16
+ def version: () -> Gem::Version?
17
+
18
+ def available?: () -> bool
19
+
20
+ def loaded?: () -> bool
21
+
22
+ def compatible?: () -> bool
23
+
24
+ def patchable?: () -> bool
25
+ end
26
+
27
+ module InstanceMethods
28
+ extend ClassMethods
29
+ @configuration: Datadog::CI::Contrib::Settings?
30
+
31
+ def configuration: () -> Datadog::CI::Contrib::Settings
32
+
33
+ def configure: (?::Hash[Symbol, untyped] options) ?{ (Datadog::CI::Contrib::Settings) -> Datadog::CI::Contrib::Settings } -> Datadog::CI::Contrib::Settings
34
+
35
+ def reset_configuration!: () -> void
36
+
37
+ def patcher: () -> Datadog::Tracing::Contrib::Patcher?
38
+
39
+ def new_configuration: () -> Datadog::CI::Contrib::Settings
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -3,7 +3,7 @@ module Datadog
3
3
  module Contrib
4
4
  module Minitest
5
5
  module Configuration
6
- class Settings < Datadog::Tracing::Contrib::Configuration::Settings
6
+ class Settings < Datadog::CI::Contrib::Settings
7
7
  end
8
8
  end
9
9
  end
@@ -3,13 +3,14 @@ module Datadog
3
3
  module Contrib
4
4
  module Minitest
5
5
  class Integration
6
- extend Datadog::Tracing::Contrib::Integration
6
+ extend Datadog::CI::Contrib::Integration::ClassMethods
7
+ include Datadog::CI::Contrib::Integration::InstanceMethods
7
8
 
8
- MINIMUM_VERSION: untyped
9
+ MINIMUM_VERSION: Gem::Version
9
10
 
10
11
  def self.version: () -> untyped
11
12
 
12
- def self.loaded?: () -> untyped
13
+ def self.loaded?: () -> bool
13
14
 
14
15
  def compatible?: () -> bool
15
16
 
@@ -3,7 +3,7 @@ module Datadog
3
3
  module Contrib
4
4
  module RSpec
5
5
  module Configuration
6
- class Settings < Datadog::Tracing::Contrib::Configuration::Settings
6
+ class Settings < Datadog::CI::Contrib::Settings
7
7
  end
8
8
  end
9
9
  end
@@ -3,9 +3,10 @@ module Datadog
3
3
  module Contrib
4
4
  module RSpec
5
5
  class Integration
6
- extend Datadog::Tracing::Contrib::Integration
6
+ extend Datadog::CI::Contrib::Integration::ClassMethods
7
+ include Datadog::CI::Contrib::Integration::InstanceMethods
7
8
 
8
- MINIMUM_VERSION: untyped
9
+ MINIMUM_VERSION: Gem::Version
9
10
 
10
11
  def self.version: () -> untyped
11
12