datadog-ci 1.24.0 → 1.25.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30bc86afa5d05d656f9abfa7ffb5ff21d6f9a8fc5edeb5924651de4cdc6df10d
4
- data.tar.gz: c846a97a47a74120d9926350360cefa4ca3fcdadea6819337ad2990f7856e267
3
+ metadata.gz: e68ff85fe19330eb395ad72da915dbad1bf98c02f5c917402da73b4f5ebab745
4
+ data.tar.gz: aa30fff0bb9f8349e3c9caa5d9ff77cbdd57b7c1cf8e61fdd19d98ebcb271711
5
5
  SHA512:
6
- metadata.gz: 2e2a5b3efa12f1c64176e1751e86ebf803f8c894aba7c53453abb22732e0ed16a6087292538b2e03f0657dc9433ceba9e452f5899a95ace325a004ee12c37fbc
7
- data.tar.gz: 461912b9cb9f406c4fd1cb9975ece506df7e979ed7b373b46c9e0060977f397b2da63095be353351d74b4273ea3cc1a354c12a4ef9dc7bf75a0a5ed065a16fa3
6
+ metadata.gz: '0668a4e35ef63218065e169ab00dfe7e7bfc4439c35f6020611d35a2a625dbdb20d38aa3e7edd3a5cf3769e15bd31077717141029223637cabeb34b172069aa8'
7
+ data.tar.gz: 119fef9be7bd8ab89c013fa545dd3d09b8013fa6ef79db438e59c12b8fd1acc42734bc9faa8f0f3ff63d28fec0b3480c7f43e89ca10a5ce83ee7b6e7a26b1422
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.25.0] - 2025-12-19
4
+
5
+ ### Added
6
+ * Minitest 6.0 support ([#446][])
7
+ * Support Ruby 4.0 ([#444][])
8
+
3
9
  ## [1.24.0] - 2025-12-15
4
10
 
5
11
  ### Added
@@ -565,7 +571,8 @@ Currently test suite level visibility is not used by our instrumentation: it wil
565
571
 
566
572
  - Ruby versions < 2.7 no longer supported ([#8][])
567
573
 
568
- [Unreleased]: https://github.com/DataDog/datadog-ci-rb/compare/v1.24.0...main
574
+ [Unreleased]: https://github.com/DataDog/datadog-ci-rb/compare/v1.25.0...main
575
+ [1.25.0]: https://github.com/DataDog/datadog-ci-rb/compare/v1.24.0...v1.25.0
569
576
  [1.24.0]: https://github.com/DataDog/datadog-ci-rb/compare/v1.23.3...v1.24.0
570
577
  [1.23.3]: https://github.com/DataDog/datadog-ci-rb/compare/v1.23.2...v1.23.3
571
578
  [1.23.2]: https://github.com/DataDog/datadog-ci-rb/compare/v1.23.1...v1.23.2
@@ -801,4 +808,6 @@ Currently test suite level visibility is not used by our instrumentation: it wil
801
808
  [#430]: https://github.com/DataDog/datadog-ci-rb/issues/430
802
809
  [#433]: https://github.com/DataDog/datadog-ci-rb/issues/433
803
810
  [#436]: https://github.com/DataDog/datadog-ci-rb/issues/436
804
- [#440]: https://github.com/DataDog/datadog-ci-rb/issues/440
811
+ [#440]: https://github.com/DataDog/datadog-ci-rb/issues/440
812
+ [#444]: https://github.com/DataDog/datadog-ci-rb/issues/444
813
+ [#446]: https://github.com/DataDog/datadog-ci-rb/issues/446
@@ -18,7 +18,7 @@ module Datadog
18
18
 
19
19
  def loaded?
20
20
  !defined?(::Minitest).nil? && !defined?(::Minitest::Runnable).nil? && !defined?(::Minitest::Test).nil? &&
21
- !defined?(::Minitest::CompositeReporter).nil?
21
+ !defined?(::Minitest::CompositeReporter).nil? && !defined?(::Minitest::Parallel::Executor).nil?
22
22
  end
23
23
 
24
24
  def compatible?
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../ext/test"
4
+ require_relative "../../git/local_repository"
5
+ require_relative "../../utils/source_code"
6
+ require_relative "../instrumentation"
7
+ require_relative "ext"
8
+ require_relative "helpers"
9
+
10
+ module Datadog
11
+ module CI
12
+ module Contrib
13
+ module Minitest
14
+ # Lifecycle hooks to instrument Minitest::Test
15
+ module ParallelExecutorMinitest6
16
+ def self.included(base)
17
+ base.prepend(InstanceMethods)
18
+ end
19
+
20
+ module InstanceMethods
21
+ def start
22
+ return super unless datadog_configuration[:enabled]
23
+
24
+ @pool = Array.new(size) {
25
+ Thread.new @queue do |queue|
26
+ Thread.current.abort_on_exception = true
27
+ while (job = queue.pop)
28
+ klass, method, reporter = job
29
+ reporter.synchronize { reporter.prerecord klass, method }
30
+ result = ::Minitest.run_one_method(klass, method)
31
+ reporter.synchronize { reporter.record result }
32
+ end
33
+ end
34
+ }
35
+ end
36
+
37
+ private
38
+
39
+ def datadog_configuration
40
+ Datadog.configuration.ci[:minitest]
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -5,6 +5,9 @@ require_relative "reporter"
5
5
  require_relative "test"
6
6
  require_relative "runnable"
7
7
 
8
+ require_relative "runnable_minitest_6"
9
+ require_relative "parallel_executor_minitest_6"
10
+
8
11
  module Datadog
9
12
  module CI
10
13
  module Contrib
@@ -18,8 +21,15 @@ module Datadog
18
21
  def patch
19
22
  # test session start
20
23
  ::Minitest.include(Runner)
24
+
21
25
  # test suites (when not executed concurrently)
22
- ::Minitest::Runnable.include(Runnable)
26
+ if ::Minitest::Runnable.respond_to?(:run_suite)
27
+ ::Minitest::Runnable.include(RunnableMinitest6)
28
+ ::Minitest::Parallel::Executor.include(ParallelExecutorMinitest6)
29
+ else
30
+ ::Minitest::Runnable.include(Runnable)
31
+ end
32
+
23
33
  # tests; test suites (when executed concurrently)
24
34
  ::Minitest::Test.include(Test)
25
35
  # test session finish
@@ -20,7 +20,6 @@ module Datadog
20
20
  return results unless test_suite
21
21
 
22
22
  test_suite.finish
23
-
24
23
  results
25
24
  end
26
25
 
@@ -29,10 +28,6 @@ module Datadog
29
28
  def datadog_configuration
30
29
  Datadog.configuration.ci[:minitest]
31
30
  end
32
-
33
- def test_visibility_component
34
- Datadog.send(:components).test_visibility
35
- end
36
31
  end
37
32
  end
38
33
  end
@@ -0,0 +1,49 @@
1
+ require_relative "helpers"
2
+
3
+ module Datadog
4
+ module CI
5
+ module Contrib
6
+ module Minitest
7
+ module RunnableMinitest6
8
+ def self.included(base)
9
+ base.singleton_class.prepend(ClassMethods)
10
+ end
11
+
12
+ module ClassMethods
13
+ def run_suite(*args)
14
+ return super unless datadog_configuration[:enabled]
15
+ return super if Helpers.parallel?(self)
16
+
17
+ test_suite = Helpers.start_test_suite(self)
18
+
19
+ results = super
20
+ return results unless test_suite
21
+
22
+ test_suite.finish
23
+ results
24
+ end
25
+
26
+ def run(klass, method_name, reporter)
27
+ reporter.prerecord klass, method_name
28
+ reporter.record ::Minitest.run_one_method(klass, method_name)
29
+ end
30
+
31
+ private
32
+
33
+ def datadog_configuration
34
+ Datadog.configuration.ci[:minitest]
35
+ end
36
+
37
+ def _dd_test_visibility_component
38
+ Datadog.send(:components).test_visibility
39
+ end
40
+
41
+ def _dd_test_retries_component
42
+ Datadog.send(:components).test_retries
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -35,14 +35,20 @@ module Datadog
35
35
  test_visibility_component.start_test_module(Ext::FRAMEWORK)
36
36
  end
37
37
 
38
+ def old_run_one_method(klass, method_name)
39
+ result = klass.new(method_name).run
40
+ raise "#{klass}#run _must_ return a Result" unless ::Minitest::Result === result
41
+ result
42
+ end
43
+
38
44
  def run_one_method(klass, method_name)
39
- return super unless datadog_configuration[:enabled]
45
+ return old_run_one_method(klass, method_name) unless datadog_configuration[:enabled]
40
46
 
41
47
  # @type var result: untyped
42
48
  result = nil
43
49
 
44
50
  test_retries_component.with_retries do
45
- result = super
51
+ result = old_run_one_method(klass, method_name)
46
52
  end
47
53
 
48
54
  # get the current test suite and mark this method as done, so we can check if all tests were executed
@@ -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 = test_visibility_component.trace_test(
47
+ test_span = _dd_test_visibility_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 = test_visibility_component.active_test
62
+ test_span = _dd_test_visibility_component.active_test
63
63
  return super unless test_span
64
64
 
65
65
  finish_with_result(test_span, result_code)
@@ -95,7 +95,7 @@ module Datadog
95
95
  Datadog.configuration.ci[:minitest]
96
96
  end
97
97
 
98
- def test_visibility_component
98
+ def _dd_test_visibility_component
99
99
  Datadog.send(:components).test_visibility
100
100
  end
101
101
  end
@@ -13,8 +13,7 @@ module Datadog
13
13
  end
14
14
 
15
15
  def with_retries(&block)
16
- no_action = proc {}
17
- yield no_action
16
+ yield
18
17
  end
19
18
 
20
19
  def reset_retries!
@@ -4,7 +4,7 @@ module Datadog
4
4
  module CI
5
5
  module VERSION
6
6
  MAJOR = 1
7
- MINOR = 24
7
+ MINOR = 25
8
8
  PATCH = 0
9
9
  PRE = nil
10
10
  BUILD = nil
@@ -22,7 +22,7 @@ module Datadog
22
22
  # To allow testing with the next unreleased version of Ruby, the version check is performed
23
23
  # as `< #{MAXIMUM_RUBY_VERSION}`, meaning prereleases of MAXIMUM_RUBY_VERSION are allowed
24
24
  # but not stable MAXIMUM_RUBY_VERSION releases.
25
- MAXIMUM_RUBY_VERSION = "4.0"
25
+ MAXIMUM_RUBY_VERSION = "4.1"
26
26
  end
27
27
  end
28
28
  end
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.24.0
4
+ version: 1.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datadog, Inc.
@@ -127,9 +127,11 @@ files:
127
127
  - lib/datadog/ci/contrib/minitest/ext.rb
128
128
  - lib/datadog/ci/contrib/minitest/helpers.rb
129
129
  - lib/datadog/ci/contrib/minitest/integration.rb
130
+ - lib/datadog/ci/contrib/minitest/parallel_executor_minitest_6.rb
130
131
  - lib/datadog/ci/contrib/minitest/patcher.rb
131
132
  - lib/datadog/ci/contrib/minitest/reporter.rb
132
133
  - lib/datadog/ci/contrib/minitest/runnable.rb
134
+ - lib/datadog/ci/contrib/minitest/runnable_minitest_6.rb
133
135
  - lib/datadog/ci/contrib/minitest/runner.rb
134
136
  - lib/datadog/ci/contrib/minitest/test.rb
135
137
  - lib/datadog/ci/contrib/parallel_tests/cli.rb
@@ -315,7 +317,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
315
317
  version: 2.7.0
316
318
  - - "<"
317
319
  - !ruby/object:Gem::Version
318
- version: '4.0'
320
+ version: '4.1'
319
321
  required_rubygems_version: !ruby/object:Gem::Requirement
320
322
  requirements:
321
323
  - - ">="