datadog-ci 1.20.2 → 1.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -2
- data/lib/datadog/ci/contrib/rspec/integration.rb +1 -4
- data/lib/datadog/ci/contrib/rspec/patcher.rb +7 -1
- data/lib/datadog/ci/ext/environment/extractor.rb +14 -5
- data/lib/datadog/ci/ext/environment/providers/base.rb +23 -0
- data/lib/datadog/ci/ext/environment/providers/local_git.rb +58 -6
- data/lib/datadog/ci/ext/environment.rb +18 -0
- data/lib/datadog/ci/ext/git.rb +9 -1
- data/lib/datadog/ci/ext/test.rb +1 -1
- data/lib/datadog/ci/git/base_branch_sha_detection/guesser.rb +0 -2
- data/lib/datadog/ci/git/base_branch_sha_detection/merge_base_extractor.rb +0 -1
- data/lib/datadog/ci/git/local_repository.rb +7 -6
- data/lib/datadog/ci/span.rb +24 -0
- data/lib/datadog/ci/test_management/tests_properties.rb +2 -2
- data/lib/datadog/ci/test_session.rb +0 -6
- data/lib/datadog/ci/test_visibility/component.rb +8 -1
- data/lib/datadog/ci/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fea9fced002fe3713119893acd2ab78f7d3f2855dd3eaa3d30c87ed14cd18e37
|
4
|
+
data.tar.gz: b2bd39e198205855d322e31a17cf5d8ecded29edd2544963c3d5940f68856f45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2807fa13e49deccee138a6e59b3f5a7fb17c64ff0897519cf2b1af48c6724abce003cb726ff82a3b506804bd7f0bf342f1f18a1aeea755cd364ed32d63da0a6
|
7
|
+
data.tar.gz: 8c625ca146baeeb4901d8614430baf0efcea69e467327e9c8906ae989a23676a5792fef2a10e810606cab4012f2693e293847d00daad7c04c631ab3d0e95f56a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [1.21.1] - 2025-07-22
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
|
7
|
+
* fix: RSpec's DocumentationFormatter might not be present at instrumentation time ([#384][])
|
8
|
+
* fix: do not crash when `Minitest.run` is called in a fork ([#383][])
|
9
|
+
|
10
|
+
## [1.21.0] - 2025-07-14
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
* Support automated flaky test fixing flow for Github Action jobs with pull_request trigger ([#370][])
|
15
|
+
|
3
16
|
## [1.20.2] - 2025-07-04
|
4
17
|
|
5
18
|
### Fixed
|
@@ -486,7 +499,9 @@ Currently test suite level visibility is not used by our instrumentation: it wil
|
|
486
499
|
|
487
500
|
- Ruby versions < 2.7 no longer supported ([#8][])
|
488
501
|
|
489
|
-
[Unreleased]: https://github.com/DataDog/datadog-ci-rb/compare/v1.
|
502
|
+
[Unreleased]: https://github.com/DataDog/datadog-ci-rb/compare/v1.21.1...main
|
503
|
+
[1.21.1]: https://github.com/DataDog/datadog-ci-rb/compare/v1.21.0...v1.21.1
|
504
|
+
[1.21.0]: https://github.com/DataDog/datadog-ci-rb/compare/v1.20.2...v1.21.0
|
490
505
|
[1.20.2]: https://github.com/DataDog/datadog-ci-rb/compare/v1.20.1...v1.20.2
|
491
506
|
[1.20.1]: https://github.com/DataDog/datadog-ci-rb/compare/v1.20.0...v1.20.1
|
492
507
|
[1.20.0]: https://github.com/DataDog/datadog-ci-rb/compare/v1.19.0...v1.20.0
|
@@ -690,4 +705,7 @@ Currently test suite level visibility is not used by our instrumentation: it wil
|
|
690
705
|
[#349]: https://github.com/DataDog/datadog-ci-rb/issues/349
|
691
706
|
[#355]: https://github.com/DataDog/datadog-ci-rb/issues/355
|
692
707
|
[#359]: https://github.com/DataDog/datadog-ci-rb/issues/359
|
693
|
-
[#366]: https://github.com/DataDog/datadog-ci-rb/issues/366
|
708
|
+
[#366]: https://github.com/DataDog/datadog-ci-rb/issues/366
|
709
|
+
[#370]: https://github.com/DataDog/datadog-ci-rb/issues/370
|
710
|
+
[#383]: https://github.com/DataDog/datadog-ci-rb/issues/383
|
711
|
+
[#384]: https://github.com/DataDog/datadog-ci-rb/issues/384
|
@@ -24,10 +24,7 @@ module Datadog
|
|
24
24
|
!defined?(::RSpec).nil? && !defined?(::RSpec::Core).nil? &&
|
25
25
|
!defined?(::RSpec::Core::Example).nil? &&
|
26
26
|
!defined?(::RSpec::Core::Runner).nil? &&
|
27
|
-
!defined?(::RSpec::Core::ExampleGroup).nil?
|
28
|
-
!defined?(::RSpec::Core::Formatters::DocumentationFormatter).nil? &&
|
29
|
-
!defined?(::RSpec::Core::Formatters::BaseFormatter).nil? &&
|
30
|
-
!defined?(::RSpec::Core::Formatters::BaseTextFormatter).nil?
|
27
|
+
!defined?(::RSpec::Core::ExampleGroup).nil?
|
31
28
|
end
|
32
29
|
|
33
30
|
def compatible?
|
@@ -21,7 +21,13 @@ module Datadog
|
|
21
21
|
::RSpec::Core::Runner.include(Runner)
|
22
22
|
::RSpec::Core::Example.include(Example)
|
23
23
|
::RSpec::Core::ExampleGroup.include(ExampleGroup)
|
24
|
-
|
24
|
+
|
25
|
+
# only add DocumentationFormatter's patch if it's loaded at this point
|
26
|
+
if defined?(::RSpec::Core::Formatters::DocumentationFormatter) &&
|
27
|
+
defined?(::RSpec::Core::Formatters::BaseFormatter) &&
|
28
|
+
defined?(::RSpec::Core::Formatters::BaseTextFormatter)
|
29
|
+
::RSpec::Core::Formatters::DocumentationFormatter.include(DocumentationFormatter)
|
30
|
+
end
|
25
31
|
end
|
26
32
|
end
|
27
33
|
end
|
@@ -36,22 +36,31 @@ module Datadog
|
|
36
36
|
Environment::TAG_NODE_NAME => @provider.node_name,
|
37
37
|
Environment::TAG_CI_ENV_VARS => @provider.ci_env_vars,
|
38
38
|
|
39
|
-
Git::TAG_BRANCH => @provider.git_branch,
|
40
39
|
Git::TAG_REPOSITORY_URL => @provider.git_repository_url,
|
40
|
+
Git::TAG_BRANCH => @provider.git_branch,
|
41
41
|
Git::TAG_TAG => @provider.git_tag,
|
42
|
+
|
43
|
+
Git::TAG_COMMIT_SHA => @provider.git_commit_sha,
|
44
|
+
Git::TAG_COMMIT_MESSAGE => @provider.git_commit_message,
|
42
45
|
Git::TAG_COMMIT_AUTHOR_DATE => @provider.git_commit_author_date,
|
43
46
|
Git::TAG_COMMIT_AUTHOR_EMAIL => @provider.git_commit_author_email,
|
44
47
|
Git::TAG_COMMIT_AUTHOR_NAME => @provider.git_commit_author_name,
|
45
48
|
Git::TAG_COMMIT_COMMITTER_DATE => @provider.git_commit_committer_date,
|
46
49
|
Git::TAG_COMMIT_COMMITTER_EMAIL => @provider.git_commit_committer_email,
|
47
50
|
Git::TAG_COMMIT_COMMITTER_NAME => @provider.git_commit_committer_name,
|
48
|
-
|
49
|
-
Git::TAG_COMMIT_SHA => @provider.git_commit_sha,
|
51
|
+
|
50
52
|
Git::TAG_PULL_REQUEST_BASE_BRANCH => @provider.git_pull_request_base_branch,
|
51
53
|
Git::TAG_PULL_REQUEST_BASE_BRANCH_SHA => @provider.git_pull_request_base_branch_sha,
|
52
|
-
|
54
|
+
Environment::TAG_PR_NUMBER => @provider.pr_number,
|
53
55
|
|
54
|
-
|
56
|
+
Git::TAG_COMMIT_HEAD_SHA => @provider.git_commit_head_sha,
|
57
|
+
Git::TAG_COMMIT_HEAD_MESSAGE => @provider.git_commit_head_message,
|
58
|
+
Git::TAG_COMMIT_HEAD_AUTHOR_DATE => @provider.git_commit_head_author_date,
|
59
|
+
Git::TAG_COMMIT_HEAD_AUTHOR_EMAIL => @provider.git_commit_head_author_email,
|
60
|
+
Git::TAG_COMMIT_HEAD_AUTHOR_NAME => @provider.git_commit_head_author_name,
|
61
|
+
Git::TAG_COMMIT_HEAD_COMMITTER_DATE => @provider.git_commit_head_committer_date,
|
62
|
+
Git::TAG_COMMIT_HEAD_COMMITTER_EMAIL => @provider.git_commit_head_committer_email,
|
63
|
+
Git::TAG_COMMIT_HEAD_COMMITTER_NAME => @provider.git_commit_head_committer_name
|
55
64
|
}
|
56
65
|
|
57
66
|
# Normalize Git references and filter sensitive data
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "../../../git/local_repository"
|
4
|
+
|
3
5
|
module Datadog
|
4
6
|
module CI
|
5
7
|
module Ext
|
@@ -105,6 +107,27 @@ module Datadog
|
|
105
107
|
def git_commit_head_sha
|
106
108
|
end
|
107
109
|
|
110
|
+
def git_commit_head_message
|
111
|
+
end
|
112
|
+
|
113
|
+
def git_commit_head_author_date
|
114
|
+
end
|
115
|
+
|
116
|
+
def git_commit_head_author_email
|
117
|
+
end
|
118
|
+
|
119
|
+
def git_commit_head_author_name
|
120
|
+
end
|
121
|
+
|
122
|
+
def git_commit_head_committer_date
|
123
|
+
end
|
124
|
+
|
125
|
+
def git_commit_head_committer_email
|
126
|
+
end
|
127
|
+
|
128
|
+
def git_commit_head_committer_name
|
129
|
+
end
|
130
|
+
|
108
131
|
def pr_number
|
109
132
|
end
|
110
133
|
|
@@ -31,27 +31,57 @@ module Datadog
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def git_commit_author_name
|
34
|
-
author
|
34
|
+
author&.name
|
35
35
|
end
|
36
36
|
|
37
37
|
def git_commit_author_email
|
38
|
-
author
|
38
|
+
author&.email
|
39
39
|
end
|
40
40
|
|
41
41
|
def git_commit_author_date
|
42
|
-
author
|
42
|
+
author&.date
|
43
43
|
end
|
44
44
|
|
45
45
|
def git_commit_committer_name
|
46
|
-
committer
|
46
|
+
committer&.name
|
47
47
|
end
|
48
48
|
|
49
49
|
def git_commit_committer_email
|
50
|
-
committer
|
50
|
+
committer&.email
|
51
51
|
end
|
52
52
|
|
53
53
|
def git_commit_committer_date
|
54
|
-
committer
|
54
|
+
committer&.date
|
55
|
+
end
|
56
|
+
|
57
|
+
def git_commit_head_message
|
58
|
+
return nil if head_commit_sha_from_env.nil?
|
59
|
+
|
60
|
+
CI::Git::LocalRepository.git_commit_message(head_commit_sha_from_env)
|
61
|
+
end
|
62
|
+
|
63
|
+
def git_commit_head_author_date
|
64
|
+
head_author&.date
|
65
|
+
end
|
66
|
+
|
67
|
+
def git_commit_head_author_email
|
68
|
+
head_author&.email
|
69
|
+
end
|
70
|
+
|
71
|
+
def git_commit_head_author_name
|
72
|
+
head_author&.name
|
73
|
+
end
|
74
|
+
|
75
|
+
def git_commit_head_committer_date
|
76
|
+
head_committer&.date
|
77
|
+
end
|
78
|
+
|
79
|
+
def git_commit_head_committer_email
|
80
|
+
head_committer&.email
|
81
|
+
end
|
82
|
+
|
83
|
+
def git_commit_head_committer_name
|
84
|
+
head_committer&.name
|
55
85
|
end
|
56
86
|
|
57
87
|
def workspace_path
|
@@ -74,8 +104,30 @@ module Datadog
|
|
74
104
|
@committer
|
75
105
|
end
|
76
106
|
|
107
|
+
def head_author
|
108
|
+
return @head_author if defined?(@head_author)
|
109
|
+
|
110
|
+
set_git_commit_users
|
111
|
+
@head_author
|
112
|
+
end
|
113
|
+
|
114
|
+
def head_committer
|
115
|
+
return @head_committer if defined?(@head_committer)
|
116
|
+
|
117
|
+
set_git_commit_users
|
118
|
+
@head_committer
|
119
|
+
end
|
120
|
+
|
77
121
|
def set_git_commit_users
|
78
122
|
@author, @committer = CI::Git::LocalRepository.git_commit_users
|
123
|
+
|
124
|
+
return if head_commit_sha_from_env.nil?
|
125
|
+
|
126
|
+
@head_author, @head_committer = CI::Git::LocalRepository.git_commit_users(head_commit_sha_from_env)
|
127
|
+
end
|
128
|
+
|
129
|
+
def head_commit_sha_from_env
|
130
|
+
@head_commit_sha_from_env ||= env[Ext::Environment::ENV_SPECIAL_KEY_FOR_GIT_COMMIT_HEAD_SHA]
|
79
131
|
end
|
80
132
|
end
|
81
133
|
end
|
@@ -47,6 +47,8 @@ module Datadog
|
|
47
47
|
|
48
48
|
POSSIBLE_BUNDLE_LOCATIONS = %w[vendor/bundle .bundle].freeze
|
49
49
|
|
50
|
+
ENV_SPECIAL_KEY_FOR_GIT_COMMIT_HEAD_SHA = "_dd.ci.environment.git_commit_head_sha"
|
51
|
+
|
50
52
|
module_function
|
51
53
|
|
52
54
|
def tags(env)
|
@@ -57,6 +59,22 @@ module Datadog
|
|
57
59
|
user_provided_tags = Environment::Extractor.new(env, provider_klass: Providers::UserDefinedTags).tags
|
58
60
|
tags.merge!(user_provided_tags)
|
59
61
|
|
62
|
+
# NOTE: we need to provide head commit sha as part of the environment if it was discovered from provider.
|
63
|
+
#
|
64
|
+
# This info will be later used by LocalGit provider to extract commit message and user info for head commit.
|
65
|
+
# It is useful for CI providers that run jobs on artificial merge commits instead of a head commit of a
|
66
|
+
# feature branch.
|
67
|
+
#
|
68
|
+
# NOTE 2: when we discover that head commit sha exists it means that we are running on an artificial merge
|
69
|
+
# commit created by CI provider. Most likely we also operate on a shallow clone of a repo - in this case
|
70
|
+
# we need to unshallow at least the parent of the current merge commit to be able to extract information
|
71
|
+
# from the real original commit.
|
72
|
+
if tags[Git::TAG_COMMIT_HEAD_SHA]
|
73
|
+
CI::Git::LocalRepository.git_unshallow(parent_only: true) if CI::Git::LocalRepository.git_shallow_clone?
|
74
|
+
|
75
|
+
env[ENV_SPECIAL_KEY_FOR_GIT_COMMIT_HEAD_SHA] = tags[Git::TAG_COMMIT_HEAD_SHA]
|
76
|
+
end
|
77
|
+
|
60
78
|
# Fill out tags from local git as fallback
|
61
79
|
local_git_tags = Environment::Extractor.new(env, provider_klass: Providers::LocalGit).tags
|
62
80
|
local_git_tags.each do |key, value|
|
data/lib/datadog/ci/ext/git.rb
CHANGED
@@ -21,10 +21,18 @@ module Datadog
|
|
21
21
|
TAG_COMMIT_SHA = "git.commit.sha"
|
22
22
|
|
23
23
|
# additional tags that we use for github actions jobs with "pull_request" target
|
24
|
-
TAG_COMMIT_HEAD_SHA = "git.commit.head_sha"
|
25
24
|
TAG_PULL_REQUEST_BASE_BRANCH = "git.pull_request.base_branch"
|
26
25
|
TAG_PULL_REQUEST_BASE_BRANCH_SHA = "git.pull_request.base_branch_sha"
|
27
26
|
|
27
|
+
TAG_COMMIT_HEAD_SHA = "git.commit.head.sha"
|
28
|
+
TAG_COMMIT_HEAD_MESSAGE = "git.commit.head.message"
|
29
|
+
TAG_COMMIT_HEAD_AUTHOR_DATE = "git.commit.head.author.date"
|
30
|
+
TAG_COMMIT_HEAD_AUTHOR_EMAIL = "git.commit.head.author.email"
|
31
|
+
TAG_COMMIT_HEAD_AUTHOR_NAME = "git.commit.head.author.name"
|
32
|
+
TAG_COMMIT_HEAD_COMMITTER_DATE = "git.commit.head.committer.date"
|
33
|
+
TAG_COMMIT_HEAD_COMMITTER_EMAIL = "git.commit.head.committer.email"
|
34
|
+
TAG_COMMIT_HEAD_COMMITTER_NAME = "git.commit.head.committer.name"
|
35
|
+
|
28
36
|
ENV_REPOSITORY_URL = "DD_GIT_REPOSITORY_URL"
|
29
37
|
ENV_COMMIT_SHA = "DD_GIT_COMMIT_SHA"
|
30
38
|
ENV_BRANCH = "DD_GIT_BRANCH"
|
data/lib/datadog/ci/ext/test.rb
CHANGED
@@ -95,7 +95,7 @@ module Datadog
|
|
95
95
|
AUTO_TEST_RETRIES_VERSION = "1"
|
96
96
|
TEST_MANAGEMENT_QUARANTINE_VERSION = "1"
|
97
97
|
TEST_MANAGEMENT_DISABLE_VERSION = "1"
|
98
|
-
TEST_MANAGEMENT_ATTEMPT_TO_FIX_VERSION = "
|
98
|
+
TEST_MANAGEMENT_ATTEMPT_TO_FIX_VERSION = "5"
|
99
99
|
end
|
100
100
|
|
101
101
|
# Map of capabilities to their versions
|
@@ -143,16 +143,16 @@ module Datadog
|
|
143
143
|
nil
|
144
144
|
end
|
145
145
|
|
146
|
-
def self.git_commit_message
|
147
|
-
CLI.exec_git_command(["log", "-n", "1", "--format=%B"])
|
146
|
+
def self.git_commit_message(commit_sha = nil)
|
147
|
+
CLI.exec_git_command(["log", "-n", "1", "--format=%B", commit_sha].compact)
|
148
148
|
rescue => e
|
149
149
|
log_failure(e, "git commit message")
|
150
150
|
nil
|
151
151
|
end
|
152
152
|
|
153
|
-
def self.git_commit_users
|
153
|
+
def self.git_commit_users(commit_sha = nil)
|
154
154
|
# Get committer and author information in one command.
|
155
|
-
output = CLI.exec_git_command(["show", "-s", "--format=%an\t%ae\t%at\t%cn\t%ce\t%ct"])
|
155
|
+
output = CLI.exec_git_command(["show", "-s", "--format=%an\t%ae\t%at\t%cn\t%ce\t%ct", commit_sha].compact)
|
156
156
|
unless output
|
157
157
|
Datadog.logger.debug(
|
158
158
|
"Unable to read git commit users: git command output is nil"
|
@@ -268,7 +268,7 @@ module Datadog
|
|
268
268
|
false
|
269
269
|
end
|
270
270
|
|
271
|
-
def self.git_unshallow
|
271
|
+
def self.git_unshallow(parent_only: false)
|
272
272
|
Telemetry.git_command(Ext::Telemetry::Command::UNSHALLOW)
|
273
273
|
# @type var res: String?
|
274
274
|
res = nil
|
@@ -289,10 +289,11 @@ module Datadog
|
|
289
289
|
|
290
290
|
res =
|
291
291
|
begin
|
292
|
+
unshallowing_depth = parent_only ? "--deepen=1" : "--shallow-since=\"1 month ago\""
|
292
293
|
# @type var cmd: Array[String]
|
293
294
|
cmd = [
|
294
295
|
"fetch",
|
295
|
-
|
296
|
+
unshallowing_depth,
|
296
297
|
"--update-shallow",
|
297
298
|
"--filter=blob:none",
|
298
299
|
"--recurse-submodules=no",
|
data/lib/datadog/ci/span.rb
CHANGED
@@ -165,6 +165,30 @@ module Datadog
|
|
165
165
|
tracer_span.get_tag(Ext::Git::TAG_COMMIT_SHA)
|
166
166
|
end
|
167
167
|
|
168
|
+
# Returns the git commit message extracted from the environment.
|
169
|
+
# @return [String] the commit message.
|
170
|
+
def git_commit_message
|
171
|
+
get_tag(Ext::Git::TAG_COMMIT_MESSAGE)
|
172
|
+
end
|
173
|
+
|
174
|
+
# Returns the original last git commit SHA extracted from the environment.
|
175
|
+
# Original here means that it is the last commit that was pushed by the user,
|
176
|
+
# not the artifical merge commit created by CI provider
|
177
|
+
#
|
178
|
+
# @return [String] the commit SHA of the last commit.
|
179
|
+
def original_git_commit_sha
|
180
|
+
get_tag(Ext::Git::TAG_COMMIT_HEAD_SHA) || git_commit_sha
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the original last git commit message extracted from the environment.
|
184
|
+
# Original here means that it is the last commit that was pushed by the user,
|
185
|
+
# not the artifical merge commit created by CI provider
|
186
|
+
#
|
187
|
+
# @return [String] the commit message of the last commit.
|
188
|
+
def original_git_commit_message
|
189
|
+
get_tag(Ext::Git::TAG_COMMIT_HEAD_MESSAGE) || git_commit_message
|
190
|
+
end
|
191
|
+
|
168
192
|
# Returns the git branch name extracted from the environment.
|
169
193
|
# @return [String] the branch.
|
170
194
|
def git_branch
|
@@ -118,8 +118,8 @@ module Datadog
|
|
118
118
|
"type" => Ext::Transport::DD_API_TEST_MANAGEMENT_TESTS_TYPE,
|
119
119
|
"attributes" => {
|
120
120
|
"repository_url" => test_session.git_repository_url,
|
121
|
-
"commit_message" => test_session.
|
122
|
-
"sha" => test_session.
|
121
|
+
"commit_message" => test_session.original_git_commit_message,
|
122
|
+
"sha" => test_session.original_git_commit_sha
|
123
123
|
}
|
124
124
|
}
|
125
125
|
}.to_json
|
@@ -46,12 +46,6 @@ module Datadog
|
|
46
46
|
get_tag(Ext::Environment::TAG_JOB_NAME)
|
47
47
|
end
|
48
48
|
|
49
|
-
# Returns the git commit message extracted from the environment.
|
50
|
-
# @return [String] the commit message.
|
51
|
-
def git_commit_message
|
52
|
-
get_tag(Ext::Git::TAG_COMMIT_MESSAGE)
|
53
|
-
end
|
54
|
-
|
55
49
|
def skipping_tests?
|
56
50
|
get_tag(Ext::Test::TAG_ITR_TEST_SKIPPING_ENABLED) == "true"
|
57
51
|
end
|
@@ -215,7 +215,11 @@ module Datadog
|
|
215
215
|
end
|
216
216
|
|
217
217
|
def client_process?
|
218
|
-
forked
|
218
|
+
# We cannot assume here that every forked process is a client process
|
219
|
+
# there are examples of custom test runners that run tests in forks but don't have a test session
|
220
|
+
# started in the parent process.
|
221
|
+
# So we need to check if the process is forked and if the context service URI is not empty.
|
222
|
+
(forked? && !@context_service_uri.nil? && !@context_service_uri.empty?) || @is_client_process
|
219
223
|
end
|
220
224
|
|
221
225
|
private
|
@@ -446,6 +450,9 @@ module Datadog
|
|
446
450
|
def start_drb_service
|
447
451
|
return if @context_service_uri
|
448
452
|
return if client_process?
|
453
|
+
# it doesn't make sense to start DRb in a fork - we are already running in a forked process
|
454
|
+
# and there is no parent process to communicate with
|
455
|
+
return if forked?
|
449
456
|
|
450
457
|
@context_service = DRb.start_service("drbunix:", @context)
|
451
458
|
@context_service_uri = @context_service.uri
|
data/lib/datadog/ci/version.rb
CHANGED