datadog-ci 1.0.0.beta6 → 1.0.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 +12 -2
- data/README.md +15 -205
- data/lib/datadog/ci/codeowners/matcher.rb +1 -1
- data/lib/datadog/ci/codeowners/parser.rb +5 -5
- data/lib/datadog/ci/configuration/components.rb +15 -0
- data/lib/datadog/ci/contrib/cucumber/formatter.rb +1 -1
- data/lib/datadog/ci/contrib/rspec/example.rb +7 -4
- data/lib/datadog/ci/ext/environment/providers/gitlab.rb +2 -2
- data/lib/datadog/ci/ext/environment.rb +1 -4
- data/lib/datadog/ci/ext/settings.rb +7 -7
- data/lib/datadog/ci/itr/coverage/event.rb +1 -1
- data/lib/datadog/ci/test_visibility/serializers/base.rb +1 -7
- data/lib/datadog/ci/test_visibility/serializers/span.rb +2 -2
- data/lib/datadog/ci/test_visibility/serializers/test_module.rb +2 -2
- data/lib/datadog/ci/test_visibility/serializers/test_session.rb +2 -2
- data/lib/datadog/ci/test_visibility/serializers/test_suite.rb +2 -2
- data/lib/datadog/ci/test_visibility/serializers/test_v1.rb +2 -2
- data/lib/datadog/ci/test_visibility/serializers/test_v2.rb +3 -3
- data/lib/datadog/ci/transport/http.rb +1 -0
- data/lib/datadog/ci/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f96afc61b44202e506967dc7b2d6ec956c02561a99ec7e9eae4dc26902688b7
|
4
|
+
data.tar.gz: f6d66d038f8c5a5632f6c27ed2a3c70d9f85394fca2c237825041cb523063ec4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6a548db92e125ae6fdb23301554efec581f72ca63b9a32384be33162eb90daa79ebf67ccb5834f2347b094f8d131129cd4a6963a817c55beaed83e0cd10b96b
|
7
|
+
data.tar.gz: e6da7ae7f7607955b206859e8a6c583d65aea03c59d538de2c3c7de41433a0b9942fe48e6d79db9bc7cb6546100b001dfd90b421c7ed392aa6d10e14034ecd08
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [1.0.0] - 2024-06-06
|
4
|
+
|
5
|
+
|
6
|
+
### Changed
|
7
|
+
* automatically trace with correct time even when time is stubbed by timecop ([#185][])
|
8
|
+
* depend on gem datadog ~> 2.0 ([#190][])
|
9
|
+
|
3
10
|
## [1.0.0.beta6] - 2024-05-29
|
4
11
|
|
5
12
|
### Added
|
@@ -254,7 +261,8 @@ Currently test suite level visibility is not used by our instrumentation: it wil
|
|
254
261
|
|
255
262
|
- Ruby versions < 2.7 no longer supported ([#8][])
|
256
263
|
|
257
|
-
[Unreleased]: https://github.com/DataDog/datadog-ci-rb/compare/v1.0.0
|
264
|
+
[Unreleased]: https://github.com/DataDog/datadog-ci-rb/compare/v1.0.0...main
|
265
|
+
[1.0.0]: https://github.com/DataDog/datadog-ci-rb/compare/v1.0.0.beta6...v1.0.0
|
258
266
|
[1.0.0.beta6]: https://github.com/DataDog/datadog-ci-rb/compare/v1.0.0.beta5...v1.0.0.beta6
|
259
267
|
[1.0.0.beta5]: https://github.com/DataDog/datadog-ci-rb/compare/v1.0.0.beta4...v1.0.0.beta5
|
260
268
|
[1.0.0.beta4]: https://github.com/DataDog/datadog-ci-rb/compare/v1.0.0.beta3...v1.0.0.beta4
|
@@ -358,4 +366,6 @@ Currently test suite level visibility is not used by our instrumentation: it wil
|
|
358
366
|
[#174]: https://github.com/DataDog/datadog-ci-rb/issues/174
|
359
367
|
[#175]: https://github.com/DataDog/datadog-ci-rb/issues/175
|
360
368
|
[#180]: https://github.com/DataDog/datadog-ci-rb/issues/180
|
361
|
-
[#183]: https://github.com/DataDog/datadog-ci-rb/issues/183
|
369
|
+
[#183]: https://github.com/DataDog/datadog-ci-rb/issues/183
|
370
|
+
[#185]: https://github.com/DataDog/datadog-ci-rb/issues/185
|
371
|
+
[#190]: https://github.com/DataDog/datadog-ci-rb/issues/190
|
data/README.md
CHANGED
@@ -1,13 +1,23 @@
|
|
1
|
-
# Datadog
|
1
|
+
# Datadog Test Visibility for Ruby
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/datadog-ci.svg)](https://badge.fury.io/rb/datadog-ci)
|
4
4
|
[![YARD documentation](https://img.shields.io/badge/YARD-documentation-blue)](https://datadoghq.dev/datadog-ci-rb/)
|
5
5
|
[![codecov](https://codecov.io/gh/DataDog/datadog-ci-rb/branch/main/graph/badge.svg)](https://app.codecov.io/gh/DataDog/datadog-ci-rb/branch/main)
|
6
6
|
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/DataDog/datadog-ci-rb/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/DataDog/datadog-ci-rb/tree/main)
|
7
7
|
|
8
|
-
Datadog's Ruby Library for instrumenting your
|
8
|
+
Datadog's Ruby Library for instrumenting your tests.
|
9
9
|
Learn more on our [official website](https://docs.datadoghq.com/tests/) and check out our [documentation for this library](https://docs.datadoghq.com/tests/setup/ruby/?tab=cloudciprovideragentless).
|
10
10
|
|
11
|
+
## Features
|
12
|
+
|
13
|
+
- [Test Visibility](https://docs.datadoghq.com/tests/) - collect metrics and results for your tests
|
14
|
+
- [Intelligent test runner](https://docs.datadoghq.com/intelligent_test_runner/) - save time by selectively running only tests affected by code changes
|
15
|
+
- [Search and manage CI tests](https://docs.datadoghq.com/tests/search/)
|
16
|
+
- [Enhance developer workflows](https://docs.datadoghq.com/tests/developer_workflows)
|
17
|
+
- [Flaky test management](https://docs.datadoghq.com/tests/guides/flaky_test_management/)
|
18
|
+
- [Add custom measures to your tests](https://docs.datadoghq.com/tests/guides/add_custom_measures/?tab=ruby)
|
19
|
+
- [Browser tests integration with Datadog RUM](https://docs.datadoghq.com/tests/browser_tests)
|
20
|
+
|
11
21
|
## Installation
|
12
22
|
|
13
23
|
Add to your Gemfile.
|
@@ -22,210 +32,10 @@ end
|
|
22
32
|
|
23
33
|
If you used [test visibility for Ruby](https://docs.datadoghq.com/tests/setup/ruby/) with [ddtrace](https://github.com/datadog/dd-trace-rb) gem, check out our [upgrade guide](/docs/UpgradeGuide.md).
|
24
34
|
|
25
|
-
##
|
26
|
-
|
27
|
-
### RSpec
|
28
|
-
|
29
|
-
To activate `RSpec` integration, add this to the `spec_helper.rb` file:
|
30
|
-
|
31
|
-
```ruby
|
32
|
-
require 'rspec'
|
33
|
-
require 'datadog/ci'
|
34
|
-
|
35
|
-
# Only activates test instrumentation on CI
|
36
|
-
if ENV["DD_ENV"] == "ci"
|
37
|
-
Datadog.configure do |c|
|
38
|
-
# The name of the service or library under test
|
39
|
-
c.service = 'my-ruby-app'
|
40
|
-
c.ci.enabled = true
|
41
|
-
c.ci.instrument :rspec
|
42
|
-
end
|
43
|
-
end
|
44
|
-
```
|
45
|
-
|
46
|
-
### Minitest
|
47
|
-
|
48
|
-
The Minitest integration will trace all executions of tests when using `minitest` test framework.
|
49
|
-
|
50
|
-
To activate your integration, use the `Datadog.configure` method:
|
51
|
-
|
52
|
-
```ruby
|
53
|
-
require 'minitest'
|
54
|
-
require 'datadog/ci'
|
55
|
-
|
56
|
-
# Only activates test instrumentation on CI
|
57
|
-
if ENV["DD_ENV"] == "ci"
|
58
|
-
# Configure default Minitest integration
|
59
|
-
Datadog.configure do |c|
|
60
|
-
# The name of the service or library under test
|
61
|
-
c.service = 'my-ruby-app'
|
62
|
-
c.ci.enabled = true
|
63
|
-
c.ci.instrument :minitest
|
64
|
-
end
|
65
|
-
end
|
66
|
-
```
|
67
|
-
|
68
|
-
> [!IMPORTANT]
|
69
|
-
> When using `minitest/autorun` the order of requires matters: `datadog/ci` must be
|
70
|
-
> always required before `minitest/autorun`.
|
71
|
-
|
72
|
-
Example using `minitest/autorun`
|
73
|
-
|
74
|
-
```ruby
|
75
|
-
require 'datadog/ci'
|
76
|
-
require 'minitest/autorun'
|
77
|
-
|
78
|
-
if ENV["DD_ENV"] == "ci"
|
79
|
-
Datadog.configure do |c|
|
80
|
-
c.service = 'my-ruby-app'
|
81
|
-
c.ci.enabled = true
|
82
|
-
c.ci.instrument :minitest
|
83
|
-
end
|
84
|
-
end
|
85
|
-
```
|
86
|
-
|
87
|
-
### Cucumber
|
88
|
-
|
89
|
-
Activate `Cucumber` integration with configuration
|
90
|
-
|
91
|
-
```ruby
|
92
|
-
require 'cucumber'
|
93
|
-
require 'datadog/ci'
|
94
|
-
|
95
|
-
# Only activates test instrumentation on CI
|
96
|
-
if ENV["DD_ENV"] == "ci"
|
97
|
-
Datadog.configure do |c|
|
98
|
-
# The name of the service or library under test
|
99
|
-
c.service = 'my-ruby-app'
|
100
|
-
c.ci.enabled = true
|
101
|
-
c.ci.instrument :cucumber
|
102
|
-
end
|
103
|
-
end
|
104
|
-
```
|
105
|
-
|
106
|
-
### Instrumentation options
|
107
|
-
|
108
|
-
Configuration `ci.instrument` accepts the following optional parameters:
|
35
|
+
## Setup
|
109
36
|
|
110
|
-
-
|
111
|
-
-
|
112
|
-
|
113
|
-
Example usage:
|
114
|
-
|
115
|
-
```ruby
|
116
|
-
Datadog.configure do |c|
|
117
|
-
c.service = 'my-ruby-app'
|
118
|
-
c.ci.enabled = true
|
119
|
-
c.ci.instrument :cucumber, service_name: 'my-cucumber-features', enabled: true
|
120
|
-
c.ci.instrument :minitest, service_name: 'my-unit-tests', enabled: false
|
121
|
-
end
|
122
|
-
```
|
123
|
-
|
124
|
-
## Agentless mode
|
125
|
-
|
126
|
-
If you are using a cloud CI provider without access to the underlying worker nodes, such as GitHub Actions or CircleCI, configure the library to use the Agentless mode. For this, set the following environment variables:
|
127
|
-
`DD_CIVISIBILITY_AGENTLESS_ENABLED=true (Required)` and `DD_API_KEY=your_secret_api_key (Required)`.
|
128
|
-
|
129
|
-
Additionally, configure which [Datadog site](https://docs.datadoghq.com/getting_started/site/) you want to send data to:
|
130
|
-
`DD_SITE=your.datadoghq.com` (datadoghq.com by default).
|
131
|
-
|
132
|
-
Agentless mode can also be enabled via `Datadog.configure` (but don't forget to set DD_API_KEY environment variable):
|
133
|
-
|
134
|
-
```ruby
|
135
|
-
Datadog.configure { |c| c.ci.agentless_mode_enabled = true }
|
136
|
-
```
|
137
|
-
|
138
|
-
## Additional configuration
|
139
|
-
|
140
|
-
### Add tracing instrumentations
|
141
|
-
|
142
|
-
It can be useful to have rich tracing information about your tests that includes time spent performing database operations
|
143
|
-
or other external calls like here:
|
144
|
-
|
145
|
-
![Test trace with redis instrumented](./docs/screenshots/test-trace-with-redis.png)
|
146
|
-
|
147
|
-
To achieve this, add Datadog tracing instrumentations in your `Datadog.configure` block:
|
148
|
-
|
149
|
-
```ruby
|
150
|
-
Datadog.configure do |c|
|
151
|
-
# ... ci configs and instrumentation here ...
|
152
|
-
c.tracing.instrument :redis
|
153
|
-
c.tracing.instrument :pg
|
154
|
-
end
|
155
|
-
```
|
156
|
-
|
157
|
-
...or enable auto instrumentation in your test_helper/spec_helper:
|
158
|
-
|
159
|
-
```ruby
|
160
|
-
require "datadog/auto_instrument"
|
161
|
-
```
|
162
|
-
|
163
|
-
Note: in CI mode these traces are going to be submitted to CI Visibility,
|
164
|
-
they will **not** show up in Datadog APM.
|
165
|
-
|
166
|
-
For the full list of available instrumentations see [datadog documentation](https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md)
|
167
|
-
|
168
|
-
### WebMock
|
169
|
-
|
170
|
-
[WebMock](https://github.com/bblimke/webmock)
|
171
|
-
is a popular Ruby library that stubs HTTP requests when running tests.
|
172
|
-
By default it fails when used together with datadog-ci as traces are being sent
|
173
|
-
to Datadog via HTTP calls.
|
174
|
-
|
175
|
-
In order to allow HTTP connections for Datadog backend you would need to configure
|
176
|
-
Webmock accordingly.
|
177
|
-
|
178
|
-
```ruby
|
179
|
-
# when using agentless mode
|
180
|
-
WebMock.disable_net_connect!(:allow => /datadoghq/)
|
181
|
-
|
182
|
-
# when using agent
|
183
|
-
WebMock.disable_net_connect!(:allow_localhost => true)
|
184
|
-
|
185
|
-
# or for more granular setting set your agent URL
|
186
|
-
WebMock.disable_net_connect!(:allow => "localhost:8126")
|
187
|
-
```
|
188
|
-
|
189
|
-
### VCR
|
190
|
-
|
191
|
-
[VCR](https://github.com/vcr/vcr) is another popular testing library for HTTP interactions.
|
192
|
-
|
193
|
-
It requires additional configuration to correctly work with datadog-ci:
|
194
|
-
|
195
|
-
```ruby
|
196
|
-
VCR.configure do |config|
|
197
|
-
# ... your usual configuration here ...
|
198
|
-
|
199
|
-
# when using agent
|
200
|
-
config.ignore_hosts "127.0.0.1", "localhost"
|
201
|
-
|
202
|
-
# when using agentless mode
|
203
|
-
config.ignore_request do |request|
|
204
|
-
# ignore all requests to datadoghq hosts
|
205
|
-
request.uri =~ /datadoghq/
|
206
|
-
end
|
207
|
-
end
|
208
|
-
```
|
209
|
-
|
210
|
-
### Disabling startup logs
|
211
|
-
|
212
|
-
Startup logs produce a report of tracing state when the application is initially configured.
|
213
|
-
These logs are activated by default in test mode, if you don't want them you can disable this
|
214
|
-
via `DD_TRACE_STARTUP_LOGS=0` or in the `Datadog.configure` block:
|
215
|
-
|
216
|
-
```ruby
|
217
|
-
Datadog.configure { |c| c.diagnostics.startup_logs.enabled = false }
|
218
|
-
```
|
219
|
-
|
220
|
-
### Enabling debug mode
|
221
|
-
|
222
|
-
Switching the library into debug mode will produce verbose, detailed logs about tracing activity, including any suppressed errors. This output can be helpful in identifying errors, confirming trace output, or catching HTTP transport issues.
|
223
|
-
|
224
|
-
You can enable this via `DD_TRACE_DEBUG=1` or in the `Datadog.configure` block:
|
225
|
-
|
226
|
-
```ruby
|
227
|
-
Datadog.configure { |c| c.diagnostics.debug = true }
|
228
|
-
```
|
37
|
+
- [Test visibility setup](https://docs.datadoghq.com/tests/setup/ruby/?tab=cloudciprovideragentless)
|
38
|
+
- [Intelligent test runner setup](https://docs.datadoghq.com/intelligent_test_runner/setup/ruby) (test visibility setup is required before setting up intelligent test runner)
|
229
39
|
|
230
40
|
## Contributing
|
231
41
|
|
@@ -87,7 +87,7 @@ module Datadog
|
|
87
87
|
return pattern if pattern == "*"
|
88
88
|
|
89
89
|
# if pattern ends with a slash then it matches everything deeply nested in this directory
|
90
|
-
pattern
|
90
|
+
pattern << "**" if pattern.end_with?(::File::SEPARATOR)
|
91
91
|
|
92
92
|
# if pattern doesn't start with a slash then it matches anywhere in the repository
|
93
93
|
if !pattern.start_with?(::File::SEPARATOR, "**#{::File::SEPARATOR}", "*#{::File::SEPARATOR}")
|
@@ -8,11 +8,11 @@ module Datadog
|
|
8
8
|
# Responsible for parsing a CODEOWNERS file
|
9
9
|
class Parser
|
10
10
|
DEFAULT_LOCATION = "CODEOWNERS"
|
11
|
-
POSSIBLE_CODEOWNERS_LOCATIONS = [
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
POSSIBLE_CODEOWNERS_LOCATIONS = %w[
|
12
|
+
CODEOWNERS
|
13
|
+
.github/CODEOWNERS
|
14
|
+
.gitlab/CODEOWNERS
|
15
|
+
docs/CODEOWNERS
|
16
16
|
].freeze
|
17
17
|
|
18
18
|
def initialize(root_file_path)
|
@@ -70,6 +70,17 @@ module Datadog
|
|
70
70
|
# Choose user defined TraceFlush or default to CI TraceFlush
|
71
71
|
settings.tracing.test_mode.trace_flush = settings.ci.trace_flush || CI::TestVisibility::Flush::Partial.new
|
72
72
|
|
73
|
+
# When timecop is present, Time.now is mocked and .now_without_mock_time is added on Time to
|
74
|
+
# get the current time without the mock.
|
75
|
+
if timecop?
|
76
|
+
settings.time_now_provider = -> do
|
77
|
+
Time.now_without_mock_time
|
78
|
+
rescue NoMethodError
|
79
|
+
# fallback to normal Time.now if Time.now_without_mock_time is not defined for any reason
|
80
|
+
Time.now
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
73
84
|
# startup logs are useless for CI visibility and create noise
|
74
85
|
settings.diagnostics.startup_logs.enabled = false
|
75
86
|
|
@@ -191,6 +202,10 @@ module Datadog
|
|
191
202
|
"Please make sure to set valid site in DD_SITE environment variable"
|
192
203
|
end
|
193
204
|
end
|
205
|
+
|
206
|
+
def timecop?
|
207
|
+
Gem.loaded_specs.key?("timecop") || defined?(Timecop)
|
208
|
+
end
|
194
209
|
end
|
195
210
|
end
|
196
211
|
end
|
@@ -187,7 +187,7 @@ module Datadog
|
|
187
187
|
def ok?(result, strict)
|
188
188
|
# in minor update in Cucumber 9.2.0, the arity of the `ok?` method changed
|
189
189
|
parameters = result.method(:ok?).parameters
|
190
|
-
if parameters == [[
|
190
|
+
if parameters == [%i[opt be_strict]]
|
191
191
|
result.ok?(strict)
|
192
192
|
else
|
193
193
|
result.ok?(strict: strict)
|
@@ -23,7 +23,7 @@ module Datadog
|
|
23
23
|
test_name = full_description.strip
|
24
24
|
if metadata[:description].empty?
|
25
25
|
# for unnamed it blocks this appends something like "example at ./spec/some_spec.rb:10"
|
26
|
-
test_name
|
26
|
+
test_name << " #{description}"
|
27
27
|
end
|
28
28
|
|
29
29
|
test_suite_description = fetch_top_level_example_group[:description]
|
@@ -33,7 +33,7 @@ module Datadog
|
|
33
33
|
test_name = test_name.sub(test_suite_description, "").strip
|
34
34
|
|
35
35
|
if ci_queue?
|
36
|
-
suite_name
|
36
|
+
suite_name = "#{suite_name} (ci-queue running example [#{test_name}])"
|
37
37
|
test_suite_span = CI.start_test_suite(suite_name)
|
38
38
|
end
|
39
39
|
|
@@ -83,9 +83,12 @@ module Datadog
|
|
83
83
|
private
|
84
84
|
|
85
85
|
def fetch_top_level_example_group
|
86
|
-
|
86
|
+
example_group = metadata[:example_group]
|
87
|
+
parent_example_group = example_group[:parent_example_group]
|
87
88
|
|
88
|
-
|
89
|
+
return example_group unless parent_example_group
|
90
|
+
|
91
|
+
res = parent_example_group
|
89
92
|
while (parent = res[:parent_example_group])
|
90
93
|
res = parent
|
91
94
|
end
|
@@ -75,12 +75,12 @@ module Datadog
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def git_commit_author_name
|
78
|
-
name,
|
78
|
+
name, _email = extract_name_email
|
79
79
|
name
|
80
80
|
end
|
81
81
|
|
82
82
|
def git_commit_author_email
|
83
|
-
|
83
|
+
_name, email = extract_name_email
|
84
84
|
email
|
85
85
|
end
|
86
86
|
|
@@ -23,10 +23,7 @@ module Datadog
|
|
23
23
|
TAG_NODE_NAME = "ci.node.name"
|
24
24
|
TAG_CI_ENV_VARS = "_dd.ci.env_vars"
|
25
25
|
|
26
|
-
POSSIBLE_BUNDLE_LOCATIONS = [
|
27
|
-
"vendor/bundle",
|
28
|
-
".bundle"
|
29
|
-
].freeze
|
26
|
+
POSSIBLE_BUNDLE_LOCATIONS = %w[vendor/bundle .bundle].freeze
|
30
27
|
|
31
28
|
module_function
|
32
29
|
|
@@ -15,13 +15,13 @@ module Datadog
|
|
15
15
|
ENV_ITR_CODE_COVERAGE_EXCLUDED_BUNDLE_PATH = "DD_CIVISIBILITY_ITR_CODE_COVERAGE_EXCLUDED_BUNDLE_PATH"
|
16
16
|
|
17
17
|
# Source: https://docs.datadoghq.com/getting_started/site/
|
18
|
-
DD_SITE_ALLOWLIST = [
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
DD_SITE_ALLOWLIST = %w[
|
19
|
+
datadoghq.com
|
20
|
+
us3.datadoghq.com
|
21
|
+
us5.datadoghq.com
|
22
|
+
datadoghq.eu
|
23
|
+
ddog-gov.com
|
24
|
+
ap1.datadoghq.com
|
25
25
|
].freeze
|
26
26
|
end
|
27
27
|
end
|
@@ -21,7 +21,7 @@ module Datadog
|
|
21
21
|
def valid?
|
22
22
|
valid = true
|
23
23
|
|
24
|
-
[
|
24
|
+
%i[test_id test_suite_id test_session_id coverage].each do |key|
|
25
25
|
next unless send(key).nil?
|
26
26
|
|
27
27
|
Datadog.logger.warn("citestcov event is invalid: [#{key}] is nil. Event: #{self}")
|
@@ -20,13 +20,7 @@ module Datadog
|
|
20
20
|
"type" => "span_type"
|
21
21
|
].freeze
|
22
22
|
|
23
|
-
REQUIRED_FIELDS = [
|
24
|
-
"error",
|
25
|
-
"name",
|
26
|
-
"resource",
|
27
|
-
"start",
|
28
|
-
"duration"
|
29
|
-
].freeze
|
23
|
+
REQUIRED_FIELDS = %w[error name resource start duration].freeze
|
30
24
|
|
31
25
|
attr_reader :trace, :span, :meta, :options
|
32
26
|
|
@@ -7,11 +7,11 @@ module Datadog
|
|
7
7
|
module TestVisibility
|
8
8
|
module Serializers
|
9
9
|
class Span < Base
|
10
|
-
CONTENT_FIELDS = ([
|
10
|
+
CONTENT_FIELDS = (%w[trace_id span_id parent_id] + Base::CONTENT_FIELDS).freeze
|
11
11
|
|
12
12
|
CONTENT_MAP_SIZE = calculate_content_map_size(CONTENT_FIELDS)
|
13
13
|
|
14
|
-
REQUIRED_FIELDS = ([
|
14
|
+
REQUIRED_FIELDS = (%w[trace_id span_id] + Base::REQUIRED_FIELDS).freeze
|
15
15
|
|
16
16
|
def content_fields
|
17
17
|
CONTENT_FIELDS
|
@@ -8,11 +8,11 @@ module Datadog
|
|
8
8
|
module TestVisibility
|
9
9
|
module Serializers
|
10
10
|
class TestModule < Base
|
11
|
-
CONTENT_FIELDS = ([
|
11
|
+
CONTENT_FIELDS = (%w[test_session_id test_module_id] + Base::CONTENT_FIELDS).freeze
|
12
12
|
|
13
13
|
CONTENT_MAP_SIZE = calculate_content_map_size(CONTENT_FIELDS)
|
14
14
|
|
15
|
-
REQUIRED_FIELDS = ([
|
15
|
+
REQUIRED_FIELDS = (%w[test_session_id test_module_id] + Base::REQUIRED_FIELDS).freeze
|
16
16
|
|
17
17
|
def content_fields
|
18
18
|
CONTENT_FIELDS
|
@@ -8,11 +8,11 @@ module Datadog
|
|
8
8
|
module TestVisibility
|
9
9
|
module Serializers
|
10
10
|
class TestSession < Base
|
11
|
-
CONTENT_FIELDS = ([
|
11
|
+
CONTENT_FIELDS = (%w[test_session_id] + Base::CONTENT_FIELDS).freeze
|
12
12
|
|
13
13
|
CONTENT_MAP_SIZE = calculate_content_map_size(CONTENT_FIELDS)
|
14
14
|
|
15
|
-
REQUIRED_FIELDS = ([
|
15
|
+
REQUIRED_FIELDS = (%w[test_session_id] + Base::REQUIRED_FIELDS).freeze
|
16
16
|
|
17
17
|
def content_fields
|
18
18
|
CONTENT_FIELDS
|
@@ -8,11 +8,11 @@ module Datadog
|
|
8
8
|
module TestVisibility
|
9
9
|
module Serializers
|
10
10
|
class TestSuite < Base
|
11
|
-
CONTENT_FIELDS = ([
|
11
|
+
CONTENT_FIELDS = (%w[test_session_id test_module_id test_suite_id] + Base::CONTENT_FIELDS).freeze
|
12
12
|
|
13
13
|
CONTENT_MAP_SIZE = calculate_content_map_size(CONTENT_FIELDS)
|
14
14
|
|
15
|
-
REQUIRED_FIELDS = ([
|
15
|
+
REQUIRED_FIELDS = (%w[test_session_id test_module_id test_suite_id] + Base::REQUIRED_FIELDS).freeze
|
16
16
|
|
17
17
|
def content_fields
|
18
18
|
CONTENT_FIELDS
|
@@ -8,11 +8,11 @@ module Datadog
|
|
8
8
|
module TestVisibility
|
9
9
|
module Serializers
|
10
10
|
class TestV1 < Base
|
11
|
-
CONTENT_FIELDS = ([
|
11
|
+
CONTENT_FIELDS = (%w[trace_id span_id] + Base::CONTENT_FIELDS).freeze
|
12
12
|
|
13
13
|
CONTENT_MAP_SIZE = calculate_content_map_size(CONTENT_FIELDS)
|
14
14
|
|
15
|
-
REQUIRED_FIELDS = ([
|
15
|
+
REQUIRED_FIELDS = (%w[trace_id span_id] + Base::REQUIRED_FIELDS).freeze
|
16
16
|
|
17
17
|
def content_fields
|
18
18
|
CONTENT_FIELDS
|
@@ -8,15 +8,15 @@ module Datadog
|
|
8
8
|
module TestVisibility
|
9
9
|
module Serializers
|
10
10
|
class TestV2 < TestV1
|
11
|
-
CONTENT_FIELDS = ([
|
11
|
+
CONTENT_FIELDS = (%w[test_session_id test_module_id test_suite_id] + TestV1::CONTENT_FIELDS).freeze
|
12
12
|
|
13
|
-
CONTENT_FIELDS_WITH_ITR_CORRELATION_ID = (CONTENT_FIELDS + [
|
13
|
+
CONTENT_FIELDS_WITH_ITR_CORRELATION_ID = (CONTENT_FIELDS + %w[itr_correlation_id]).freeze
|
14
14
|
|
15
15
|
CONTENT_MAP_SIZE = calculate_content_map_size(CONTENT_FIELDS)
|
16
16
|
|
17
17
|
CONTENT_MAP_SIZE_WITH_ITR_CORRELATION_ID = calculate_content_map_size(CONTENT_FIELDS_WITH_ITR_CORRELATION_ID)
|
18
18
|
|
19
|
-
REQUIRED_FIELDS = ([
|
19
|
+
REQUIRED_FIELDS = (%w[test_session_id test_module_id test_suite_id] + TestV1::REQUIRED_FIELDS).freeze
|
20
20
|
|
21
21
|
def content_fields
|
22
22
|
return CONTENT_FIELDS if itr_correlation_id.nil?
|
data/lib/datadog/ci/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datadog-ci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Datadog, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: datadog
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.0
|
19
|
+
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.0
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: msgpack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
201
|
- !ruby/object:Gem::Version
|
202
202
|
version: 2.0.0
|
203
203
|
requirements: []
|
204
|
-
rubygems_version: 3.
|
204
|
+
rubygems_version: 3.5.9
|
205
205
|
signing_key:
|
206
206
|
specification_version: 4
|
207
207
|
summary: Datadog CI visibility for your ruby application
|