Skip to content

Commit

Permalink
add total_tests_count field for TestSession and set it from RSpec ins…
Browse files Browse the repository at this point in the history
…trumentation
  • Loading branch information
anmarchenko committed Sep 9, 2024
1 parent a3d14f3 commit cba919e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/datadog/ci/contrib/rspec/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def run_specs(*args)
},
service: datadog_configuration[:service_name]
)
test_session&.total_tests_count = ::RSpec.world.example_count

test_module = test_visibility_component.start_test_module(Ext::FRAMEWORK)

Expand Down
2 changes: 2 additions & 0 deletions lib/datadog/ci/test_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module CI
#
# @public_api
class TestSession < ConcurrentSpan
attr_accessor :total_tests_count

# Finishes the current test session.
# @return [void]
def finish
Expand Down
1 change: 1 addition & 0 deletions sig/datadog/ci/test_session.rbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Datadog
module CI
class TestSession < ConcurrentSpan
attr_accessor total_tests_count: Integer
@inheritable_tags: Hash[untyped, untyped]

def inheritable_tags: () -> Hash[untyped, untyped]
Expand Down
1 change: 1 addition & 0 deletions vendor/rbs/rspec/0/rspec.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ end

class RSpec::Core::World
def wants_to_quit: () -> bool
def example_count: () -> Integer
end

0 comments on commit cba919e

Please sign in to comment.