From 3cb974e5dfd381b9b28ffef9977047cf35242121 Mon Sep 17 00:00:00 2001 From: Ivan Topolnjak Date: Fri, 18 Aug 2017 12:29:20 +0200 Subject: remove references to ActiveSpan --- kamon-core-tests/src/test/scala/kamon/trace/SpanMetrics.scala | 2 -- kamon-core-tests/src/test/scala/kamon/trace/TracerSpec.scala | 11 +++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'kamon-core-tests/src/test') diff --git a/kamon-core-tests/src/test/scala/kamon/trace/SpanMetrics.scala b/kamon-core-tests/src/test/scala/kamon/trace/SpanMetrics.scala index ae0c7795..3d292134 100644 --- a/kamon-core-tests/src/test/scala/kamon/trace/SpanMetrics.scala +++ b/kamon-core-tests/src/test/scala/kamon/trace/SpanMetrics.scala @@ -1,8 +1,6 @@ package kamon.trace -import kamon.Kamon import kamon.Kamon.buildSpan -import kamon.metric._ import kamon.testkit.{MetricInspection, Reconfigure} import org.scalatest.{Matchers, WordSpecLike} diff --git a/kamon-core-tests/src/test/scala/kamon/trace/TracerSpec.scala b/kamon-core-tests/src/test/scala/kamon/trace/TracerSpec.scala index fb5bb313..b398ee98 100644 --- a/kamon-core-tests/src/test/scala/kamon/trace/TracerSpec.scala +++ b/kamon-core-tests/src/test/scala/kamon/trace/TracerSpec.scala @@ -21,6 +21,7 @@ class TracerSpec extends WordSpec with Matchers with SpanBuilding with OptionVal "pass the operation name and tags to started Span" in { val span = tracer.buildSpan("myOperation") + .withTag("both", "both") .withMetricTag("metric-tag", "value") .withMetricTag("metric-tag", "value") .withSpanTag("hello", "world") @@ -32,16 +33,18 @@ class TracerSpec extends WordSpec with Matchers with SpanBuilding with OptionVal val spanData = inspect(span) spanData.operationName() shouldBe "myOperation" spanData.metricTags() should contain only ( - ("metric-tag" -> "value")) + ("metric-tag" -> "value"), + ("both" -> "both")) spanData.spanTags() should contain allOf( + ("both" -> TagValue.String("both")), ("hello" -> TagValue.String("world")), ("kamon" -> TagValue.String("rulez")), ("number" -> TagValue.Number(123)), ("boolean" -> TagValue.True)) } - "not have any parent Span if there is ActiveSpan and no parent was explicitly given" in { + "not have any parent Span if there is no Span in the current context and no parent was explicitly given" in { val span = tracer.buildSpan("myOperation").start() val spanData = inspect(span) spanData.context().parentID shouldBe IdentityProvider.NoIdentifier @@ -59,10 +62,10 @@ class TracerSpec extends WordSpec with Matchers with SpanBuilding with OptionVal parentData.context().spanID shouldBe childData.context().parentID } - "ignore the currently active span as parent if explicitly requested" in { + "ignore the span from the current context as parent if explicitly requested" in { val parent = tracer.buildSpan("myOperation").start() val child = Kamon.withContext(Context.create(Span.ContextKey, parent)) { - tracer.buildSpan("childOperation").ignoreActiveSpan().start() + tracer.buildSpan("childOperation").ignoreParentFromContext().start() } val childData = inspect(child) -- cgit v1.2.3