-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleaning up tests, test serialization of failed test event
- Loading branch information
1 parent
622305a
commit 777899f
Showing
10 changed files
with
118 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,56 @@ | ||
# # frozen_string_literal: true | ||
|
||
# require_relative "something_that_converts_traces" | ||
# require "datadog/core/encoding" | ||
# # use it to chunk payloads by size | ||
# # require "datadog/core/chunker" | ||
|
||
# module Datadog | ||
# module CI | ||
# module TestVisibility | ||
# class Transport | ||
# def initialize | ||
# @encoder = Datadog::Core::Encoding::MsgpackEncoder | ||
# end | ||
|
||
# def send_traces(traces) | ||
# # convert traces to events and construct payload | ||
# events = traces.flat_map { |trace| SomethingThatConvertsTraces.convert(trace) } | ||
# payload = Payload.new(events) | ||
# # @encoder.encode(payload) | ||
# end | ||
|
||
# private | ||
|
||
# # represents payload with some subset of serializable events to be sent to CI-APP intake | ||
# class Payload | ||
# def initialize(events) | ||
# @events = events | ||
# end | ||
|
||
# def to_msgpack(packer) | ||
# packer ||= MessagePack::Packer.new | ||
|
||
# packer.write_map_header(3) # Set header with how many elements in the map | ||
# packer.write("version") | ||
# packer.write(1) | ||
|
||
# packer.write("metadata") | ||
# packer.write_map_header(3) | ||
|
||
# packer.write("runtime-id") | ||
# packer.write(@events.first.runtime_id) | ||
|
||
# packer.write("language") | ||
# packer.write("ruby") | ||
|
||
# packer.write("library_version") | ||
# packer.write(Datadog::CI::VERSION::STRING) | ||
|
||
# packer.write_array_header(@events.size) | ||
# packer.write(@events) | ||
# end | ||
# end | ||
# end | ||
# end | ||
# end | ||
# end | ||
# frozen_string_literal: true | ||
|
||
require "datadog/core/encoding" | ||
# use it to chunk payloads by size | ||
# require "datadog/core/chunker" | ||
|
||
module Datadog | ||
module CI | ||
module TestVisibility | ||
class Transport | ||
# def initialize | ||
# @encoder = Datadog::Core::Encoding::MsgpackEncoder | ||
# end | ||
|
||
# def send_traces(traces) | ||
# # convert traces to events and construct payload | ||
# events = traces.flat_map { |trace| SomethingThatConvertsTraces.convert(trace) } | ||
# payload = Payload.new(events) | ||
# # @encoder.encode(payload) | ||
# end | ||
|
||
# private | ||
|
||
# # represents payload with some subset of serializable events to be sent to CI-APP intake | ||
# class Payload | ||
# def initialize(events) | ||
# @events = events | ||
# end | ||
|
||
# def to_msgpack(packer) | ||
# packer ||= MessagePack::Packer.new | ||
|
||
# packer.write_map_header(3) # Set header with how many elements in the map | ||
# packer.write("version") | ||
# packer.write(1) | ||
|
||
# packer.write("metadata") | ||
# packer.write_map_header(3) | ||
|
||
# packer.write("runtime-id") | ||
# packer.write(@events.first.runtime_id) | ||
|
||
# packer.write("language") | ||
# packer.write("ruby") | ||
|
||
# packer.write("library_version") | ||
# packer.write(Datadog::CI::VERSION::STRING) | ||
|
||
# packer.write_array_header(@events.size) | ||
# packer.write(@events) | ||
# end | ||
# end | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module Datadog | ||
module CI | ||
module TestVisibility | ||
class Transport | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
RSpec.shared_context "Test visibility event serialized" do | ||
subject {} | ||
|
||
let(:msgpack_json) { MessagePack.unpack(MessagePack.pack(subject)) } | ||
let(:content) { msgpack_json["content"] } | ||
let(:meta) { content["meta"] } | ||
let(:metrics) { content["metrics"] } | ||
|
||
def expect_event_header(version: 1, type: "test") | ||
expect(msgpack_json).to include( | ||
{ | ||
"version" => version, | ||
"type" => type | ||
} | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters