Skip to content

Commit

Permalink
TestVisibility::Transport: rename env parameter to dd_env
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Oct 17, 2023
1 parent a95abb7 commit 06670df
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions lib/datadog/ci/test_visibility/transport.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ class Transport
:api_key,
:max_payload_size,
:http,
:env
:dd_env

def initialize(
api_key:,
url:,
env: nil,
dd_env: nil,
serializers_factory: Datadog::CI::TestVisibility::Serializers::Factories::TestLevel,
max_payload_size: DEFAULT_MAX_PAYLOAD_SIZE
)
@serializers_factory = serializers_factory
@api_key = api_key
@max_payload_size = max_payload_size
@env = env
@dd_env = dd_env

uri = URI.parse(url)

Expand Down Expand Up @@ -141,12 +141,12 @@ def pack_events(encoded_events)
packer.write_map_header(1)

packer.write("*")
metadata_fields_count = env ? 4 : 3
metadata_fields_count = dd_env ? 4 : 3
packer.write_map_header(metadata_fields_count)

if env
if dd_env
packer.write("env")
packer.write(env)
packer.write(dd_env)
end

packer.write("runtime-id")
Expand Down
6 changes: 3 additions & 3 deletions sig/datadog/ci/test_visibility/transport.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ module Datadog

attr_reader serializers_factory: singleton(Datadog::CI::TestVisibility::Serializers::Factories::TestLevel)
attr_reader api_key: String
attr_reader env: String?
attr_reader dd_env: String?
attr_reader http: Datadog::CI::Transport::HTTP
attr_reader max_payload_size: Integer

@api_key: String
@env: String?
@dd_env: String?
@http: Datadog::CI::Transport::HTTP
@serializers_factory: singleton(Datadog::CI::TestVisibility::Serializers::Factories::TestLevel)
@max_payload_size: Integer

def initialize: (
api_key: String,
url: ::String,
?env: ::String?,
?dd_env: ::String?,
?serializers_factory: singleton(Datadog::CI::TestVisibility::Serializers::Factories::TestLevel),
?max_payload_size: Integer
) -> void
Expand Down
8 changes: 4 additions & 4 deletions spec/datadog/ci/test_visibility/transport_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
subject do
described_class.new(
api_key: api_key,
env: env,
dd_env: dd_env,
url: url,
serializers_factory: serializers_factory,
max_payload_size: max_payload_size
)
end

let(:api_key) { "api_key" }
let(:env) { nil }
let(:dd_env) { nil }
let(:url) { "https://citestcycle-intake.datad0ghq.com:443" }
let(:serializers_factory) { Datadog::CI::TestVisibility::Serializers::Factories::TestLevel }
let(:max_payload_size) { 4 * 1024 * 1024 }
Expand Down Expand Up @@ -62,8 +62,8 @@
end
end

context "with env defined" do
let(:env) { "ci" }
context "with dd_env defined" do
let(:dd_env) { "ci" }
before do
produce_test_trace
end
Expand Down

0 comments on commit 06670df

Please sign in to comment.