From 1ea75fb9fbb56b4f06063827046eb8e7a9629da2 Mon Sep 17 00:00:00 2001 From: Andrey Marchenko Date: Thu, 2 Nov 2023 16:47:50 +0100 Subject: [PATCH] clean up --- lib/datadog/ci.rb | 4 +- lib/datadog/ci/span.rb | 4 ++ spec/datadog/ci/recorder_spec.rb | 77 -------------------------------- spec/datadog/ci/span_spec.rb | 2 +- 4 files changed, 8 insertions(+), 79 deletions(-) diff --git a/lib/datadog/ci.rb b/lib/datadog/ci.rb index 29a4ac93..4912cda8 100644 --- a/lib/datadog/ci.rb +++ b/lib/datadog/ci.rb @@ -5,7 +5,9 @@ require "datadog/core" module Datadog - # Public API for Datadog CI visibility + # Datadog CI visibility public API. + # + # @public_api module CI class << self def trace_test(test_name, service_name: nil, operation_name: "test", tags: {}, &block) diff --git a/lib/datadog/ci/span.rb b/lib/datadog/ci/span.rb index aca57ca3..5f96f23a 100644 --- a/lib/datadog/ci/span.rb +++ b/lib/datadog/ci/span.rb @@ -5,6 +5,10 @@ module Datadog # Public API for Datadog CI visibility module CI + # Represents a single part of a test run. + # Could be a session, suite, test, or any custom span. + # + # @public_api class Span attr_reader :tracer_span diff --git a/spec/datadog/ci/recorder_spec.rb b/spec/datadog/ci/recorder_spec.rb index 1138b11d..97119b41 100644 --- a/spec/datadog/ci/recorder_spec.rb +++ b/spec/datadog/ci/recorder_spec.rb @@ -197,81 +197,4 @@ it { is_expected.to be(ci_span) } end end - - # context "with environment runtime information" do - # context "for the architecture platform" do - # subject(:tag) do - # set_tags! - # span_op.get_tag(Datadog::CI::Ext::Test::TAG_OS_ARCHITECTURE) - # end - - # it { is_expected.to eq("x86_64").or eq("i686").or eq("aarch64").or start_with("arm") } - # end - - # context "for the OS platform" do - # subject(:tag) do - # set_tags! - # span_op.get_tag(Datadog::CI::Ext::Test::TAG_OS_PLATFORM) - # end - - # context "with Linux", if: PlatformHelpers.linux? do - # it { is_expected.to start_with("linux") } - # end - - # context "with Mac OS", if: PlatformHelpers.mac? do - # it { is_expected.to start_with("darwin") } - # end - - # it "returns a valid string" do - # is_expected.to be_a(String) - # end - # end - - # context "for the runtime name" do - # subject(:tag) do - # set_tags! - # span_op.get_tag(Datadog::CI::Ext::Test::TAG_RUNTIME_NAME) - # end - - # context "with MRI", if: PlatformHelpers.mri? do - # it { is_expected.to eq("ruby") } - # end - - # context "with JRuby", if: PlatformHelpers.jruby? do - # it { is_expected.to eq("jruby") } - # end - - # context "with TruffleRuby", if: PlatformHelpers.truffleruby? do - # it { is_expected.to eq("truffleruby") } - # end - - # it "returns a valid string" do - # is_expected.to be_a(String) - # end - # end - - # context "for the runtime version" do - # subject(:tag) do - # set_tags! - # span_op.get_tag(Datadog::CI::Ext::Test::TAG_RUNTIME_VERSION) - # end - - # context "with MRI", if: PlatformHelpers.mri? do - # it { is_expected.to match(/^[23]\./) } - # end - - # context "with JRuby", if: PlatformHelpers.jruby? do - # it { is_expected.to match(/^9\./) } - # end - - # context "with TruffleRuby", if: PlatformHelpers.truffleruby? do - # it { is_expected.to match(/^2\d\./) } - # end - - # it "returns a valid string" do - # is_expected.to be_a(String) - # end - # end - # end - # end end diff --git a/spec/datadog/ci/span_spec.rb b/spec/datadog/ci/span_spec.rb index 767532d6..340a4c3b 100644 --- a/spec/datadog/ci/span_spec.rb +++ b/spec/datadog/ci/span_spec.rb @@ -15,7 +15,7 @@ context "when tags are provided" do let(:tags) { {"foo" => "bar"} } - it "sets provided tags as well as runtime tags" do + it "sets provided tags along with default tag and environment tag" do # default tags expect(tracer_span).to receive(:set_tag).with("span.kind", "test")