Class: Datadog::CI::Test

Inherits:
Span
  • Object
show all
Defined in:
lib/datadog/ci/test.rb

Overview

Represents a single part of a test run.

Instance Attribute Summary

Attributes inherited from Span

#tracer_span

Instance Method Summary collapse

Methods inherited from Span

#failed!, #failed?, #get_tag, #id, #initialize, #passed!, #passed?, #service, #set_default_tags, #set_environment_runtime_tags, #set_metric, #set_tag, #set_tags, #skipped!, #skipped?, #span_type, #to_s, #undefined?

Constructor Details

This class inherits a constructor from Datadog::CI::Span

Instance Method Details

#finishvoid

This method returns an undefined value.

Finishes the current test.



18
19
20
21
22
# File 'lib/datadog/ci/test.rb', line 18

def finish
  super

  CI.deactivate_test(self)
end

#nameString

Returns the name of the test.

Returns:

  • (String)

    the name of the test.



12
13
14
# File 'lib/datadog/ci/test.rb', line 12

def name
  get_tag(Ext::Test::TAG_NAME)
end

#test_module_idString

Span id of the running test module this test belongs to.

Returns:

  • (String)

    the span id of the test module.



44
45
46
# File 'lib/datadog/ci/test.rb', line 44

def test_module_id
  get_tag(Ext::Test::TAG_TEST_MODULE_ID)
end

#test_session_idString

Span id of the running test module this test belongs to.

Returns:

  • (String)

    the span id of the test session.



50
51
52
# File 'lib/datadog/ci/test.rb', line 50

def test_session_id
  get_tag(Ext::Test::TAG_TEST_SESSION_ID)
end

#test_suiteDatadog::CI::TestSuite?

Running test suite that this test is part of (if any).

Returns:



27
28
29
30
# File 'lib/datadog/ci/test.rb', line 27

def test_suite
  suite_name = test_suite_name
  CI.active_test_suite(suite_name) if suite_name
end

#test_suite_idString

Span id of the running test suite this test belongs to.

Returns:

  • (String)

    the span id of the test suite.



34
35
36
# File 'lib/datadog/ci/test.rb', line 34

def test_suite_id
  get_tag(Ext::Test::TAG_TEST_SUITE_ID)
end

#test_suite_nameObject



38
39
40
# File 'lib/datadog/ci/test.rb', line 38

def test_suite_name
  get_tag(Ext::Test::TAG_SUITE)
end