datadog-ci 1.39.0 → 1.40.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 +12 -2
- data/lib/datadog/ci/contrib/knapsack/runner.rb +10 -1
- data/lib/datadog/ci/contrib/rspec/runner.rb +5 -0
- data/lib/datadog/ci/ext/test.rb +1 -0
- data/lib/datadog/ci/test_tracing/component.rb +7 -0
- data/lib/datadog/ci/test_tracing/context.rb +10 -0
- data/lib/datadog/ci/test_tracing/null_component.rb +4 -0
- data/lib/datadog/ci/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a3bccf2a92e8ad98e87d072f74a4f1d47995679b712100ba431be5b1872cbcf2
|
|
4
|
+
data.tar.gz: da923b9f24339dbc4125664a134ecec1a501acde69abb7b4747f3d17fe718b15
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 07c5ca31ab33529de39bd23416800db30b05bdec4a7c5e377c54250b6784ad8ea1d4f0e8d0bf4448fc17867463e51236f9d11446bea5ea97186e1901e8f89bc6
|
|
7
|
+
data.tar.gz: 8df4164af95bdb3d72cf032fd56dafde1a212e43cdfd69e5e07cee1124acc7b509a95a5e36db6ca7939cddff16cb6eb7ac1e6045a8b78039cde4b6db1037bf5c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.40.0] - 2026-09-28
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
* Knapsack Pro: mark successful empty sessions as skipped ([#634][])
|
|
8
|
+
* RSpec: mark successful zero-example sessions as skipped ([#633][])
|
|
9
|
+
|
|
3
10
|
## [1.39.0] - 2026-09-21
|
|
4
11
|
|
|
5
12
|
### Added
|
|
@@ -723,7 +730,8 @@ Currently test suite level visibility is not used by our instrumentation: it wil
|
|
|
723
730
|
|
|
724
731
|
- Ruby versions < 2.7 no longer supported ([#8][])
|
|
725
732
|
|
|
726
|
-
[Unreleased]: https://github.com/DataDog/datadog-ci-rb/compare/v1.
|
|
733
|
+
[Unreleased]: https://github.com/DataDog/datadog-ci-rb/compare/v1.40.0...main
|
|
734
|
+
[1.40.0]: https://github.com/DataDog/datadog-ci-rb/compare/v1.39.0...v1.40.0
|
|
727
735
|
[1.39.0]: https://github.com/DataDog/datadog-ci-rb/compare/v1.38.1...v1.39.0
|
|
728
736
|
[1.38.1]: https://github.com/DataDog/datadog-ci-rb/compare/v1.38.0...v1.38.1
|
|
729
737
|
[1.38.0]: https://github.com/DataDog/datadog-ci-rb/compare/v1.37.0...v1.38.0
|
|
@@ -1022,4 +1030,6 @@ Currently test suite level visibility is not used by our instrumentation: it wil
|
|
|
1022
1030
|
[#612]: https://github.com/DataDog/datadog-ci-rb/issues/612
|
|
1023
1031
|
[#615]: https://github.com/DataDog/datadog-ci-rb/issues/615
|
|
1024
1032
|
[#617]: https://github.com/DataDog/datadog-ci-rb/issues/617
|
|
1025
|
-
[#619]: https://github.com/DataDog/datadog-ci-rb/issues/619
|
|
1033
|
+
[#619]: https://github.com/DataDog/datadog-ci-rb/issues/619
|
|
1034
|
+
[#633]: https://github.com/DataDog/datadog-ci-rb/issues/633
|
|
1035
|
+
[#634]: https://github.com/DataDog/datadog-ci-rb/issues/634
|
|
@@ -38,7 +38,16 @@ module Datadog
|
|
|
38
38
|
result = super
|
|
39
39
|
ensure
|
|
40
40
|
[test_module, test_session].each do |span|
|
|
41
|
-
_dd_cleanup
|
|
41
|
+
_dd_cleanup do
|
|
42
|
+
if result != 0
|
|
43
|
+
span.failed!
|
|
44
|
+
elsif !test_tracing_component.any_tests_started?
|
|
45
|
+
span.skipped!(reason: "No tests were executed")
|
|
46
|
+
span.set_tag(CI::Ext::Test::TAG_SESSION_EMPTY_REASON, "zero_tests")
|
|
47
|
+
else
|
|
48
|
+
span.passed!
|
|
49
|
+
end
|
|
50
|
+
end
|
|
42
51
|
end
|
|
43
52
|
_dd_cleanup { test_module.finish }
|
|
44
53
|
_dd_cleanup { test_session.finish }
|
|
@@ -48,6 +48,11 @@ module Datadog
|
|
|
48
48
|
if result != 0
|
|
49
49
|
test_module.failed!
|
|
50
50
|
test_session.failed!
|
|
51
|
+
elsif !test_tracing_component.any_tests_started?
|
|
52
|
+
test_module.skipped!(reason: "No tests were executed")
|
|
53
|
+
test_session.skipped!(reason: "No tests were executed")
|
|
54
|
+
test_module.set_tag(CI::Ext::Test::TAG_SESSION_EMPTY_REASON, "zero_tests")
|
|
55
|
+
test_session.set_tag(CI::Ext::Test::TAG_SESSION_EMPTY_REASON, "zero_tests")
|
|
51
56
|
else
|
|
52
57
|
test_module.passed!
|
|
53
58
|
test_session.passed!
|
data/lib/datadog/ci/ext/test.rb
CHANGED
|
@@ -13,6 +13,7 @@ module Datadog
|
|
|
13
13
|
TAG_FRAMEWORK_VERSION = "test.framework_version"
|
|
14
14
|
TAG_NAME = "test.name"
|
|
15
15
|
TAG_SKIP_REASON = "test.skip_reason"
|
|
16
|
+
TAG_SESSION_EMPTY_REASON = "test.session.empty_reason"
|
|
16
17
|
|
|
17
18
|
# Status is the result of a single test run
|
|
18
19
|
# See the [Datadog::CI::Ext::Test::Status] module for the list of possible values of this tag
|
|
@@ -162,6 +162,11 @@ module Datadog
|
|
|
162
162
|
@context.active_test
|
|
163
163
|
end
|
|
164
164
|
|
|
165
|
+
# Includes skipped tests: a session is empty only if no tests were observed.
|
|
166
|
+
def any_tests_started?
|
|
167
|
+
maybe_remote_context.any_tests_started?
|
|
168
|
+
end
|
|
169
|
+
|
|
165
170
|
def active_test_session
|
|
166
171
|
maybe_remote_context.active_test_session
|
|
167
172
|
end
|
|
@@ -286,6 +291,8 @@ module Datadog
|
|
|
286
291
|
end
|
|
287
292
|
|
|
288
293
|
def on_test_started(test)
|
|
294
|
+
maybe_remote_context.record_test_started
|
|
295
|
+
|
|
289
296
|
# Sometimes test suite is not being assigned correctly.
|
|
290
297
|
# Fix it by fetching the one single running test suite from the process context.
|
|
291
298
|
#
|
|
@@ -40,10 +40,12 @@ module Datadog
|
|
|
40
40
|
@mutex = Mutex.new
|
|
41
41
|
|
|
42
42
|
@tests_skipped_by_tia_count = 0
|
|
43
|
+
@any_tests_started = false
|
|
43
44
|
end
|
|
44
45
|
|
|
45
46
|
def start_test_session(service: nil, tags: {})
|
|
46
47
|
@process_context.fetch_or_activate_test_session do
|
|
48
|
+
@mutex.synchronize { @any_tests_started = false }
|
|
47
49
|
tracer_span = start_datadog_tracer_span(
|
|
48
50
|
"test.session", build_tracing_span_options(service, Ext::AppTypes::TYPE_TEST_SESSION)
|
|
49
51
|
)
|
|
@@ -191,6 +193,14 @@ module Datadog
|
|
|
191
193
|
@process_context.deactivate_test_suite!(test_suite_name)
|
|
192
194
|
end
|
|
193
195
|
|
|
196
|
+
def any_tests_started?
|
|
197
|
+
@mutex.synchronize { @any_tests_started }
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
def record_test_started
|
|
201
|
+
@mutex.synchronize { @any_tests_started = true }
|
|
202
|
+
end
|
|
203
|
+
|
|
194
204
|
def incr_tests_skipped_by_tia_count
|
|
195
205
|
@mutex.synchronize { @tests_skipped_by_tia_count += 1 }
|
|
196
206
|
end
|
data/lib/datadog/ci/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: datadog-ci
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.40.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Datadog, Inc.
|
|
@@ -327,6 +327,7 @@ files:
|
|
|
327
327
|
homepage: https://github.com/DataDog/datadog-ci-rb
|
|
328
328
|
licenses:
|
|
329
329
|
- BSD-3-Clause
|
|
330
|
+
- Apache-2.0
|
|
330
331
|
metadata:
|
|
331
332
|
allowed_push_host: https://rubygems.org
|
|
332
333
|
changelog_uri: https://github.com/DataDog/datadog-ci-rb/blob/main/CHANGELOG.md
|