Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ subprojects {
}
}

if (!this.name.contains("sample") && !this.name.contains("integration-tests") && this.name != "sentry-test-support" && this.name != "sentry-compose-helper") {
if (!this.name.contains("sample") && !this.name.contains("integration-tests") && this.name != "sentry-system-test-support" && this.name != "sentry-test-support" && this.name != "sentry-compose-helper") {
apply<DistributionPlugin>()
apply<com.vanniktech.maven.publish.MavenPublishPlugin>()

Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ object Config {
val log4j2Core = "org.apache.logging.log4j:log4j-core:$log4j2Version"

val jacksonDatabind = "com.fasterxml.jackson.core:jackson-databind"
val jacksonKotlin = "com.fasterxml.jackson.module:jackson-module-kotlin:2.18.3"

val springBootStarter = "org.springframework.boot:spring-boot-starter:$springBootVersion"
val springBootStarterGraphql = "org.springframework.boot:spring-boot-starter-graphql:$springBootVersion"
Expand Down
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ coverage:
ignore:
- "**/src/test/*"
- "sentry-android-integration-tests/*"
- "sentry-system-test-support/*"
- "sentry-test-support/*"
- "sentry-samples/*"
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plugins {
id(Config.BuildPlugins.springDependencyManagement) version Config.BuildPlugins.springDependencyManagementVersion
kotlin("jvm")
kotlin("plugin.spring") version Config.kotlinVersion
id("com.apollographql.apollo3") version "3.8.2"
}

group = "io.sentry.sample.spring-boot-jakarta"
Expand Down Expand Up @@ -57,6 +56,7 @@ dependencies {
// database query tracing
implementation(projects.sentryJdbc)
runtimeOnly(Config.TestLibs.hsqldb)
testImplementation(projects.sentrySystemTestSupport)
testImplementation(Config.Libs.springBoot3StarterTest) {
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
}
Expand Down Expand Up @@ -103,13 +103,3 @@ tasks.named("test").configure {
excludeTestsMatching("io.sentry.systemtest.*")
}
}

apollo {
service("service") {
srcDir("src/test/graphql")
packageName.set("io.sentry.samples.graphql")
outputDirConnection {
connectToKotlinSourceSet("test")
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package io.sentry.systemtest

import io.sentry.protocol.SentryId
import io.sentry.samples.spring.boot.jakarta.Person
import io.sentry.systemtest.util.TestHelper
import org.junit.Before
import org.springframework.http.HttpStatus
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotEquals
Expand All @@ -25,10 +23,12 @@ class DistributedTracingSystemTest {
val restClient = testHelper.restClient
restClient.getPersonDistributedTracing(
1L,
"$traceId-424cffc8f94feeee-1",
"sentry-public_key=502f25099c204a2fbf4cb16edc5975d1,sentry-sample_rand=0.456789,sentry-sample_rate=0.5,sentry-sampled=true,sentry-trace_id=$traceId,sentry-transaction=HTTP%20GET"
mapOf(
"sentry-trace" to "$traceId-424cffc8f94feeee-1",
"baggage" to "sentry-public_key=502f25099c204a2fbf4cb16edc5975d1,sentry-sample_rand=0.456789,sentry-sample_rate=0.5,sentry-sampled=true,sentry-trace_id=$traceId,sentry-transaction=HTTP%20GET"
)
)
assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, restClient.lastKnownStatusCode)
assertEquals(500, restClient.lastKnownStatusCode)

testHelper.ensureTransactionReceived { transaction, envelopeHeader ->
transaction.transaction == "GET /tracing/{id}" &&
Expand All @@ -47,10 +47,12 @@ class DistributedTracingSystemTest {
val restClient = testHelper.restClient
restClient.getPersonDistributedTracing(
1L,
"$traceId-424cffc8f94feeee-0",
"sentry-public_key=502f25099c204a2fbf4cb16edc5975d1,sentry-sample_rand=0.456789,sentry-sample_rate=0.5,sentry-sampled=false,sentry-trace_id=$traceId,sentry-transaction=HTTP%20GET"
mapOf(
"sentry-trace" to "$traceId-424cffc8f94feeee-0",
"baggage" to "sentry-public_key=502f25099c204a2fbf4cb16edc5975d1,sentry-sample_rand=0.456789,sentry-sample_rate=0.5,sentry-sampled=false,sentry-trace_id=$traceId,sentry-transaction=HTTP%20GET"
)
)
assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, restClient.lastKnownStatusCode)
assertEquals(500, restClient.lastKnownStatusCode)

testHelper.ensureNoTransactionReceived { transaction, envelopeHeader ->
transaction.transaction == "GET /tracing/{id}"
Expand All @@ -67,10 +69,12 @@ class DistributedTracingSystemTest {
val restClient = testHelper.restClient
restClient.getPersonDistributedTracing(
1L,
"$traceId-424cffc8f94feeee-1",
"sentry-public_key=502f25099c204a2fbf4cb16edc5975d1,sentry-sample_rate=0.5,sentry-sampled=true,sentry-trace_id=$traceId,sentry-transaction=HTTP%20GET"
mapOf(
"sentry-trace" to "$traceId-424cffc8f94feeee-1",
"baggage" to "sentry-public_key=502f25099c204a2fbf4cb16edc5975d1,sentry-sample_rate=0.5,sentry-sampled=true,sentry-trace_id=$traceId,sentry-transaction=HTTP%20GET"
)
)
assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, restClient.lastKnownStatusCode)
assertEquals(500, restClient.lastKnownStatusCode)

var sampleRand1: String? = null
var sampleRand2: String? = null
Expand Down Expand Up @@ -113,10 +117,12 @@ class DistributedTracingSystemTest {
val restClient = testHelper.restClient
restClient.getPersonDistributedTracing(
1L,
"$traceId-424cffc8f94feeee",
"sentry-public_key=502f25099c204a2fbf4cb16edc5975d1,sentry-sample_rate=0.5,sentry-trace_id=$traceId,sentry-transaction=HTTP%20GET"
mapOf(
"sentry-trace" to "$traceId-424cffc8f94feeee",
"baggage" to "sentry-public_key=502f25099c204a2fbf4cb16edc5975d1,sentry-sample_rate=0.5,sentry-trace_id=$traceId,sentry-transaction=HTTP%20GET"
)
)
assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, restClient.lastKnownStatusCode)
assertEquals(500, restClient.lastKnownStatusCode)

var sampleRate1: String? = null
var sampleRate2: String? = null
Expand Down Expand Up @@ -161,10 +167,12 @@ class DistributedTracingSystemTest {
val person = Person("firstA", "lastB")
val returnedPerson = restClient.createPersonDistributedTracing(
person,
"$traceId-424cffc8f94feeee-1",
"sentry-public_key=502f25099c204a2fbf4cb16edc5975d1,sentry-sample_rand=0.456789,sentry-sample_rate=0.5,sentry-sampled=true,sentry-trace_id=$traceId,sentry-transaction=HTTP%20GET"
mapOf(
"sentry-trace" to "$traceId-424cffc8f94feeee-1",
"baggage" to "sentry-public_key=502f25099c204a2fbf4cb16edc5975d1,sentry-sample_rand=0.456789,sentry-sample_rate=0.5,sentry-sampled=true,sentry-trace_id=$traceId,sentry-transaction=HTTP%20GET"
)
)
assertEquals(HttpStatus.OK, restClient.lastKnownStatusCode)
assertEquals(200, restClient.lastKnownStatusCode)

assertEquals(person.firstName, returnedPerson!!.firstName)
assertEquals(person.lastName, returnedPerson!!.lastName)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package io.sentry.systemtest

import io.sentry.samples.spring.boot.jakarta.Person
import io.sentry.systemtest.util.TestHelper
import org.junit.Before
import org.springframework.http.HttpStatus
import kotlin.test.Test
import kotlin.test.assertEquals

Expand All @@ -21,7 +19,7 @@ class PersonSystemTest {
fun `get person fails`() {
val restClient = testHelper.restClient
restClient.getPerson(1L)
assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, restClient.lastKnownStatusCode)
assertEquals(500, restClient.lastKnownStatusCode)

testHelper.ensureTransactionReceived { transaction, envelopeHeader ->
testHelper.doesTransactionContainSpanWithOp(transaction, "spanCreatedThroughOtelApi") &&
Expand All @@ -34,7 +32,7 @@ class PersonSystemTest {
val restClient = testHelper.restClient
val person = Person("firstA", "lastB")
val returnedPerson = restClient.createPerson(person)
assertEquals(HttpStatus.OK, restClient.lastKnownStatusCode)
assertEquals(200, restClient.lastKnownStatusCode)

assertEquals(person.firstName, returnedPerson!!.firstName)
assertEquals(person.lastName, returnedPerson!!.lastName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package io.sentry.systemtest

import io.sentry.systemtest.util.TestHelper
import org.junit.Before
import org.springframework.http.HttpStatus
import kotlin.test.Test
import kotlin.test.assertEquals

Expand All @@ -20,7 +19,7 @@ class TodoSystemTest {
fun `get todo works`() {
val restClient = testHelper.restClient
restClient.getTodo(1L)
assertEquals(HttpStatus.OK, restClient.lastKnownStatusCode)
assertEquals(200, restClient.lastKnownStatusCode)

testHelper.ensureTransactionReceived { transaction, envelopeHeader ->
testHelper.doesTransactionContainSpanWithOp(transaction, "todoSpanOtelApi") &&
Expand All @@ -33,7 +32,7 @@ class TodoSystemTest {
fun `get todo webclient works`() {
val restClient = testHelper.restClient
restClient.getTodoWebclient(1L)
assertEquals(HttpStatus.OK, restClient.lastKnownStatusCode)
assertEquals(200, restClient.lastKnownStatusCode)

testHelper.ensureTransactionReceived { transaction, envelopeHeader ->
testHelper.doesTransactionContainSpanWithOp(transaction, "http.client")
Expand All @@ -44,7 +43,7 @@ class TodoSystemTest {
fun `get todo restclient works`() {
val restClient = testHelper.restClient
restClient.getTodoRestClient(1L)
assertEquals(HttpStatus.OK, restClient.lastKnownStatusCode)
assertEquals(200, restClient.lastKnownStatusCode)

testHelper.ensureTransactionReceived { transaction, envelopeHeader ->
testHelper.doesTransactionContainSpanWithOp(transaction, "todoRestClientSpanOtelApi") &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ plugins {
id(Config.BuildPlugins.springDependencyManagement) version Config.BuildPlugins.springDependencyManagementVersion
kotlin("jvm")
kotlin("plugin.spring") version Config.kotlinVersion
id("com.apollographql.apollo3") version "3.8.2"
}

group = "io.sentry.sample.spring-boot-jakarta"
Expand Down Expand Up @@ -58,6 +57,8 @@ dependencies {
// database query tracing
implementation(projects.sentryJdbc)
runtimeOnly(Config.TestLibs.hsqldb)

testImplementation(projects.sentrySystemTestSupport)
testImplementation(Config.Libs.springBoot3StarterTest) {
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
}
Expand Down Expand Up @@ -123,13 +124,3 @@ tasks.named("test").configure {
excludeTestsMatching("io.sentry.systemtest.*")
}
}

apollo {
service("service") {
srcDir("src/test/graphql")
packageName.set("io.sentry.samples.graphql")
outputDirConnection {
connectToKotlinSourceSet("test")
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class GraphqlGreetingSystemTest {
val response = testHelper.graphqlClient.greet("world")

testHelper.ensureNoErrors(response)
testHelper.ensureTransactionReceived { transaction ->
testHelper.ensureTransactionReceived { transaction, envelopeHeader ->
testHelper.doesTransactionContainSpanWithOp(transaction, "query GreetingQuery")
}
}
Expand All @@ -32,7 +32,7 @@ class GraphqlGreetingSystemTest {
testHelper.ensureErrorReceived { error ->
error.message?.message?.startsWith("Unresolved RuntimeException for executionId ") ?: false
}
testHelper.ensureTransactionReceived { transaction ->
testHelper.ensureTransactionReceived { transaction, envelopeHeader ->
testHelper.doesTransactionContainSpanWithOp(transaction, "query GreetingQuery")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class GraphqlProjectSystemTest {

testHelper.ensureNoErrors(response)
assertEquals("proj-slug", response?.data?.project?.slug)
testHelper.ensureTransactionReceived { transaction ->
testHelper.ensureTransactionReceived { transaction, envelopeHeader ->
testHelper.doesTransactionContainSpanWithOp(transaction, "query ProjectQuery")
}
}
Expand All @@ -34,7 +34,7 @@ class GraphqlProjectSystemTest {

testHelper.ensureNoErrors(response)
assertNotNull(response?.data?.addProject)
testHelper.ensureTransactionReceived { transaction ->
testHelper.ensureTransactionReceived { transaction, envelopeHeader ->
testHelper.doesTransactionContainSpanWithOp(transaction, "mutation AddProjectMutation")
}
}
Expand All @@ -48,7 +48,7 @@ class GraphqlProjectSystemTest {
testHelper.ensureErrorReceived { error ->
error.message?.message?.startsWith("Unresolved RuntimeException for executionId ") ?: false
}
testHelper.ensureTransactionReceived { transaction ->
testHelper.ensureTransactionReceived { transaction, envelopeHeader ->
testHelper.doesTransactionContainSpanWithOp(transaction, "mutation AddProjectMutation")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class GraphqlTaskSystemTest {
assertEquals("C3", firstTask.creatorId)
assertEquals("C3", firstTask.creator?.id)

testHelper.ensureTransactionReceived { transaction ->
testHelper.ensureTransactionReceived { transaction, envelopeHeader ->
testHelper.doesTransactionContainSpanWithOp(transaction, "query TasksAndAssigneesQuery")
}
}
Expand Down
Loading
Loading