datadog-ci 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +30 -0
  3. data/LICENSE +6 -0
  4. data/LICENSE-3rdparty.csv +2 -0
  5. data/LICENSE.Apache +200 -0
  6. data/LICENSE.BSD3 +24 -0
  7. data/NOTICE +4 -0
  8. data/README.md +125 -0
  9. data/lib/datadog/ci/configuration/components.rb +32 -0
  10. data/lib/datadog/ci/configuration/settings.rb +51 -0
  11. data/lib/datadog/ci/contrib/cucumber/configuration/settings.rb +36 -0
  12. data/lib/datadog/ci/contrib/cucumber/ext.rb +22 -0
  13. data/lib/datadog/ci/contrib/cucumber/formatter.rb +94 -0
  14. data/lib/datadog/ci/contrib/cucumber/instrumentation.rb +28 -0
  15. data/lib/datadog/ci/contrib/cucumber/integration.rb +47 -0
  16. data/lib/datadog/ci/contrib/cucumber/patcher.rb +27 -0
  17. data/lib/datadog/ci/contrib/minitest/configuration/settings.rb +36 -0
  18. data/lib/datadog/ci/contrib/minitest/ext.rb +21 -0
  19. data/lib/datadog/ci/contrib/minitest/hooks.rb +66 -0
  20. data/lib/datadog/ci/contrib/minitest/integration.rb +46 -0
  21. data/lib/datadog/ci/contrib/minitest/patcher.rb +26 -0
  22. data/lib/datadog/ci/contrib/rspec/configuration/settings.rb +36 -0
  23. data/lib/datadog/ci/contrib/rspec/example.rb +70 -0
  24. data/lib/datadog/ci/contrib/rspec/ext.rb +21 -0
  25. data/lib/datadog/ci/contrib/rspec/integration.rb +50 -0
  26. data/lib/datadog/ci/contrib/rspec/patcher.rb +27 -0
  27. data/lib/datadog/ci/ext/app_types.rb +11 -0
  28. data/lib/datadog/ci/ext/environment/extractor.rb +101 -0
  29. data/lib/datadog/ci/ext/environment/providers/appveyor.rb +98 -0
  30. data/lib/datadog/ci/ext/environment/providers/azure.rb +109 -0
  31. data/lib/datadog/ci/ext/environment/providers/base.rb +115 -0
  32. data/lib/datadog/ci/ext/environment/providers/bitbucket.rb +69 -0
  33. data/lib/datadog/ci/ext/environment/providers/bitrise.rb +77 -0
  34. data/lib/datadog/ci/ext/environment/providers/buddy.rb +69 -0
  35. data/lib/datadog/ci/ext/environment/providers/buildkite.rb +95 -0
  36. data/lib/datadog/ci/ext/environment/providers/circleci.rb +82 -0
  37. data/lib/datadog/ci/ext/environment/providers/codefresh.rb +49 -0
  38. data/lib/datadog/ci/ext/environment/providers/github_actions.rb +76 -0
  39. data/lib/datadog/ci/ext/environment/providers/gitlab.rb +119 -0
  40. data/lib/datadog/ci/ext/environment/providers/jenkins.rb +74 -0
  41. data/lib/datadog/ci/ext/environment/providers/local_git.rb +170 -0
  42. data/lib/datadog/ci/ext/environment/providers/teamcity.rb +29 -0
  43. data/lib/datadog/ci/ext/environment/providers/travis.rb +65 -0
  44. data/lib/datadog/ci/ext/environment/providers/user_defined_tags.rb +62 -0
  45. data/lib/datadog/ci/ext/environment/providers.rb +52 -0
  46. data/lib/datadog/ci/ext/environment.rb +82 -0
  47. data/lib/datadog/ci/ext/git.rb +37 -0
  48. data/lib/datadog/ci/ext/settings.rb +12 -0
  49. data/lib/datadog/ci/ext/test.rb +37 -0
  50. data/lib/datadog/ci/extensions.rb +19 -0
  51. data/lib/datadog/ci/flush.rb +38 -0
  52. data/lib/datadog/ci/test.rb +82 -0
  53. data/lib/datadog/ci/utils/git.rb +22 -0
  54. data/lib/datadog/ci/version.rb +28 -0
  55. data/lib/datadog/ci.rb +24 -0
  56. data/sig/datadog/ci/configuration/components.rbs +11 -0
  57. data/sig/datadog/ci/configuration/settings.rbs +14 -0
  58. data/sig/datadog/ci/contrib/cucumber/configuration/settings.rbs +12 -0
  59. data/sig/datadog/ci/contrib/cucumber/ext.rbs +25 -0
  60. data/sig/datadog/ci/contrib/cucumber/formatter.rbs +35 -0
  61. data/sig/datadog/ci/contrib/cucumber/instrumentation.rbs +16 -0
  62. data/sig/datadog/ci/contrib/cucumber/integration.rbs +25 -0
  63. data/sig/datadog/ci/contrib/cucumber/patcher.rbs +15 -0
  64. data/sig/datadog/ci/contrib/minitest/configuration/settings.rbs +12 -0
  65. data/sig/datadog/ci/contrib/minitest/ext.rbs +23 -0
  66. data/sig/datadog/ci/contrib/minitest/hooks.rbs +19 -0
  67. data/sig/datadog/ci/contrib/minitest/integration.rbs +25 -0
  68. data/sig/datadog/ci/contrib/minitest/patcher.rbs +15 -0
  69. data/sig/datadog/ci/contrib/rspec/configuration/settings.rbs +12 -0
  70. data/sig/datadog/ci/contrib/rspec/example.rbs +20 -0
  71. data/sig/datadog/ci/contrib/rspec/ext.rbs +23 -0
  72. data/sig/datadog/ci/contrib/rspec/integration.rbs +25 -0
  73. data/sig/datadog/ci/contrib/rspec/patcher.rbs +15 -0
  74. data/sig/datadog/ci/ext/app_types.rbs +9 -0
  75. data/sig/datadog/ci/ext/environment/extractor.rbs +27 -0
  76. data/sig/datadog/ci/ext/environment/providers/appveyor.rbs +48 -0
  77. data/sig/datadog/ci/ext/environment/providers/azure.rbs +56 -0
  78. data/sig/datadog/ci/ext/environment/providers/base.rbs +69 -0
  79. data/sig/datadog/ci/ext/environment/providers/bitbucket.rbs +37 -0
  80. data/sig/datadog/ci/ext/environment/providers/bitrise.rbs +41 -0
  81. data/sig/datadog/ci/ext/environment/providers/buddy.rbs +37 -0
  82. data/sig/datadog/ci/ext/environment/providers/buildkite.rbs +45 -0
  83. data/sig/datadog/ci/ext/environment/providers/circleci.rbs +41 -0
  84. data/sig/datadog/ci/ext/environment/providers/codefresh.rbs +25 -0
  85. data/sig/datadog/ci/ext/environment/providers/github_actions.rbs +37 -0
  86. data/sig/datadog/ci/ext/environment/providers/gitlab.rbs +57 -0
  87. data/sig/datadog/ci/ext/environment/providers/jenkins.rbs +35 -0
  88. data/sig/datadog/ci/ext/environment/providers/local_git.rbs +66 -0
  89. data/sig/datadog/ci/ext/environment/providers/teamcity.rbs +17 -0
  90. data/sig/datadog/ci/ext/environment/providers/travis.rbs +35 -0
  91. data/sig/datadog/ci/ext/environment/providers/user_defined_tags.rbs +33 -0
  92. data/sig/datadog/ci/ext/environment/providers.rbs +13 -0
  93. data/sig/datadog/ci/ext/environment.rbs +44 -0
  94. data/sig/datadog/ci/ext/git.rbs +53 -0
  95. data/sig/datadog/ci/ext/settings.rbs +9 -0
  96. data/sig/datadog/ci/ext/test.rbs +43 -0
  97. data/sig/datadog/ci/extensions.rbs +7 -0
  98. data/sig/datadog/ci/flush.rbs +15 -0
  99. data/sig/datadog/ci/test.rbs +18 -0
  100. data/sig/datadog/ci/utils/git.rbs +11 -0
  101. data/sig/datadog/ci/version.rbs +16 -0
  102. data/sig/datadog/ci.rbs +7 -0
  103. metadata +154 -0
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "git"
4
+ require_relative "environment/extractor"
5
+
6
+ module Datadog
7
+ module CI
8
+ module Ext
9
+ # Defines constants for CI tags
10
+ module Environment
11
+ TAG_JOB_NAME = "ci.job.name"
12
+ TAG_JOB_URL = "ci.job.url"
13
+ TAG_PIPELINE_ID = "ci.pipeline.id"
14
+ TAG_PIPELINE_NAME = "ci.pipeline.name"
15
+ TAG_PIPELINE_NUMBER = "ci.pipeline.number"
16
+ TAG_PIPELINE_URL = "ci.pipeline.url"
17
+ TAG_PROVIDER_NAME = "ci.provider.name"
18
+ TAG_STAGE_NAME = "ci.stage.name"
19
+ TAG_WORKSPACE_PATH = "ci.workspace_path"
20
+ TAG_NODE_LABELS = "ci.node.labels"
21
+ TAG_NODE_NAME = "ci.node.name"
22
+ TAG_CI_ENV_VARS = "_dd.ci.env_vars"
23
+
24
+ HEX_NUMBER_REGEXP = /[0-9a-f]{40}/i.freeze
25
+
26
+ module_function
27
+
28
+ def tags(env)
29
+ # Extract metadata from CI provider environment variables
30
+ tags = Environment::Extractor.new(env).tags
31
+
32
+ # If user defined metadata is defined, overwrite
33
+ tags.merge!(
34
+ Environment::Extractor.new(env, provider_klass: Providers::UserDefinedTags).tags
35
+ )
36
+
37
+ # Fill out tags from local git as fallback
38
+ local_git_tags = Environment::Extractor.new(env, provider_klass: Providers::LocalGit).tags
39
+ local_git_tags.each do |key, value|
40
+ tags[key] ||= value
41
+ end
42
+
43
+ ensure_post_conditions(tags)
44
+
45
+ tags
46
+ end
47
+
48
+ def ensure_post_conditions(tags)
49
+ validate_repository_url(tags[Git::TAG_REPOSITORY_URL])
50
+ validate_git_sha(tags[Git::TAG_COMMIT_SHA])
51
+ end
52
+
53
+ def validate_repository_url(repo_url)
54
+ return if !repo_url.nil? && !repo_url.empty?
55
+
56
+ Datadog.logger.error("DD_GIT_REPOSITORY_URL is not set or empty; no repo URL was automatically extracted")
57
+ end
58
+
59
+ def validate_git_sha(git_sha)
60
+ message = "DD_GIT_COMMIT_SHA must be a full-length git SHA."
61
+
62
+ if git_sha.nil? || git_sha.empty?
63
+ message += " No value was set and no SHA was automatically extracted."
64
+ Datadog.logger.error(message)
65
+ return
66
+ end
67
+
68
+ if git_sha.length < Git::SHA_LENGTH
69
+ message += " Expected SHA length #{Git::SHA_LENGTH}, was #{git_sha.length}."
70
+ Datadog.logger.error(message)
71
+ return
72
+ end
73
+
74
+ unless HEX_NUMBER_REGEXP =~ git_sha
75
+ message += " Expected SHA to be a valid HEX number, got #{git_sha}."
76
+ Datadog.logger.error(message)
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Datadog
4
+ module CI
5
+ module Ext
6
+ # Defines constants for Git tags
7
+ module Git
8
+ SHA_LENGTH = 40
9
+
10
+ TAG_BRANCH = "git.branch"
11
+ TAG_REPOSITORY_URL = "git.repository_url"
12
+ TAG_TAG = "git.tag"
13
+
14
+ TAG_COMMIT_AUTHOR_DATE = "git.commit.author.date"
15
+ TAG_COMMIT_AUTHOR_EMAIL = "git.commit.author.email"
16
+ TAG_COMMIT_AUTHOR_NAME = "git.commit.author.name"
17
+ TAG_COMMIT_COMMITTER_DATE = "git.commit.committer.date"
18
+ TAG_COMMIT_COMMITTER_EMAIL = "git.commit.committer.email"
19
+ TAG_COMMIT_COMMITTER_NAME = "git.commit.committer.name"
20
+ TAG_COMMIT_MESSAGE = "git.commit.message"
21
+ TAG_COMMIT_SHA = "git.commit.sha"
22
+
23
+ ENV_REPOSITORY_URL = "DD_GIT_REPOSITORY_URL"
24
+ ENV_COMMIT_SHA = "DD_GIT_COMMIT_SHA"
25
+ ENV_BRANCH = "DD_GIT_BRANCH"
26
+ ENV_TAG = "DD_GIT_TAG"
27
+ ENV_COMMIT_MESSAGE = "DD_GIT_COMMIT_MESSAGE"
28
+ ENV_COMMIT_AUTHOR_NAME = "DD_GIT_COMMIT_AUTHOR_NAME"
29
+ ENV_COMMIT_AUTHOR_EMAIL = "DD_GIT_COMMIT_AUTHOR_EMAIL"
30
+ ENV_COMMIT_AUTHOR_DATE = "DD_GIT_COMMIT_AUTHOR_DATE"
31
+ ENV_COMMIT_COMMITTER_NAME = "DD_GIT_COMMIT_COMMITTER_NAME"
32
+ ENV_COMMIT_COMMITTER_EMAIL = "DD_GIT_COMMIT_COMMITTER_EMAIL"
33
+ ENV_COMMIT_COMMITTER_DATE = "DD_GIT_COMMIT_COMMITTER_DATE"
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Datadog
4
+ module CI
5
+ module Ext
6
+ # Defines constants for test tags
7
+ module Settings
8
+ ENV_MODE_ENABLED = "DD_TRACE_CI_ENABLED"
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Datadog
4
+ module CI
5
+ module Ext
6
+ # Defines constants for test tags
7
+ module Test
8
+ CONTEXT_ORIGIN = "ciapp-test"
9
+
10
+ TAG_ARGUMENTS = "test.arguments"
11
+ TAG_FRAMEWORK = "test.framework"
12
+ TAG_FRAMEWORK_VERSION = "test.framework_version"
13
+ TAG_NAME = "test.name"
14
+ TAG_SKIP_REASON = "test.skip_reason" # DEV: Not populated yet
15
+ TAG_STATUS = "test.status"
16
+ TAG_SUITE = "test.suite"
17
+ TAG_TRAITS = "test.traits"
18
+ TAG_TYPE = "test.type"
19
+
20
+ # Environment runtime tags
21
+ TAG_OS_ARCHITECTURE = "os.architecture"
22
+ TAG_OS_PLATFORM = "os.platform"
23
+ TAG_RUNTIME_NAME = "runtime.name"
24
+ TAG_RUNTIME_VERSION = "runtime.version"
25
+
26
+ # TODO: is there a better place for SPAN_KIND?
27
+ TAG_SPAN_KIND = "span.kind"
28
+
29
+ module Status
30
+ PASS = "pass"
31
+ FAIL = "fail"
32
+ SKIP = "skip"
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "datadog/core/configuration/settings"
4
+ require "datadog/core/configuration/components"
5
+
6
+ require_relative "configuration/settings"
7
+ require_relative "configuration/components"
8
+
9
+ module Datadog
10
+ module CI
11
+ # Extends Datadog tracing with CI features
12
+ module Extensions
13
+ def self.activate!
14
+ Core::Configuration::Settings.extend(CI::Configuration::Settings)
15
+ Core::Configuration::Components.prepend(CI::Configuration::Components)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "datadog/tracing/metadata/ext"
4
+ require "datadog/tracing/flush"
5
+
6
+ module Datadog
7
+ module CI
8
+ module Flush
9
+ # Common behavior for CI flushing
10
+ module Tagging
11
+ # Decorate a trace with CI tags
12
+ def get_trace(trace_op)
13
+ trace = trace_op.flush!
14
+
15
+ # Origin tag is required on every span
16
+ trace.spans.each do |span|
17
+ span.set_tag(
18
+ Tracing::Metadata::Ext::Distributed::TAG_ORIGIN,
19
+ trace.origin
20
+ )
21
+ end
22
+
23
+ trace
24
+ end
25
+ end
26
+
27
+ # Consumes only completed traces (where all spans have finished)
28
+ class Finished < Tracing::Flush::Finished
29
+ prepend Tagging
30
+ end
31
+
32
+ # Performs partial trace flushing to avoid large traces residing in memory for too long
33
+ class Partial < Tracing::Flush::Partial
34
+ prepend Tagging
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "datadog/tracing/contrib/analytics"
4
+
5
+ require_relative "ext/app_types"
6
+ require_relative "ext/test"
7
+ require_relative "ext/environment"
8
+
9
+ require "rbconfig"
10
+
11
+ module Datadog
12
+ module CI
13
+ # Common behavior for CI tests
14
+ module Test
15
+ # Creates a new span for a CI test
16
+ def self.trace(span_name, options = {})
17
+ span_options = {
18
+ span_type: Ext::AppTypes::TYPE_TEST
19
+ }.merge(options[:span_options] || {})
20
+
21
+ if block_given?
22
+ Tracing.trace(span_name, **span_options) do |span, trace|
23
+ set_tags!(trace, span, options)
24
+ yield(span, trace)
25
+ end
26
+ else
27
+ span = Tracing.trace(span_name, **span_options)
28
+ trace = Tracing.active_trace
29
+ set_tags!(trace, span, options)
30
+ span
31
+ end
32
+ end
33
+
34
+ # Adds tags to a CI test span.
35
+ def self.set_tags!(trace, span, tags = {})
36
+ tags ||= {}
37
+
38
+ # Set default tags
39
+ trace.origin = Ext::Test::CONTEXT_ORIGIN if trace
40
+ Datadog::Tracing::Contrib::Analytics.set_measured(span)
41
+ span.set_tag(Ext::Test::TAG_SPAN_KIND, Ext::AppTypes::TYPE_TEST)
42
+
43
+ # Set environment tags
44
+ @environment_tags ||= Ext::Environment.tags(ENV)
45
+ @environment_tags.each { |k, v| span.set_tag(k, v) }
46
+
47
+ # Set contextual tags
48
+ span.set_tag(Ext::Test::TAG_FRAMEWORK, tags[:framework]) if tags[:framework]
49
+ span.set_tag(Ext::Test::TAG_FRAMEWORK_VERSION, tags[:framework_version]) if tags[:framework_version]
50
+ span.set_tag(Ext::Test::TAG_NAME, tags[:test_name]) if tags[:test_name]
51
+ span.set_tag(Ext::Test::TAG_SUITE, tags[:test_suite]) if tags[:test_suite]
52
+ span.set_tag(Ext::Test::TAG_TYPE, tags[:test_type]) if tags[:test_type]
53
+
54
+ set_environment_runtime_tags!(span)
55
+
56
+ span
57
+ end
58
+
59
+ def self.passed!(span)
60
+ span.set_tag(Ext::Test::TAG_STATUS, Ext::Test::Status::PASS)
61
+ end
62
+
63
+ def self.failed!(span, exception = nil)
64
+ span.status = 1
65
+ span.set_tag(Ext::Test::TAG_STATUS, Ext::Test::Status::FAIL)
66
+ span.set_error(exception) unless exception.nil?
67
+ end
68
+
69
+ def self.skipped!(span, exception = nil)
70
+ span.set_tag(Ext::Test::TAG_STATUS, Ext::Test::Status::SKIP)
71
+ span.set_error(exception) unless exception.nil?
72
+ end
73
+
74
+ private_class_method def self.set_environment_runtime_tags!(span)
75
+ span.set_tag(Ext::Test::TAG_OS_ARCHITECTURE, ::RbConfig::CONFIG["host_cpu"])
76
+ span.set_tag(Ext::Test::TAG_OS_PLATFORM, ::RbConfig::CONFIG["host_os"])
77
+ span.set_tag(Ext::Test::TAG_RUNTIME_NAME, Core::Environment::Ext::LANG_ENGINE)
78
+ span.set_tag(Ext::Test::TAG_RUNTIME_VERSION, Core::Environment::Ext::ENGINE_VERSION)
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Datadog
4
+ module CI
5
+ module Utils
6
+ module Git
7
+ def self.normalize_ref(ref)
8
+ return nil if ref.nil?
9
+
10
+ refs = %r{^refs/(heads/)?}
11
+ origin = %r{^origin/}
12
+ tags = %r{^tags/}
13
+ ref.gsub(refs, "").gsub(origin, "").gsub(tags, "")
14
+ end
15
+
16
+ def self.is_git_tag?(ref)
17
+ !ref.nil? && ref.include?("tags/")
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Datadog
4
+ module CI
5
+ module VERSION
6
+ MAJOR = "0"
7
+ MINOR = "1"
8
+ PATCH = "0"
9
+ PRE = nil
10
+ BUILD = nil
11
+ # PRE and BUILD above are modified for dev gems during gem build GHA workflow
12
+
13
+ STRING = [MAJOR, MINOR, PATCH, PRE, BUILD].compact.join(".")
14
+
15
+ MINIMUM_RUBY_VERSION = "2.1.0"
16
+
17
+ # Restrict the installation of this gem with untested future versions of Ruby.
18
+ #
19
+ # This prevents crashes in the native extension code and sends a clear signal to the
20
+ # user that this version of the gem is untested for the host Ruby version.
21
+ #
22
+ # To allow testing with the next unreleased version of Ruby, the version check is performed
23
+ # as `< #{MAXIMUM_RUBY_VERSION}`, meaning prereleases of MAXIMUM_RUBY_VERSION are allowed
24
+ # but not stable MAXIMUM_RUBY_VERSION releases.
25
+ MAXIMUM_RUBY_VERSION = "3.4"
26
+ end
27
+ end
28
+ end
data/lib/datadog/ci.rb ADDED
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ddtrace"
4
+ require_relative "ci/version"
5
+
6
+ require "datadog/core"
7
+
8
+ module Datadog
9
+ # Namespace for Datadog CI instrumentation:
10
+ # e.g. rspec, cucumber, etc...
11
+ module CI
12
+ class Error < StandardError; end
13
+ # Your code goes here...
14
+ end
15
+ end
16
+
17
+ # Integrations
18
+ require_relative "ci/contrib/cucumber/integration"
19
+ require_relative "ci/contrib/rspec/integration"
20
+ require_relative "ci/contrib/minitest/integration"
21
+
22
+ # Extensions
23
+ require_relative "ci/extensions"
24
+ Datadog::CI::Extensions.activate!
@@ -0,0 +1,11 @@
1
+ module Datadog
2
+ module CI
3
+ module Configuration
4
+ module Components : Datadog::Core::Configuration::Components
5
+ def initialize: (untyped settings) -> void
6
+
7
+ def activate_ci!: (untyped settings) -> untyped
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,14 @@
1
+ module Datadog
2
+ module CI
3
+ module Configuration
4
+ module Settings
5
+ extend Datadog::Core::Configuration::Options::ClassMethods
6
+ extend Datadog::Core::Configuration::Base::ClassMethods
7
+
8
+ def self.extended: (untyped base) -> untyped
9
+
10
+ def self.add_settings!: (untyped base) -> untyped
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ module Datadog
2
+ module CI
3
+ module Contrib
4
+ module Cucumber
5
+ module Configuration
6
+ class Settings < Datadog::Tracing::Contrib::Configuration::Settings
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,25 @@
1
+ module Datadog
2
+ module CI
3
+ module Contrib
4
+ module Cucumber
5
+ module Ext
6
+ APP: String
7
+
8
+ ENV_ENABLED: String
9
+
10
+ ENV_OPERATION_NAME: String
11
+
12
+ FRAMEWORK: String
13
+
14
+ OPERATION_NAME: String
15
+
16
+ SERVICE_NAME: String
17
+
18
+ STEP_SPAN_TYPE: String
19
+
20
+ TEST_TYPE: String
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,35 @@
1
+ module Datadog
2
+ module CI
3
+ module Contrib
4
+ module Cucumber
5
+ class Formatter
6
+ private
7
+
8
+ attr_reader config: untyped
9
+
10
+ attr_reader current_feature_span: untyped
11
+
12
+ attr_reader current_step_span: untyped
13
+
14
+ public
15
+
16
+ def initialize: (untyped config) -> void
17
+
18
+ def bind_events: (untyped config) -> untyped
19
+
20
+ def on_test_case_started: (untyped event) -> untyped
21
+
22
+ def on_test_case_finished: (untyped event) -> (nil | untyped)
23
+
24
+ def on_test_step_started: (untyped event) -> untyped
25
+
26
+ def on_test_step_finished: (untyped event) -> (nil | untyped)
27
+
28
+ private
29
+
30
+ def configuration: () -> untyped
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,16 @@
1
+ module Datadog
2
+ module CI
3
+ module Contrib
4
+ module Cucumber
5
+ module Instrumentation
6
+ def self.included: (untyped base) -> untyped
7
+ module InstanceMethods : Cucumber::Runtime
8
+ attr_reader datadog_formatter: CI::Contrib::Cucumber::Formatter
9
+
10
+ def formatters: () -> untyped
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,25 @@
1
+ module Datadog
2
+ module CI
3
+ module Contrib
4
+ module Cucumber
5
+ class Integration
6
+ extend Datadog::Tracing::Contrib::Integration
7
+
8
+ MINIMUM_VERSION: Gem::Version
9
+
10
+ def self.version: () -> untyped
11
+
12
+ def self.loaded?: () -> bool
13
+
14
+ def self.compatible?: () -> bool
15
+
16
+ def auto_instrument?: () -> false
17
+
18
+ def new_configuration: () -> untyped
19
+
20
+ def patcher: () -> untyped
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,15 @@
1
+ module Datadog
2
+ module CI
3
+ module Contrib
4
+ module Cucumber
5
+ module Patcher
6
+ include Datadog::Tracing::Contrib::Patcher
7
+
8
+ def self?.target_version: () -> untyped
9
+
10
+ def self?.patch: () -> untyped
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ module Datadog
2
+ module CI
3
+ module Contrib
4
+ module Minitest
5
+ module Configuration
6
+ class Settings < Datadog::Tracing::Contrib::Configuration::Settings
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,23 @@
1
+ module Datadog
2
+ module CI
3
+ module Contrib
4
+ module Minitest
5
+ module Ext
6
+ APP: String
7
+
8
+ ENV_ENABLED: String
9
+
10
+ ENV_OPERATION_NAME: String
11
+
12
+ FRAMEWORK: String
13
+
14
+ OPERATION_NAME: String
15
+
16
+ SERVICE_NAME: String
17
+
18
+ TEST_TYPE: String
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,19 @@
1
+ module Datadog
2
+ module CI
3
+ module Contrib
4
+ module Minitest
5
+ module Hooks : ::Minitest::Test
6
+ include ::Minitest::Test::LifecycleHooks
7
+
8
+ def before_setup: () -> (nil | untyped)
9
+
10
+ def after_teardown: () -> untyped
11
+
12
+ private
13
+
14
+ def configuration: () -> untyped
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,25 @@
1
+ module Datadog
2
+ module CI
3
+ module Contrib
4
+ module Minitest
5
+ class Integration
6
+ extend Datadog::Tracing::Contrib::Integration
7
+
8
+ MINIMUM_VERSION: untyped
9
+
10
+ def self.version: () -> untyped
11
+
12
+ def self.loaded?: () -> untyped
13
+
14
+ def compatible?: () -> bool
15
+
16
+ def auto_instrument?: () -> false
17
+
18
+ def new_configuration: () -> untyped
19
+
20
+ def patcher: () -> untyped
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,15 @@
1
+ module Datadog
2
+ module CI
3
+ module Contrib
4
+ module Minitest
5
+ module Patcher
6
+ include Datadog::Tracing::Contrib::Patcher
7
+
8
+ def self?.target_version: () -> untyped
9
+
10
+ def self?.patch: () -> untyped
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ module Datadog
2
+ module CI
3
+ module Contrib
4
+ module RSpec
5
+ module Configuration
6
+ class Settings < Datadog::Tracing::Contrib::Configuration::Settings
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end