-
Notifications
You must be signed in to change notification settings - Fork 4
/
test_v1.rb
60 lines (49 loc) · 1.23 KB
/
test_v1.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# frozen_string_literal: true
require_relative "base"
require_relative "../../ext/test"
module Datadog
module CI
module TestVisibility
module Serializers
class TestV1 < Base
CONTENT_FIELDS = [
"trace_id", "span_id",
"name", "resource", "service",
"error", "start", "duration",
"meta", "metrics",
"type" => "span_type"
].freeze
CONTENT_MAP_SIZE = calculate_content_map_size(CONTENT_FIELDS)
REQUIRED_FIELDS = [
"trace_id",
"span_id",
"error",
"name",
"resource",
"start",
"duration"
].freeze
def content_fields
CONTENT_FIELDS
end
def content_map_size
CONTENT_MAP_SIZE
end
def type
"test"
end
def name
"#{@span.get_tag(Ext::Test::TAG_FRAMEWORK)}.test"
end
def resource
"#{@span.get_tag(Ext::Test::TAG_SUITE)}.#{@span.get_tag(Ext::Test::TAG_NAME)}"
end
private
def required_fields
REQUIRED_FIELDS
end
end
end
end
end
end