datadog-ci 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/lib/datadog/ci/configuration/components.rb +11 -7
- data/lib/datadog/ci/contrib/cucumber/configuration/settings.rb +1 -1
- data/lib/datadog/ci/contrib/cucumber/ext.rb +7 -5
- data/lib/datadog/ci/contrib/cucumber/formatter.rb +99 -19
- data/lib/datadog/ci/contrib/minitest/configuration/settings.rb +1 -1
- data/lib/datadog/ci/contrib/minitest/ext.rb +6 -4
- data/lib/datadog/ci/contrib/minitest/helpers.rb +22 -0
- data/lib/datadog/ci/contrib/minitest/hooks.rb +45 -17
- data/lib/datadog/ci/contrib/minitest/patcher.rb +7 -0
- data/lib/datadog/ci/contrib/minitest/plugin.rb +73 -0
- data/lib/datadog/ci/contrib/minitest/runnable.rb +42 -0
- data/lib/datadog/ci/contrib/rspec/configuration/settings.rb +1 -1
- data/lib/datadog/ci/contrib/rspec/example.rb +2 -2
- data/lib/datadog/ci/contrib/rspec/example_group.rb +46 -0
- data/lib/datadog/ci/contrib/rspec/ext.rb +5 -4
- data/lib/datadog/ci/contrib/rspec/integration.rb +1 -1
- data/lib/datadog/ci/contrib/rspec/patcher.rb +5 -0
- data/lib/datadog/ci/contrib/rspec/runner.rb +57 -0
- data/lib/datadog/ci/contrib/settings.rb +1 -1
- data/lib/datadog/ci/ext/test.rb +2 -0
- data/lib/datadog/ci/span.rb +24 -0
- data/lib/datadog/ci/test.rb +30 -0
- data/lib/datadog/ci/test_session.rb +8 -0
- data/lib/datadog/ci/test_visibility/null_recorder.rb +73 -0
- data/lib/datadog/ci/test_visibility/recorder.rb +30 -9
- data/lib/datadog/ci/version.rb +2 -2
- data/sig/datadog/ci/contrib/cucumber/ext.rbs +1 -5
- data/sig/datadog/ci/contrib/cucumber/formatter.rbs +17 -4
- data/sig/datadog/ci/contrib/minitest/ext.rbs +1 -5
- data/sig/datadog/ci/contrib/minitest/helpers.rbs +13 -0
- data/sig/datadog/ci/contrib/minitest/hooks.rbs +9 -1
- data/sig/datadog/ci/contrib/minitest/plugin.rbs +31 -0
- data/sig/datadog/ci/contrib/minitest/runnable.rbs +24 -0
- data/sig/datadog/ci/contrib/rspec/example_group.rbs +21 -0
- data/sig/datadog/ci/contrib/rspec/ext.rbs +2 -8
- data/sig/datadog/ci/contrib/rspec/runner.rbs +21 -0
- data/sig/datadog/ci/ext/test.rbs +2 -0
- data/sig/datadog/ci/span.rbs +8 -0
- data/sig/datadog/ci/test.rbs +5 -0
- data/sig/datadog/ci/test_visibility/null_recorder.rbs +45 -0
- data/sig/datadog/ci/test_visibility/recorder.rbs +5 -5
- data/sig/datadog/ci.rbs +2 -0
- metadata +15 -3
@@ -1,7 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "datadog/tracing/contrib/patcher"
|
4
|
+
|
4
5
|
require_relative "example"
|
6
|
+
require_relative "example_group"
|
7
|
+
require_relative "runner"
|
5
8
|
|
6
9
|
module Datadog
|
7
10
|
module CI
|
@@ -19,6 +22,8 @@ module Datadog
|
|
19
22
|
|
20
23
|
def patch
|
21
24
|
::RSpec::Core::Example.include(Example)
|
25
|
+
::RSpec::Core::Runner.include(Runner)
|
26
|
+
::RSpec::Core::ExampleGroup.include(ExampleGroup)
|
22
27
|
end
|
23
28
|
end
|
24
29
|
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../ext/test"
|
4
|
+
require_relative "ext"
|
5
|
+
|
6
|
+
module Datadog
|
7
|
+
module CI
|
8
|
+
module Contrib
|
9
|
+
module RSpec
|
10
|
+
# Instrument RSpec::Core::Runner
|
11
|
+
module Runner
|
12
|
+
def self.included(base)
|
13
|
+
base.prepend(InstanceMethods)
|
14
|
+
end
|
15
|
+
|
16
|
+
module InstanceMethods
|
17
|
+
def run_specs(example_groups)
|
18
|
+
return super unless configuration[:enabled]
|
19
|
+
|
20
|
+
test_session = CI.start_test_session(
|
21
|
+
tags: {
|
22
|
+
CI::Ext::Test::TAG_FRAMEWORK => Ext::FRAMEWORK,
|
23
|
+
CI::Ext::Test::TAG_FRAMEWORK_VERSION => CI::Contrib::RSpec::Integration.version.to_s,
|
24
|
+
CI::Ext::Test::TAG_TYPE => CI::Ext::Test::TEST_TYPE
|
25
|
+
},
|
26
|
+
service: configuration[:service_name]
|
27
|
+
)
|
28
|
+
|
29
|
+
test_module = CI.start_test_module(test_session.name)
|
30
|
+
|
31
|
+
result = super
|
32
|
+
|
33
|
+
if result != 0
|
34
|
+
# TODO: repeating this twice feels clunky, we need to remove test_module API before GA
|
35
|
+
test_module.failed!
|
36
|
+
test_session.failed!
|
37
|
+
else
|
38
|
+
test_module.passed!
|
39
|
+
test_session.passed!
|
40
|
+
end
|
41
|
+
test_module.finish
|
42
|
+
test_session.finish
|
43
|
+
|
44
|
+
result
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def configuration
|
50
|
+
Datadog.configuration.ci[:rspec]
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/lib/datadog/ci/ext/test.rb
CHANGED
@@ -20,6 +20,8 @@ module Datadog
|
|
20
20
|
TAG_TYPE = "test.type"
|
21
21
|
TAG_COMMAND = "test.command"
|
22
22
|
|
23
|
+
TEST_TYPE = "test"
|
24
|
+
|
23
25
|
# those tags are special and they are used to correlate tests with the test sessions, suites, and modules
|
24
26
|
TAG_TEST_SESSION_ID = "_test.session_id"
|
25
27
|
TAG_TEST_MODULE_ID = "_test.module_id"
|
data/lib/datadog/ci/span.rb
CHANGED
@@ -36,6 +36,30 @@ module Datadog
|
|
36
36
|
tracer_span.type
|
37
37
|
end
|
38
38
|
|
39
|
+
# Checks whether span status is not set yet.
|
40
|
+
# @return [bool] true if span does not have status
|
41
|
+
def undefined?
|
42
|
+
tracer_span.get_tag(Ext::Test::TAG_STATUS).nil?
|
43
|
+
end
|
44
|
+
|
45
|
+
# Checks whether span status is PASS.
|
46
|
+
# @return [bool] true if span status is PASS
|
47
|
+
def passed?
|
48
|
+
tracer_span.get_tag(Ext::Test::TAG_STATUS) == Ext::Test::Status::PASS
|
49
|
+
end
|
50
|
+
|
51
|
+
# Checks whether span status is FAIL.
|
52
|
+
# @return [bool] true if span status is FAIL
|
53
|
+
def failed?
|
54
|
+
tracer_span.get_tag(Ext::Test::TAG_STATUS) == Ext::Test::Status::FAIL
|
55
|
+
end
|
56
|
+
|
57
|
+
# Checks whether span status is SKIP.
|
58
|
+
# @return [bool] true if span status is SKIP
|
59
|
+
def skipped?
|
60
|
+
tracer_span.get_tag(Ext::Test::TAG_STATUS) == Ext::Test::Status::SKIP
|
61
|
+
end
|
62
|
+
|
39
63
|
# Sets the status of the span to "pass".
|
40
64
|
# @return [void]
|
41
65
|
def passed!
|
data/lib/datadog/ci/test.rb
CHANGED
@@ -20,6 +20,36 @@ module Datadog
|
|
20
20
|
|
21
21
|
CI.deactivate_test(self)
|
22
22
|
end
|
23
|
+
|
24
|
+
# Running test suite that this test is part of (if any).
|
25
|
+
# @return [Datadog::CI::TestSuite] the test suite this test belongs to
|
26
|
+
# @return [nil] if the test suite is not found
|
27
|
+
def test_suite
|
28
|
+
suite_name = test_suite_name
|
29
|
+
CI.active_test_suite(suite_name) if suite_name
|
30
|
+
end
|
31
|
+
|
32
|
+
# Span id of the running test suite this test belongs to.
|
33
|
+
# @return [String] the span id of the test suite.
|
34
|
+
def test_suite_id
|
35
|
+
get_tag(Ext::Test::TAG_TEST_SUITE_ID)
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_suite_name
|
39
|
+
get_tag(Ext::Test::TAG_SUITE)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Span id of the running test module this test belongs to.
|
43
|
+
# @return [String] the span id of the test module.
|
44
|
+
def test_module_id
|
45
|
+
get_tag(Ext::Test::TAG_TEST_MODULE_ID)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Span id of the running test module this test belongs to.
|
49
|
+
# @return [String] the span id of the test session.
|
50
|
+
def test_session_id
|
51
|
+
get_tag(Ext::Test::TAG_TEST_SESSION_ID)
|
52
|
+
end
|
23
53
|
end
|
24
54
|
end
|
25
55
|
end
|
@@ -20,6 +20,14 @@ module Datadog
|
|
20
20
|
CI.deactivate_test_session
|
21
21
|
end
|
22
22
|
|
23
|
+
# Return the test session's name which is equal to test command used
|
24
|
+
# @return [String] the command for this test session.
|
25
|
+
def name
|
26
|
+
get_tag(Ext::Test::TAG_COMMAND)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Return the test session tags that could be inherited by sub-spans
|
30
|
+
# @return [Hash] the tags to be inherited by sub-spans.
|
23
31
|
def inheritable_tags
|
24
32
|
return @inheritable_tags if defined?(@inheritable_tags)
|
25
33
|
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "recorder"
|
4
|
+
|
5
|
+
module Datadog
|
6
|
+
module CI
|
7
|
+
module TestVisibility
|
8
|
+
# Special recorder that does not record anything
|
9
|
+
class NullRecorder
|
10
|
+
def start_test_session(service: nil, tags: {})
|
11
|
+
skip_tracing
|
12
|
+
end
|
13
|
+
|
14
|
+
def start_test_module(test_module_name, service: nil, tags: {})
|
15
|
+
skip_tracing
|
16
|
+
end
|
17
|
+
|
18
|
+
def start_test_suite(test_suite_name, service: nil, tags: {})
|
19
|
+
skip_tracing
|
20
|
+
end
|
21
|
+
|
22
|
+
def trace_test(test_name, test_suite_name, service: nil, tags: {}, &block)
|
23
|
+
skip_tracing(block)
|
24
|
+
end
|
25
|
+
|
26
|
+
def trace(span_type, span_name, tags: {}, &block)
|
27
|
+
skip_tracing(block)
|
28
|
+
end
|
29
|
+
|
30
|
+
def active_span
|
31
|
+
end
|
32
|
+
|
33
|
+
def active_test
|
34
|
+
end
|
35
|
+
|
36
|
+
def active_test_session
|
37
|
+
end
|
38
|
+
|
39
|
+
def active_test_module
|
40
|
+
end
|
41
|
+
|
42
|
+
def active_test_suite(test_suite_name)
|
43
|
+
end
|
44
|
+
|
45
|
+
def deactivate_test(test)
|
46
|
+
end
|
47
|
+
|
48
|
+
def deactivate_test_session
|
49
|
+
end
|
50
|
+
|
51
|
+
def deactivate_test_module
|
52
|
+
end
|
53
|
+
|
54
|
+
def deactivate_test_suite(test_suite_name)
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def skip_tracing(block = nil)
|
60
|
+
if block
|
61
|
+
block.call(null_span)
|
62
|
+
else
|
63
|
+
null_span
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def null_span
|
68
|
+
@null_span ||= NullSpan.new
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -25,13 +25,12 @@ module Datadog
|
|
25
25
|
# Common behavior for CI tests
|
26
26
|
# Note: this class has too many responsibilities and should be split into multiple classes
|
27
27
|
class Recorder
|
28
|
-
attr_reader :environment_tags, :test_suite_level_visibility_enabled
|
28
|
+
attr_reader :environment_tags, :test_suite_level_visibility_enabled
|
29
29
|
|
30
|
-
def initialize(
|
31
|
-
@
|
32
|
-
@test_suite_level_visibility_enabled = enabled && test_suite_level_visibility_enabled
|
30
|
+
def initialize(test_suite_level_visibility_enabled: false)
|
31
|
+
@test_suite_level_visibility_enabled = test_suite_level_visibility_enabled
|
33
32
|
|
34
|
-
@environment_tags =
|
33
|
+
@environment_tags = Ext::Environment.tags(ENV).freeze
|
35
34
|
@local_context = Context::Local.new
|
36
35
|
@global_context = Context::Global.new
|
37
36
|
end
|
@@ -83,8 +82,6 @@ module Datadog
|
|
83
82
|
end
|
84
83
|
|
85
84
|
def trace_test(test_name, test_suite_name, service: nil, tags: {}, &block)
|
86
|
-
return skip_tracing(block) unless enabled
|
87
|
-
|
88
85
|
set_inherited_globals(tags)
|
89
86
|
set_session_context(tags)
|
90
87
|
set_module_context(tags)
|
@@ -118,8 +115,6 @@ module Datadog
|
|
118
115
|
end
|
119
116
|
|
120
117
|
def trace(span_type, span_name, tags: {}, &block)
|
121
|
-
return skip_tracing(block) unless enabled
|
122
|
-
|
123
118
|
span_options = build_span_options(
|
124
119
|
nil, # service name is completely optional for custom spans
|
125
120
|
span_type,
|
@@ -210,6 +205,7 @@ module Datadog
|
|
210
205
|
def build_test(tracer_span, tags)
|
211
206
|
test = Test.new(tracer_span)
|
212
207
|
set_initial_tags(test, tags)
|
208
|
+
validate_test_suite_level_visibility_correctness(test)
|
213
209
|
test
|
214
210
|
end
|
215
211
|
|
@@ -287,6 +283,31 @@ module Datadog
|
|
287
283
|
def null_span
|
288
284
|
@null_span ||= NullSpan.new
|
289
285
|
end
|
286
|
+
|
287
|
+
def validate_test_suite_level_visibility_correctness(test)
|
288
|
+
return unless test_suite_level_visibility_enabled
|
289
|
+
|
290
|
+
if test.test_suite_id.nil?
|
291
|
+
Datadog.logger.debug do
|
292
|
+
"Test [#{test.name}] does not have a test suite associated with it. " \
|
293
|
+
"Expected test suite [#{test.test_suite_name}] to be running."
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
297
|
+
if test.test_module_id.nil?
|
298
|
+
Datadog.logger.debug do
|
299
|
+
"Test [#{test.name}] does not have a test module associated with it. " \
|
300
|
+
"Make sure that there is a test module running within a session."
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
304
|
+
if test.test_session_id.nil?
|
305
|
+
Datadog.logger.debug do
|
306
|
+
"Test [#{test.name}] does not have a test session associated with it. " \
|
307
|
+
"Make sure that there is a test session running."
|
308
|
+
end
|
309
|
+
end
|
310
|
+
end
|
290
311
|
end
|
291
312
|
end
|
292
313
|
end
|
data/lib/datadog/ci/version.rb
CHANGED
@@ -3,8 +3,6 @@ module Datadog
|
|
3
3
|
module Contrib
|
4
4
|
module Cucumber
|
5
5
|
module Ext
|
6
|
-
APP: String
|
7
|
-
|
8
6
|
ENV_ENABLED: String
|
9
7
|
|
10
8
|
ENV_OPERATION_NAME: String
|
@@ -13,11 +11,9 @@ module Datadog
|
|
13
11
|
|
14
12
|
OPERATION_NAME: String
|
15
13
|
|
16
|
-
|
14
|
+
DEFAULT_SERVICE_NAME: String
|
17
15
|
|
18
16
|
STEP_SPAN_TYPE: String
|
19
|
-
|
20
|
-
TEST_TYPE: String
|
21
17
|
end
|
22
18
|
end
|
23
19
|
end
|
@@ -4,19 +4,22 @@ module Datadog
|
|
4
4
|
module Cucumber
|
5
5
|
class Formatter
|
6
6
|
private
|
7
|
+
@failed_tests_count: Integer
|
8
|
+
@current_test_suite: Datadog::CI::Span?
|
9
|
+
@failed_tests_in_current_test_suite: Integer
|
7
10
|
|
8
11
|
attr_reader config: untyped
|
9
12
|
|
10
|
-
attr_reader current_feature_span: untyped
|
11
|
-
|
12
|
-
attr_reader current_step_span: untyped
|
13
|
-
|
14
13
|
public
|
15
14
|
|
16
15
|
def initialize: (untyped config) -> void
|
17
16
|
|
18
17
|
def bind_events: (untyped config) -> untyped
|
19
18
|
|
19
|
+
def on_test_run_started: (untyped event) -> untyped
|
20
|
+
|
21
|
+
def on_test_run_finished: (untyped event) -> untyped
|
22
|
+
|
20
23
|
def on_test_case_started: (untyped event) -> untyped
|
21
24
|
|
22
25
|
def on_test_case_finished: (untyped event) -> (nil | untyped)
|
@@ -27,6 +30,16 @@ module Datadog
|
|
27
30
|
|
28
31
|
private
|
29
32
|
|
33
|
+
def start_test_suite: (String test_suite_name) -> void
|
34
|
+
|
35
|
+
def finish_current_test_suite: () -> void
|
36
|
+
|
37
|
+
def same_test_suite_as_current?: (String test_suite_name) -> bool
|
38
|
+
|
39
|
+
def finish_session: (bool result) -> void
|
40
|
+
|
41
|
+
def finish_test: (Datadog::CI::Span test, Cucumber::Core::Test::Result result) -> void
|
42
|
+
|
30
43
|
def configuration: () -> untyped
|
31
44
|
end
|
32
45
|
end
|
@@ -3,8 +3,6 @@ module Datadog
|
|
3
3
|
module Contrib
|
4
4
|
module Minitest
|
5
5
|
module Ext
|
6
|
-
APP: String
|
7
|
-
|
8
6
|
ENV_ENABLED: String
|
9
7
|
|
10
8
|
ENV_OPERATION_NAME: String
|
@@ -13,9 +11,7 @@ module Datadog
|
|
13
11
|
|
14
12
|
OPERATION_NAME: String
|
15
13
|
|
16
|
-
|
17
|
-
|
18
|
-
TEST_TYPE: String
|
14
|
+
DEFAULT_SERVICE_NAME: String
|
19
15
|
end
|
20
16
|
end
|
21
17
|
end
|
@@ -11,7 +11,15 @@ module Datadog
|
|
11
11
|
|
12
12
|
private
|
13
13
|
|
14
|
-
def
|
14
|
+
def datadog_configuration: () -> untyped
|
15
|
+
|
16
|
+
def finish_test: (Datadog::CI::Test test_span, String result_code) -> void
|
17
|
+
|
18
|
+
def finish_test_suite: (Datadog::CI::TestSuite? test_suite, String result_code) -> void
|
19
|
+
|
20
|
+
def finish_with_result: (Datadog::CI::Span span, String result_code) -> void
|
21
|
+
|
22
|
+
def self.test_order: () -> (nil | :parallel | :sorted | :random | :alpha)
|
15
23
|
end
|
16
24
|
end
|
17
25
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Datadog
|
2
|
+
module CI
|
3
|
+
module Contrib
|
4
|
+
module Minitest
|
5
|
+
module Plugin
|
6
|
+
def self.included: (untyped base) -> untyped
|
7
|
+
|
8
|
+
class DatadogReporter < ::Minitest::AbstractReporter
|
9
|
+
@reporter: WeakRef
|
10
|
+
|
11
|
+
def initialize: (Minitest::AbstractReporter reporter) -> void
|
12
|
+
end
|
13
|
+
|
14
|
+
module ClassMethods
|
15
|
+
def plugin_datadog_ci_init: (*untyped) -> (nil | untyped)
|
16
|
+
|
17
|
+
def initialize: (untyped reporter) -> void
|
18
|
+
|
19
|
+
def report: () -> (nil | untyped)
|
20
|
+
|
21
|
+
def reporter: () -> Minitest::CompositeReporter
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def datadog_configuration: () -> untyped
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Datadog
|
2
|
+
module CI
|
3
|
+
module Contrib
|
4
|
+
module Minitest
|
5
|
+
module Runnable
|
6
|
+
def self.included: (untyped base) -> untyped
|
7
|
+
|
8
|
+
module ClassMethods : ::Minitest::Runnable
|
9
|
+
|
10
|
+
def run: (*untyped) -> untyped
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def datadog_configuration: () -> untyped
|
15
|
+
|
16
|
+
def test_order: () -> (nil | :parallel | :random | :sorted | :alpha)
|
17
|
+
|
18
|
+
def runnable_methods: () -> Array[String]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Datadog
|
2
|
+
module CI
|
3
|
+
module Contrib
|
4
|
+
module RSpec
|
5
|
+
module ExampleGroup
|
6
|
+
def self.included: (untyped base) -> untyped
|
7
|
+
|
8
|
+
module ClassMethods
|
9
|
+
include ::RSpec::Core::ExampleGroup::ClassMethods
|
10
|
+
|
11
|
+
def run: (?untyped reporter) -> untyped
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def configuration: () -> untyped
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -3,19 +3,13 @@ module Datadog
|
|
3
3
|
module Contrib
|
4
4
|
module RSpec
|
5
5
|
module Ext
|
6
|
-
APP: String
|
7
|
-
|
8
6
|
ENV_ENABLED: String
|
9
7
|
|
10
|
-
ENV_OPERATION_NAME: String
|
11
|
-
|
12
8
|
FRAMEWORK: String
|
9
|
+
DEFAULT_SERVICE_NAME: String
|
13
10
|
|
14
11
|
OPERATION_NAME: String
|
15
|
-
|
16
|
-
SERVICE_NAME: String
|
17
|
-
|
18
|
-
TEST_TYPE: String
|
12
|
+
ENV_OPERATION_NAME: String
|
19
13
|
end
|
20
14
|
end
|
21
15
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Datadog
|
2
|
+
module CI
|
3
|
+
module Contrib
|
4
|
+
module RSpec
|
5
|
+
module Runner
|
6
|
+
def self.included: (untyped base) -> untyped
|
7
|
+
|
8
|
+
module InstanceMethods
|
9
|
+
include ::RSpec::Core::Runner
|
10
|
+
|
11
|
+
def run_specs: (untyped example_groups) -> untyped
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def configuration: () -> untyped
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/sig/datadog/ci/ext/test.rbs
CHANGED
data/sig/datadog/ci/span.rbs
CHANGED
@@ -13,6 +13,14 @@ module Datadog
|
|
13
13
|
|
14
14
|
def service: () -> String
|
15
15
|
|
16
|
+
def undefined?: () -> bool
|
17
|
+
|
18
|
+
def passed?: () -> bool
|
19
|
+
|
20
|
+
def failed?: () -> bool
|
21
|
+
|
22
|
+
def skipped?: () -> bool
|
23
|
+
|
16
24
|
def passed!: () -> void
|
17
25
|
|
18
26
|
def failed!: (?exception: untyped?) -> void
|
data/sig/datadog/ci/test.rbs
CHANGED
@@ -2,6 +2,11 @@ module Datadog
|
|
2
2
|
module CI
|
3
3
|
class Test < Span
|
4
4
|
def finish: () -> void
|
5
|
+
def test_suite: () -> Datadog::CI::TestSuite?
|
6
|
+
def test_suite_id: () -> String?
|
7
|
+
def test_suite_name: () -> String?
|
8
|
+
def test_module_id: () -> String?
|
9
|
+
def test_session_id: () -> String?
|
5
10
|
end
|
6
11
|
end
|
7
12
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Datadog
|
2
|
+
module CI
|
3
|
+
module TestVisibility
|
4
|
+
class NullRecorder
|
5
|
+
@null_span: Datadog::CI::NullSpan
|
6
|
+
|
7
|
+
def initialize: (?untyped args) -> void
|
8
|
+
|
9
|
+
def trace_test: (String span_name, String test_suite_name, ?service: String?, ?tags: Hash[untyped, untyped]) ?{ (Datadog::CI::Span span) -> untyped } -> untyped
|
10
|
+
|
11
|
+
def trace: (String span_type, String span_name, ?tags: Hash[untyped, untyped]) ?{ (Datadog::CI::Span span) -> untyped } -> untyped
|
12
|
+
|
13
|
+
def start_test_session: (?service: String?, ?tags: Hash[untyped, untyped]) -> Datadog::CI::Span
|
14
|
+
|
15
|
+
def start_test_module: (String test_module_name, ?service: String?, ?tags: Hash[untyped, untyped]) -> Datadog::CI::Span
|
16
|
+
|
17
|
+
def start_test_suite: (String test_suite_name, ?service: String?, ?tags: Hash[untyped, untyped]) -> Datadog::CI::Span
|
18
|
+
|
19
|
+
def active_test_session: () -> Datadog::CI::TestSession?
|
20
|
+
|
21
|
+
def active_test_module: () -> Datadog::CI::TestModule?
|
22
|
+
|
23
|
+
def active_test_suite: (String test_suite_name) -> Datadog::CI::TestSuite?
|
24
|
+
|
25
|
+
def active_test: () -> Datadog::CI::Test?
|
26
|
+
|
27
|
+
def active_span: () -> Datadog::CI::Span?
|
28
|
+
|
29
|
+
def deactivate_test: (Datadog::CI::Test test) -> void
|
30
|
+
|
31
|
+
def deactivate_test_session: () -> void
|
32
|
+
|
33
|
+
def deactivate_test_module: () -> void
|
34
|
+
|
35
|
+
def deactivate_test_suite: (String test_suite_name) -> void
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def null_span: () -> Datadog::CI::Span
|
40
|
+
|
41
|
+
def skip_tracing: (?untyped block) -> untyped
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|