datadog-ci 1.27.0 → 1.28.0
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 +15 -2
- data/ext/datadog_ci_native/datadog_cov.c +2 -2
- data/lib/datadog/ci/cli/command/exec.rb +1 -1
- data/lib/datadog/ci/cli/command/skippable_tests_percentage.rb +2 -2
- data/lib/datadog/ci/cli/command/skippable_tests_percentage_estimate.rb +2 -2
- data/lib/datadog/ci/configuration/components.rb +28 -28
- data/lib/datadog/ci/contrib/cucumber/formatter.rb +11 -11
- data/lib/datadog/ci/contrib/knapsack/runner.rb +4 -4
- data/lib/datadog/ci/contrib/minitest/helpers.rb +2 -2
- data/lib/datadog/ci/contrib/minitest/runnable_minitest_6.rb +2 -2
- data/lib/datadog/ci/contrib/minitest/runner.rb +5 -5
- data/lib/datadog/ci/contrib/minitest/test.rb +4 -4
- data/lib/datadog/ci/contrib/parallel_tests/cli.rb +7 -7
- data/lib/datadog/ci/contrib/rspec/example.rb +182 -64
- data/lib/datadog/ci/contrib/rspec/example_group.rb +8 -8
- data/lib/datadog/ci/contrib/rspec/runner.rb +4 -4
- data/lib/datadog/ci/git/tree_uploader.rb +4 -4
- data/lib/datadog/ci/logs/component.rb +3 -3
- data/lib/datadog/ci/remote/component.rb +6 -6
- data/lib/datadog/ci/span.rb +3 -3
- data/lib/datadog/ci/test.rb +4 -4
- data/lib/datadog/ci/{test_optimisation → test_impact_analysis}/component.rb +7 -7
- data/lib/datadog/ci/{test_optimisation → test_impact_analysis}/coverage/ddcov.rb +1 -1
- data/lib/datadog/ci/{test_optimisation → test_impact_analysis}/coverage/event.rb +1 -1
- data/lib/datadog/ci/{test_optimisation → test_impact_analysis}/coverage/transport.rb +1 -1
- data/lib/datadog/ci/{test_optimisation → test_impact_analysis}/null_component.rb +2 -2
- data/lib/datadog/ci/{test_optimisation → test_impact_analysis}/skippable.rb +1 -1
- data/lib/datadog/ci/{test_optimisation → test_impact_analysis}/skippable_percentage/base.rb +9 -9
- data/lib/datadog/ci/{test_optimisation → test_impact_analysis}/skippable_percentage/calculator.rb +5 -5
- data/lib/datadog/ci/{test_optimisation → test_impact_analysis}/skippable_percentage/estimator.rb +3 -3
- data/lib/datadog/ci/{test_optimisation → test_impact_analysis}/telemetry.rb +3 -3
- data/lib/datadog/ci/test_module.rb +1 -1
- data/lib/datadog/ci/test_retries/component.rb +7 -0
- data/lib/datadog/ci/test_retries/driver/base.rb +4 -0
- data/lib/datadog/ci/test_retries/driver/no_retry.rb +4 -0
- data/lib/datadog/ci/test_retries/driver/retry_flake_detection.rb +15 -2
- data/lib/datadog/ci/test_retries/driver/retry_flaky_fixed.rb +7 -3
- data/lib/datadog/ci/test_retries/strategy/retry_flaky_fixed.rb +1 -1
- data/lib/datadog/ci/test_session.rb +2 -2
- data/lib/datadog/ci/test_suite.rb +1 -1
- data/lib/datadog/ci/{test_visibility → test_tracing}/component.rb +12 -12
- data/lib/datadog/ci/{test_visibility → test_tracing}/context.rb +7 -7
- data/lib/datadog/ci/{test_visibility/total_coverage.rb → test_tracing/deprecated_total_coverage_metric.rb} +2 -2
- data/lib/datadog/ci/{test_visibility → test_tracing}/flush.rb +1 -1
- data/lib/datadog/ci/{test_visibility → test_tracing}/known_tests.rb +1 -1
- data/lib/datadog/ci/{test_visibility → test_tracing}/null_component.rb +1 -1
- data/lib/datadog/ci/{test_visibility → test_tracing}/null_transport.rb +1 -1
- data/lib/datadog/ci/{test_visibility → test_tracing}/serializers/base.rb +3 -3
- data/lib/datadog/ci/{test_visibility → test_tracing}/serializers/factories/test_level.rb +1 -1
- data/lib/datadog/ci/{test_visibility → test_tracing}/serializers/factories/test_suite_level.rb +1 -1
- data/lib/datadog/ci/{test_visibility → test_tracing}/serializers/span.rb +1 -1
- data/lib/datadog/ci/{test_visibility → test_tracing}/serializers/test_module.rb +1 -1
- data/lib/datadog/ci/{test_visibility → test_tracing}/serializers/test_session.rb +2 -2
- data/lib/datadog/ci/{test_visibility → test_tracing}/serializers/test_suite.rb +1 -1
- data/lib/datadog/ci/{test_visibility → test_tracing}/serializers/test_v1.rb +1 -1
- data/lib/datadog/ci/{test_visibility → test_tracing}/serializers/test_v2.rb +1 -1
- data/lib/datadog/ci/{test_visibility → test_tracing}/store/fiber_local.rb +1 -1
- data/lib/datadog/ci/{test_visibility → test_tracing}/store/process.rb +1 -1
- data/lib/datadog/ci/{test_visibility → test_tracing}/telemetry.rb +1 -1
- data/lib/datadog/ci/{test_visibility → test_tracing}/transport.rb +8 -8
- data/lib/datadog/ci/utils/bundle.rb +14 -0
- data/lib/datadog/ci/utils/stateful.rb +2 -2
- data/lib/datadog/ci/version.rb +1 -1
- data/lib/datadog/ci.rb +15 -15
- metadata +31 -31
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e9b1bc98a924cc6601633633b9feb70bf48f79872266845b55505f1c5cd12837
|
|
4
|
+
data.tar.gz: e3aa6b68b3d65959178370fb7c4f2ee26094efb8de1da9e7f22d0b35e0a07729
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c0562103f425826f918fd9c2c53ceacdb27e6e19280fd2e9ce47c67e1a7da631ab0b4c6dcf2fe28868aa166f5c5822b160a539f6f65ec462d5f7417c4d491a58
|
|
7
|
+
data.tar.gz: 4dbf986a49b767d5bc579800bd89716ef24f3263017c40c3410026fc879a5774626bb84f572386eb7ed93298031ed680ccbf1e7ff280061ba2d5d3674ab5c8fe
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.28.0] - 2026-02-16
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
* Early exit test retries when further retries no longer provide value ([#473][])
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
* Fix source location tags for specs created by rswag-specs ([#468][])
|
|
12
|
+
|
|
3
13
|
## [1.27.0] - 2026-01-22
|
|
4
14
|
|
|
5
15
|
|
|
@@ -598,7 +608,8 @@ Currently test suite level visibility is not used by our instrumentation: it wil
|
|
|
598
608
|
|
|
599
609
|
- Ruby versions < 2.7 no longer supported ([#8][])
|
|
600
610
|
|
|
601
|
-
[Unreleased]: https://github.com/DataDog/datadog-ci-rb/compare/v1.
|
|
611
|
+
[Unreleased]: https://github.com/DataDog/datadog-ci-rb/compare/v1.28.0...main
|
|
612
|
+
[1.28.0]: https://github.com/DataDog/datadog-ci-rb/compare/v1.27.0...v1.28.0
|
|
602
613
|
[1.27.0]: https://github.com/DataDog/datadog-ci-rb/compare/v1.26.0...v1.27.0
|
|
603
614
|
[1.26.0]: https://github.com/DataDog/datadog-ci-rb/compare/v1.25.0...v1.26.0
|
|
604
615
|
[1.25.0]: https://github.com/DataDog/datadog-ci-rb/compare/v1.24.0...v1.25.0
|
|
@@ -849,4 +860,6 @@ Currently test suite level visibility is not used by our instrumentation: it wil
|
|
|
849
860
|
[#458]: https://github.com/DataDog/datadog-ci-rb/issues/458
|
|
850
861
|
[#460]: https://github.com/DataDog/datadog-ci-rb/issues/460
|
|
851
862
|
[#463]: https://github.com/DataDog/datadog-ci-rb/issues/463
|
|
852
|
-
[#464]: https://github.com/DataDog/datadog-ci-rb/issues/464
|
|
863
|
+
[#464]: https://github.com/DataDog/datadog-ci-rb/issues/464
|
|
864
|
+
[#468]: https://github.com/DataDog/datadog-ci-rb/issues/468
|
|
865
|
+
[#473]: https://github.com/DataDog/datadog-ci-rb/issues/473
|
|
@@ -381,8 +381,8 @@ static VALUE dd_cov_stop(VALUE self) {
|
|
|
381
381
|
void Init_datadog_cov(void) {
|
|
382
382
|
VALUE mDatadog = rb_define_module("Datadog");
|
|
383
383
|
VALUE mCI = rb_define_module_under(mDatadog, "CI");
|
|
384
|
-
VALUE
|
|
385
|
-
VALUE mCoverage = rb_define_module_under(
|
|
384
|
+
VALUE mTestImpactAnalysis = rb_define_module_under(mCI, "TestImpactAnalysis");
|
|
385
|
+
VALUE mCoverage = rb_define_module_under(mTestImpactAnalysis, "Coverage");
|
|
386
386
|
VALUE cDatadogCov = rb_define_class_under(mCoverage, "DDCov", rb_cObject);
|
|
387
387
|
|
|
388
388
|
rb_define_alloc_func(cDatadogCov, dd_cov_allocate);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require_relative "base"
|
|
2
|
-
require_relative "../../
|
|
2
|
+
require_relative "../../test_impact_analysis/skippable_percentage/calculator"
|
|
3
3
|
|
|
4
4
|
module Datadog
|
|
5
5
|
module CI
|
|
@@ -9,7 +9,7 @@ module Datadog
|
|
|
9
9
|
private
|
|
10
10
|
|
|
11
11
|
def build_action
|
|
12
|
-
::Datadog::CI::
|
|
12
|
+
::Datadog::CI::TestImpactAnalysis::SkippablePercentage::Calculator.new(
|
|
13
13
|
rspec_cli_options: (options[:"rspec-opts"] || "").split,
|
|
14
14
|
verbose: !options[:verbose].nil?,
|
|
15
15
|
spec_path: options[:"spec-path"] || "spec"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require_relative "base"
|
|
2
|
-
require_relative "../../
|
|
2
|
+
require_relative "../../test_impact_analysis/skippable_percentage/estimator"
|
|
3
3
|
|
|
4
4
|
module Datadog
|
|
5
5
|
module CI
|
|
@@ -9,7 +9,7 @@ module Datadog
|
|
|
9
9
|
private
|
|
10
10
|
|
|
11
11
|
def build_action
|
|
12
|
-
::Datadog::CI::
|
|
12
|
+
::Datadog::CI::TestImpactAnalysis::SkippablePercentage::Estimator.new(
|
|
13
13
|
verbose: !options[:verbose].nil?,
|
|
14
14
|
spec_path: options[:"spec-path"] || "spec"
|
|
15
15
|
)
|
|
@@ -17,21 +17,21 @@ require_relative "../remote/library_settings_client"
|
|
|
17
17
|
require_relative "../test_management/component"
|
|
18
18
|
require_relative "../test_management/null_component"
|
|
19
19
|
require_relative "../test_management/tests_properties"
|
|
20
|
-
require_relative "../
|
|
21
|
-
require_relative "../
|
|
22
|
-
require_relative "../
|
|
20
|
+
require_relative "../test_impact_analysis/null_component"
|
|
21
|
+
require_relative "../test_impact_analysis/component"
|
|
22
|
+
require_relative "../test_impact_analysis/coverage/transport"
|
|
23
23
|
require_relative "../test_retries/component"
|
|
24
24
|
require_relative "../test_retries/null_component"
|
|
25
25
|
require_relative "../test_discovery/component"
|
|
26
26
|
require_relative "../test_discovery/null_component"
|
|
27
|
-
require_relative "../
|
|
28
|
-
require_relative "../
|
|
29
|
-
require_relative "../
|
|
30
|
-
require_relative "../
|
|
31
|
-
require_relative "../
|
|
32
|
-
require_relative "../
|
|
33
|
-
require_relative "../
|
|
34
|
-
require_relative "../
|
|
27
|
+
require_relative "../test_tracing/component"
|
|
28
|
+
require_relative "../test_tracing/flush"
|
|
29
|
+
require_relative "../test_tracing/known_tests"
|
|
30
|
+
require_relative "../test_tracing/null_component"
|
|
31
|
+
require_relative "../test_tracing/serializers/factories/test_level"
|
|
32
|
+
require_relative "../test_tracing/serializers/factories/test_suite_level"
|
|
33
|
+
require_relative "../test_tracing/null_transport"
|
|
34
|
+
require_relative "../test_tracing/transport"
|
|
35
35
|
require_relative "../transport/adapters/telemetry_webmock_safe_adapter"
|
|
36
36
|
require_relative "../transport/api/builder"
|
|
37
37
|
require_relative "../utils/parsing"
|
|
@@ -44,12 +44,12 @@ module Datadog
|
|
|
44
44
|
module Configuration
|
|
45
45
|
# Adds CI behavior to Datadog trace components
|
|
46
46
|
module Components
|
|
47
|
-
attr_reader :
|
|
47
|
+
attr_reader :test_tracing, :test_impact_analysis, :git_tree_upload_worker, :ci_remote, :test_retries,
|
|
48
48
|
:test_management, :agentless_logs_submission, :impacted_tests_detection, :test_discovery, :code_coverage
|
|
49
49
|
|
|
50
50
|
def initialize(settings)
|
|
51
|
-
@
|
|
52
|
-
@
|
|
51
|
+
@test_impact_analysis = TestImpactAnalysis::NullComponent.new
|
|
52
|
+
@test_tracing = TestTracing::NullComponent.new
|
|
53
53
|
@git_tree_upload_worker = DummyWorker.new
|
|
54
54
|
@ci_remote = Remote::NullComponent.new
|
|
55
55
|
@test_retries = TestRetries::NullComponent.new
|
|
@@ -69,8 +69,8 @@ module Datadog
|
|
|
69
69
|
def shutdown!(replacement = nil)
|
|
70
70
|
super
|
|
71
71
|
|
|
72
|
-
@
|
|
73
|
-
@
|
|
72
|
+
@test_tracing&.shutdown!
|
|
73
|
+
@test_impact_analysis&.shutdown!
|
|
74
74
|
@agentless_logs_submission&.shutdown!
|
|
75
75
|
@test_discovery&.shutdown!
|
|
76
76
|
@code_coverage&.shutdown!
|
|
@@ -122,7 +122,7 @@ module Datadog
|
|
|
122
122
|
# Activate underlying tracing test mode with async worker
|
|
123
123
|
settings.tracing.test_mode.enabled = true
|
|
124
124
|
settings.tracing.test_mode.async = true
|
|
125
|
-
settings.tracing.test_mode.trace_flush = settings.ci.trace_flush || CI::
|
|
125
|
+
settings.tracing.test_mode.trace_flush = settings.ci.trace_flush || CI::TestTracing::Flush::Partial.new
|
|
126
126
|
|
|
127
127
|
trace_writer_options = settings.ci.writer_options
|
|
128
128
|
trace_writer_options[:shutdown_timeout] = 60
|
|
@@ -151,9 +151,9 @@ module Datadog
|
|
|
151
151
|
tests_properties_client: TestManagement::TestsProperties.new(api: test_visibility_api)
|
|
152
152
|
)
|
|
153
153
|
|
|
154
|
-
# @type ivar @
|
|
155
|
-
@
|
|
156
|
-
@
|
|
154
|
+
# @type ivar @test_impact_analysis: Datadog::CI::TestImpactAnalysis::Component
|
|
155
|
+
@test_impact_analysis = build_test_impact_analysis(settings, test_visibility_api)
|
|
156
|
+
@test_tracing = TestTracing::Component.new(
|
|
157
157
|
test_suite_level_visibility_enabled: !settings.ci.force_test_level_visibility,
|
|
158
158
|
logical_test_session_name: settings.ci.test_session_name,
|
|
159
159
|
known_tests_client: build_known_tests_client(settings, test_visibility_api),
|
|
@@ -167,7 +167,7 @@ module Datadog
|
|
|
167
167
|
@code_coverage = build_code_coverage(settings, test_visibility_api)
|
|
168
168
|
end
|
|
169
169
|
|
|
170
|
-
def
|
|
170
|
+
def build_test_impact_analysis(settings, test_visibility_api)
|
|
171
171
|
if settings.ci.itr_code_coverage_use_single_threaded_mode &&
|
|
172
172
|
settings.ci.itr_test_impact_analysis_use_allocation_tracing
|
|
173
173
|
Datadog.logger.warn(
|
|
@@ -191,7 +191,7 @@ module Datadog
|
|
|
191
191
|
settings.ci.itr_test_impact_analysis_use_allocation_tracing = false
|
|
192
192
|
end
|
|
193
193
|
|
|
194
|
-
|
|
194
|
+
TestImpactAnalysis::Component.new(
|
|
195
195
|
api: test_visibility_api,
|
|
196
196
|
dd_env: settings.env,
|
|
197
197
|
config_tags: custom_configuration(settings),
|
|
@@ -243,11 +243,11 @@ module Datadog
|
|
|
243
243
|
|
|
244
244
|
def build_tracing_transport(settings, api)
|
|
245
245
|
# NullTransport ignores traces
|
|
246
|
-
return
|
|
246
|
+
return TestTracing::NullTransport.new if settings.ci.discard_traces
|
|
247
247
|
# nil means that default legacy APM transport will be used (only for very old Datadog Agent versions)
|
|
248
248
|
return nil if api.nil?
|
|
249
249
|
|
|
250
|
-
|
|
250
|
+
TestTracing::Transport.new(
|
|
251
251
|
api: api,
|
|
252
252
|
serializers_factory: serializers_factory(settings),
|
|
253
253
|
dd_env: settings.env
|
|
@@ -259,7 +259,7 @@ module Datadog
|
|
|
259
259
|
return nil if api.nil? || settings.ci.discard_traces
|
|
260
260
|
|
|
261
261
|
AsyncWriter.new(
|
|
262
|
-
transport:
|
|
262
|
+
transport: TestImpactAnalysis::Coverage::Transport.new(api: api)
|
|
263
263
|
)
|
|
264
264
|
end
|
|
265
265
|
|
|
@@ -283,7 +283,7 @@ module Datadog
|
|
|
283
283
|
end
|
|
284
284
|
|
|
285
285
|
def build_known_tests_client(settings, api)
|
|
286
|
-
|
|
286
|
+
TestTracing::KnownTests.new(
|
|
287
287
|
api: api,
|
|
288
288
|
dd_env: settings.env,
|
|
289
289
|
config_tags: custom_configuration(settings)
|
|
@@ -330,9 +330,9 @@ module Datadog
|
|
|
330
330
|
|
|
331
331
|
def serializers_factory(settings)
|
|
332
332
|
if settings.ci.force_test_level_visibility
|
|
333
|
-
|
|
333
|
+
TestTracing::Serializers::Factories::TestLevel
|
|
334
334
|
else
|
|
335
|
-
|
|
335
|
+
TestTracing::Serializers::Factories::TestSuiteLevel
|
|
336
336
|
end
|
|
337
337
|
end
|
|
338
338
|
|
|
@@ -36,14 +36,14 @@ module Datadog
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
def on_test_run_started(event)
|
|
39
|
-
|
|
39
|
+
test_tracing_component.start_test_session(
|
|
40
40
|
tags: {
|
|
41
41
|
CI::Ext::Test::TAG_FRAMEWORK => Ext::FRAMEWORK,
|
|
42
42
|
CI::Ext::Test::TAG_FRAMEWORK_VERSION => datadog_integration.version.to_s
|
|
43
43
|
},
|
|
44
44
|
service: datadog_configuration[:service_name]
|
|
45
45
|
)
|
|
46
|
-
|
|
46
|
+
test_tracing_component.start_test_module(Ext::FRAMEWORK)
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
def on_test_run_finished(event)
|
|
@@ -78,7 +78,7 @@ module Datadog
|
|
|
78
78
|
)
|
|
79
79
|
end
|
|
80
80
|
|
|
81
|
-
test_span =
|
|
81
|
+
test_span = test_tracing_component.trace_test(
|
|
82
82
|
event.test_case.name,
|
|
83
83
|
test_suite_name,
|
|
84
84
|
tags: tags,
|
|
@@ -90,18 +90,18 @@ module Datadog
|
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
def on_test_case_finished(event)
|
|
93
|
-
test_span =
|
|
93
|
+
test_span = test_tracing_component.active_test
|
|
94
94
|
return if test_span.nil?
|
|
95
95
|
|
|
96
96
|
finish_span(test_span, event.result)
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
def on_test_step_started(event)
|
|
100
|
-
|
|
100
|
+
test_tracing_component.trace(event.test_step.to_s, type: Ext::STEP_SPAN_TYPE)
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
def on_test_step_finished(event)
|
|
104
|
-
current_step_span =
|
|
104
|
+
current_step_span = test_tracing_component.active_span
|
|
105
105
|
return if current_step_span.nil?
|
|
106
106
|
|
|
107
107
|
finish_span(current_step_span, event.result)
|
|
@@ -135,8 +135,8 @@ module Datadog
|
|
|
135
135
|
end
|
|
136
136
|
|
|
137
137
|
def finish_session(result)
|
|
138
|
-
test_session =
|
|
139
|
-
test_module =
|
|
138
|
+
test_session = test_tracing_component.active_test_session
|
|
139
|
+
test_module = test_tracing_component.active_test_module
|
|
140
140
|
|
|
141
141
|
return unless test_session && test_module
|
|
142
142
|
|
|
@@ -155,7 +155,7 @@ module Datadog
|
|
|
155
155
|
def start_test_suite(test_suite_name, tags: {})
|
|
156
156
|
finish_current_test_suite
|
|
157
157
|
|
|
158
|
-
@current_test_suite =
|
|
158
|
+
@current_test_suite = test_tracing_component.start_test_suite(test_suite_name, tags: tags)
|
|
159
159
|
end
|
|
160
160
|
|
|
161
161
|
def finish_current_test_suite
|
|
@@ -208,8 +208,8 @@ module Datadog
|
|
|
208
208
|
Datadog.configuration.ci[:cucumber]
|
|
209
209
|
end
|
|
210
210
|
|
|
211
|
-
def
|
|
212
|
-
Datadog.send(:components).
|
|
211
|
+
def test_tracing_component
|
|
212
|
+
Datadog.send(:components).test_tracing
|
|
213
213
|
end
|
|
214
214
|
|
|
215
215
|
def test_suite_source_file_tags(test_case)
|
|
@@ -20,7 +20,7 @@ module Datadog
|
|
|
20
20
|
return super unless datadog_configuration[:enabled]
|
|
21
21
|
|
|
22
22
|
# @type var test_session: Datadog::CI::TestSession?
|
|
23
|
-
test_session =
|
|
23
|
+
test_session = test_tracing_component.start_test_session(
|
|
24
24
|
tags: {
|
|
25
25
|
CI::Ext::Test::TAG_FRAMEWORK => CI::Contrib::RSpec::Ext::FRAMEWORK,
|
|
26
26
|
CI::Ext::Test::TAG_FRAMEWORK_VERSION => datadog_integration.version.to_s
|
|
@@ -29,7 +29,7 @@ module Datadog
|
|
|
29
29
|
)
|
|
30
30
|
|
|
31
31
|
# @type var test_module: Datadog::CI::TestModule?
|
|
32
|
-
test_module =
|
|
32
|
+
test_module = test_tracing_component.start_test_module(CI::Contrib::RSpec::Ext::FRAMEWORK)
|
|
33
33
|
|
|
34
34
|
result = super
|
|
35
35
|
return result unless test_module && test_session
|
|
@@ -57,8 +57,8 @@ module Datadog
|
|
|
57
57
|
Datadog.configuration.ci[:rspec]
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
-
def
|
|
61
|
-
Datadog.send(:components).
|
|
60
|
+
def test_tracing_component
|
|
61
|
+
Datadog.send(:components).test_tracing
|
|
62
62
|
end
|
|
63
63
|
end
|
|
64
64
|
end
|
|
@@ -23,8 +23,8 @@ module Datadog
|
|
|
23
23
|
{}
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
test_suite =
|
|
26
|
+
test_tracing_component = Datadog.send(:components).test_tracing
|
|
27
|
+
test_suite = test_tracing_component.start_test_suite(
|
|
28
28
|
test_suite_name,
|
|
29
29
|
tags: test_suite_tags
|
|
30
30
|
)
|
|
@@ -34,8 +34,8 @@ module Datadog
|
|
|
34
34
|
Datadog.configuration.ci[:minitest]
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
def
|
|
38
|
-
Datadog.send(:components).
|
|
37
|
+
def _dd_test_tracing_component
|
|
38
|
+
Datadog.send(:components).test_tracing
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def _dd_test_retries_component
|
|
@@ -21,7 +21,7 @@ module Datadog
|
|
|
21
21
|
|
|
22
22
|
tests_count = ::Minitest::Runnable.runnables.sum { |runnable| runnable.runnable_methods.size }
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
test_tracing_component.start_test_session(
|
|
25
25
|
tags: {
|
|
26
26
|
CI::Ext::Test::TAG_FRAMEWORK => Ext::FRAMEWORK,
|
|
27
27
|
CI::Ext::Test::TAG_FRAMEWORK_VERSION => datadog_integration.version.to_s
|
|
@@ -32,7 +32,7 @@ module Datadog
|
|
|
32
32
|
# we need to always start/stop test suites in the parent process in this case
|
|
33
33
|
local_test_suites_mode: false
|
|
34
34
|
)
|
|
35
|
-
|
|
35
|
+
test_tracing_component.start_test_module(Ext::FRAMEWORK)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
def old_run_one_method(klass, method_name)
|
|
@@ -54,7 +54,7 @@ module Datadog
|
|
|
54
54
|
# get the current test suite and mark this method as done, so we can check if all tests were executed
|
|
55
55
|
# for this test suite
|
|
56
56
|
test_suite_name = Helpers.test_suite_name(klass, method_name)
|
|
57
|
-
test_suite =
|
|
57
|
+
test_suite = test_tracing_component.active_test_suite(test_suite_name)
|
|
58
58
|
test_suite&.expected_test_done!(method_name)
|
|
59
59
|
|
|
60
60
|
result
|
|
@@ -80,8 +80,8 @@ module Datadog
|
|
|
80
80
|
Datadog.configuration.ci[:minitest]
|
|
81
81
|
end
|
|
82
82
|
|
|
83
|
-
def
|
|
84
|
-
Datadog.send(:components).
|
|
83
|
+
def test_tracing_component
|
|
84
|
+
Datadog.send(:components).test_tracing
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
def test_retries_component
|
|
@@ -44,7 +44,7 @@ module Datadog
|
|
|
44
44
|
tags[CI::Ext::Test::TAG_SOURCE_START] = first_line_number.to_s if first_line_number
|
|
45
45
|
tags[CI::Ext::Test::TAG_SOURCE_END] = last_line_number.to_s if last_line_number
|
|
46
46
|
|
|
47
|
-
test_span =
|
|
47
|
+
test_span = _dd_test_tracing_component.trace_test(
|
|
48
48
|
name,
|
|
49
49
|
test_suite_name,
|
|
50
50
|
tags: tags,
|
|
@@ -59,7 +59,7 @@ module Datadog
|
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
def after_teardown
|
|
62
|
-
test_span =
|
|
62
|
+
test_span = _dd_test_tracing_component.active_test
|
|
63
63
|
return super unless test_span
|
|
64
64
|
|
|
65
65
|
finish_with_result(test_span, result_code)
|
|
@@ -95,8 +95,8 @@ module Datadog
|
|
|
95
95
|
Datadog.configuration.ci[:minitest]
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
-
def
|
|
99
|
-
Datadog.send(:components).
|
|
98
|
+
def _dd_test_tracing_component
|
|
99
|
+
Datadog.send(:components).test_tracing
|
|
100
100
|
end
|
|
101
101
|
end
|
|
102
102
|
|
|
@@ -18,7 +18,7 @@ module Datadog
|
|
|
18
18
|
return super if @runner != ::ParallelTests::RSpec::Runner
|
|
19
19
|
|
|
20
20
|
begin
|
|
21
|
-
test_session =
|
|
21
|
+
test_session = test_tracing_component.start_test_session(
|
|
22
22
|
tags: {
|
|
23
23
|
CI::Ext::Test::TAG_FRAMEWORK => CI::Contrib::RSpec::Ext::FRAMEWORK,
|
|
24
24
|
CI::Ext::Test::TAG_FRAMEWORK_VERSION => datadog_extract_rspec_version
|
|
@@ -27,10 +27,10 @@ module Datadog
|
|
|
27
27
|
estimated_total_tests_count: 10_000, # temporary value, updated by child processes
|
|
28
28
|
distributed: true
|
|
29
29
|
)
|
|
30
|
-
test_module =
|
|
30
|
+
test_module = test_tracing_component.start_test_module("rspec")
|
|
31
31
|
|
|
32
32
|
options[:env] ||= {}
|
|
33
|
-
options[:env][CI::Ext::Settings::ENV_TEST_VISIBILITY_DRB_SERVER_URI] =
|
|
33
|
+
options[:env][CI::Ext::Settings::ENV_TEST_VISIBILITY_DRB_SERVER_URI] = test_tracing_component.context_service_uri
|
|
34
34
|
|
|
35
35
|
super
|
|
36
36
|
ensure
|
|
@@ -42,8 +42,8 @@ module Datadog
|
|
|
42
42
|
def any_test_failed?(test_results)
|
|
43
43
|
res = super
|
|
44
44
|
|
|
45
|
-
test_session =
|
|
46
|
-
test_module =
|
|
45
|
+
test_session = test_tracing_component.active_test_session
|
|
46
|
+
test_module = test_tracing_component.active_test_module
|
|
47
47
|
if res
|
|
48
48
|
test_module&.failed!
|
|
49
49
|
test_session&.failed!
|
|
@@ -73,8 +73,8 @@ module Datadog
|
|
|
73
73
|
Datadog.configuration.ci[:paralleltests]
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
-
def
|
|
77
|
-
Datadog.send(:components).
|
|
76
|
+
def test_tracing_component
|
|
77
|
+
Datadog.send(:components).test_tracing
|
|
78
78
|
end
|
|
79
79
|
end
|
|
80
80
|
end
|