Skip to content

Commit

Permalink
test that CI::Recorder is created
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Nov 2, 2023
1 parent a395059 commit 8b5a530
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 0 additions & 3 deletions lib/datadog/ci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
require_relative "ci/version"

require "datadog/core"
require "datadog/tracing"

require_relative "ci/recorder"

module Datadog
# Public API for Datadog CI visibility
Expand Down
1 change: 1 addition & 0 deletions lib/datadog/ci/configuration/components.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
require_relative "../test_visibility/flush"
require_relative "../test_visibility/transport"
require_relative "../transport/api/builder"
require_relative "../recorder"

module Datadog
module CI
Expand Down
4 changes: 2 additions & 2 deletions lib/datadog/ci/recorder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
require "datadog/tracing"
require "datadog/tracing/contrib/analytics"

require "rbconfig"

require_relative "ext/app_types"
require_relative "ext/test"
require_relative "ext/environment"

require_relative "span"

require "rbconfig"

module Datadog
module CI
# Common behavior for CI tests
Expand Down
2 changes: 1 addition & 1 deletion lib/datadog/ci/span.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def failed!(exception: nil)
def skipped!(exception: nil, reason: nil)
tracer_span.set_tag(Ext::Test::TAG_STATUS, Ext::Test::Status::SKIP)
tracer_span.set_error(exception) unless exception.nil?
tracer_span.set_tag(CI::Ext::Test::TAG_SKIP_REASON, reason) unless reason.nil?
tracer_span.set_tag(Ext::Test::TAG_SKIP_REASON, reason) unless reason.nil?
end

def set_tag(key, value)
Expand Down
5 changes: 5 additions & 0 deletions spec/datadog/ci/configuration/components_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,16 @@
let(:api_key) { nil }
let(:agentless_url) { nil }
let(:dd_site) { nil }
let(:agentless_enabled) { false }
let(:evp_proxy_supported) { false }

context "is enabled" do
let(:enabled) { true }

it "creates a CI recorder" do
expect(components.ci_recorder).to be_kind_of(Datadog::CI::Recorder)
end

context "and when #agentless_mode" do
context "is disabled" do
let(:agentless_enabled) { false }
Expand Down

0 comments on commit 8b5a530

Please sign in to comment.