Class: Datadog::CI::TestSession
- Inherits:
-
ConcurrentSpan
- Object
- Span
- ConcurrentSpan
- Datadog::CI::TestSession
- Defined in:
- lib/datadog/ci/test_session.rb
Overview
Represents the whole test session process. Documentation on test sessions is here: https://docs.datadoghq.com/continuous_integration/explorer/?tab=testruns#sessions This object can be shared between multiple threads.
Instance Attribute Summary
Attributes inherited from Span
Instance Method Summary collapse
- #code_coverage? ⇒ Boolean
-
#finish ⇒ void
Finishes the current test session.
-
#inheritable_tags ⇒ Hash
Return the test session tags that could be inherited by sub-spans.
-
#name ⇒ String
Return the test session's name which is equal to test command used.
- #skipping_tests? ⇒ Boolean
Methods inherited from ConcurrentSpan
#get_tag, #initialize, #set_metric, #set_tag, #set_tags, #synchronize
Methods inherited from Span
#clear_tag, #failed!, #failed?, #get_tag, #git_branch, #git_commit_sha, #git_repository_url, #id, #initialize, #os_architecture, #os_platform, #os_version, #passed!, #passed?, #runtime_name, #runtime_version, #service, #set_default_tags, #set_environment_runtime_tags, #set_metric, #set_tag, #set_tags, #skipped!, #skipped?, #to_s, #trace_id, #type, #undefined?
Constructor Details
This class inherits a constructor from Datadog::CI::ConcurrentSpan
Instance Method Details
#code_coverage? ⇒ Boolean
33 34 35 |
# File 'lib/datadog/ci/test_session.rb', line 33 def code_coverage? get_tag(Ext::Test::TAG_CODE_COVERAGE_ENABLED) == "true" end |
#finish ⇒ void
This method returns an undefined value.
Finishes the current test session.
17 18 19 20 21 |
# File 'lib/datadog/ci/test_session.rb', line 17 def finish test_visibility.deactivate_test_session super end |
#inheritable_tags ⇒ Hash
Return the test session tags that could be inherited by sub-spans
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/datadog/ci/test_session.rb', line 39 def return @inheritable_tags if defined?(@inheritable_tags) # this method is not synchronized because it does not iterate over the tags collection, but rather # uses synchronized method #get_tag to get each tag value res = {} Ext::Test::INHERITABLE_TAGS.each do |tag| res[tag] = get_tag(tag) end @inheritable_tags = res.freeze end |
#name ⇒ String
Return the test session's name which is equal to test command used
25 26 27 |
# File 'lib/datadog/ci/test_session.rb', line 25 def name get_tag(Ext::Test::TAG_COMMAND) end |
#skipping_tests? ⇒ Boolean
29 30 31 |
# File 'lib/datadog/ci/test_session.rb', line 29 def skipping_tests? get_tag(Ext::Test::TAG_ITR_TEST_SKIPPING_ENABLED) == "true" end |