Clean up akkahttp-server/lagom tests

This commit is contained in:
Andrew Kent 2018-06-15 13:42:29 -07:00
parent 2cfd7bf911
commit 93281f775a
4 changed files with 4 additions and 9 deletions

View File

@ -2,7 +2,6 @@ import akka.NotUsed
import akka.stream.javadsl.Source import akka.stream.javadsl.Source
import akka.stream.testkit.javadsl.TestSink import akka.stream.testkit.javadsl.TestSink
import net.bytebuddy.utility.JavaModule import net.bytebuddy.utility.JavaModule
import org.junit.After
import static java.util.concurrent.TimeUnit.SECONDS import static java.util.concurrent.TimeUnit.SECONDS
import datadog.trace.agent.test.AgentTestRunner import datadog.trace.agent.test.AgentTestRunner
@ -34,9 +33,8 @@ class LagomTest extends AgentTestRunner {
// Looks like a compiler/packaging issue on akka's end. Or maybe this interface is dynamically generated. // Looks like a compiler/packaging issue on akka's end. Or maybe this interface is dynamically generated.
return false return false
} else {
return super.onInstrumentationError(typeName, classLoader, module, loaded, throwable)
} }
return super.onInstrumentationError(typeName, classLoader, module, loaded, throwable)
} }
def setupSpec() { def setupSpec() {
@ -94,6 +92,7 @@ class LagomTest extends AgentTestRunner {
} }
span(1) { span(1) {
childOf span(0) childOf span(0)
operationName 'EchoServiceImpl.tracedMethod'
} }
} }
} }

View File

@ -103,7 +103,7 @@ class AkkaHttpInstrumentationTest extends AgentTestRunner {
"error" true "error" true
"error.type" RuntimeException.name "error.type" RuntimeException.name
"error.msg" errorMessage "error.msg" errorMessage
"error.stack" tag("error.stack") "error.stack" String
} }
} }
} }

View File

@ -177,7 +177,7 @@ class Play26Test extends AgentTestRunner {
"error" true "error" true
"error.msg" "oh no" "error.msg" "oh no"
"error.type" RuntimeException.getName() "error.type" RuntimeException.getName()
"error.stack" tag("error.stack") "error.stack" String
} }
} }
} }

View File

@ -61,8 +61,4 @@ class TagsAssert {
void assertTagsAllVerified() { void assertTagsAllVerified() {
assert tags.keySet() == assertedTags assert tags.keySet() == assertedTags
} }
Object tag(String tagName) {
return tags[tagName]
}
} }