You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Run tests for a specific SDK module. Use when asked to "run tests", "test module", "run unit tests", "run system tests", "run e2e tests", or test a specific class. Auto-detects unit vs system tests. Supports interactive mode.
Run tests for a specific module. Auto-detects whether to run unit tests or system tests.
11
+
12
+
## Step 0: Check for Interactive Mode
13
+
14
+
If `$ARGUMENTS` starts with `interactive` (e.g., `/test interactive sentry ScopesTest`), enable interactive mode. Strip the `interactive` keyword from the arguments before proceeding.
15
+
16
+
In interactive mode, use AskUserQuestion at decision points as described in the steps below.
17
+
18
+
## Step 1: Parse the Argument
19
+
20
+
The argument can be either:
21
+
- A **file path** (e.g., `@sentry/src/test/java/io/sentry/ScopesTest.kt`)
22
+
- A **module name** (e.g., `sentry-android-core`, `sentry-samples-spring-boot-4`)
23
+
- A **module name + test filter** (e.g., `sentry ScopesTest`)
24
+
25
+
Extract the module name and optional test class filter from the argument.
26
+
27
+
**Interactive mode:** If the test filter is ambiguous (e.g., matches multiple test classes across modules), use AskUserQuestion to let the user pick which test class(es) to run.
28
+
29
+
## Step 2: Detect Test Type
30
+
31
+
| Signal | Test Type |
32
+
|--------|-----------|
33
+
| Path contains `sentry-samples/`| System test |
34
+
| Module name starts with `sentry-samples-`| System test |
35
+
| Everything else | Unit test |
36
+
37
+
## Step 3a: Run Unit Tests
38
+
39
+
Determine the Gradle test task:
40
+
41
+
| Module Pattern | Test Task |
42
+
|---------------|-----------|
43
+
|`sentry-android-*`|`testDebugUnitTest`|
44
+
|`sentry-compose*`|`testDebugUnitTest`|
45
+
|`*-android`|`testDebugUnitTest`|
46
+
| Everything else |`test`|
47
+
48
+
**Interactive mode:** Before running, read the test class file and use AskUserQuestion to ask:
49
+
- "Run all tests in this class, or a specific method?" — list the test method names as options.
50
+
51
+
If the user picks a specific method, use `--tests="*ClassName.methodName"` as the filter.
System tests require the Python-based test runner which manages a mock Sentry server and sample app lifecycle.
66
+
67
+
1. Ensure the Python venv exists:
68
+
```bash
69
+
test -d .venv || make setupPython
70
+
```
71
+
72
+
2. Extract the sample module name. For file paths like `sentry-samples/<sample-module>/src/...`, the sample module is the directory name (e.g., `sentry-samples-spring`).
73
+
74
+
3. Run the system test:
75
+
```bash
76
+
.venv/bin/python test/system-test-runner.py test --module <sample-module>
77
+
```
78
+
79
+
This starts the mock Sentry server, starts the sample app (Spring Boot/Tomcat/CLI), runs tests via `./gradlew :sentry-samples:<sample-module>:systemTest`, and cleans up afterwards.
80
+
81
+
## Step 4: Report Results
82
+
83
+
Summarize the test outcome:
84
+
- Total tests run, passed, failed, skipped
85
+
- For failures: show the failing test name and the assertion/error message
Copy file name to clipboardExpand all lines: CHANGELOG.md
+31-4Lines changed: 31 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,21 +8,48 @@
8
8
- By default, the SDK now extracts the organization ID from the DSN (e.g. `o123.ingest.sentry.io`) and compares it with the `sentry-org_id` value in incoming baggage headers. When the two differ, the SDK starts a fresh trace instead of continuing the foreign one. This guards against accidentally linking traces across organizations.
9
9
- New option `enableStrictTraceContinuation` (default `false`): when enabled, both the SDK's org ID **and** the incoming baggage org ID must be present and match for a trace to be continued. Traces with a missing org ID on either side are rejected. Configurable via code (`setStrictTraceContinuation(true)`), `sentry.properties` (`enable-strict-trace-continuation=true`), Android manifest (`io.sentry.strict-trace-continuation.enabled`), or Spring Boot (`sentry.strict-trace-continuation=true`).
10
10
- New option `orgId`: allows explicitly setting the organization ID for self-hosted and Relay setups where it cannot be extracted from the DSN. Configurable via code (`setOrgId("123")`), `sentry.properties` (`org-id=123`), Android manifest (`io.sentry.org-id`), or Spring Boot (`sentry.org-id=123`).
11
+
12
+
## 8.37.0
13
+
14
+
### Fixes
15
+
16
+
- Session Replay: Fix Compose text masking mismatch with weighted text ([#5218](https://github.com/getsentry/sentry-java/pull/5218))
17
+
18
+
### Features
19
+
20
+
- Add cache tracing instrumentation for Spring Boot 2, 3, and 4 ([#5165](https://github.com/getsentry/sentry-java/pull/5165))
21
+
- Wraps Spring `CacheManager` and `Cache` beans to produce cache spans
22
+
- Set `sentry.enable-cache-tracing` to `true` to enable this feature
23
+
- Add JCache (JSR-107) cache tracing via new `sentry-jcache` module ([#5165](https://github.com/getsentry/sentry-java/pull/5165))
24
+
- Wraps JCache `Cache` with `SentryJCacheWrapper` to produce cache spans
25
+
- Set the `enableCacheTracing` option to `true` to enable this feature
26
+
- Add configurable `IScopesStorageFactory` to `SentryOptions` for providing a custom `IScopesStorage`, e.g. when the default `ThreadLocal`-backed storage is incompatible with non-pinning thread models ([#5199](https://github.com/getsentry/sentry-java/pull/5199))
11
27
- Android: Add `beforeErrorSampling` callback to Session Replay ([#5214](https://github.com/getsentry/sentry-java/pull/5214))
12
28
- Allows filtering which errors trigger replay capture before the `onErrorSampleRate` is checked
13
29
- Returning `false` skips replay capture entirely for that error; returning `true` proceeds with the normal sample rate check
14
30
- Example usage:
15
-
```java
31
+
```kotlin
16
32
SentryAndroid.init(context) { options ->
17
33
options.sessionReplay.beforeErrorSampling =
18
34
SentryReplayOptions.BeforeErrorSamplingCallback { event, hint ->
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,7 @@ Sentry SDK for Java and Android
57
57
| sentry-graphql ||
58
58
| sentry-graphql-core ||
59
59
| sentry-graphql-22 ||
60
+
| sentry-jcache ||
60
61
| sentry-quartz ||
61
62
| sentry-openfeign ||
62
63
| sentry-openfeature ||
Copy file name to clipboardExpand all lines: gradle/libs.versions.toml
+11-5Lines changed: 11 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -22,12 +22,12 @@ nopen = "1.0.1"
22
22
# see https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html#kotlin-compatibility
23
23
# see https://developer.android.com/jetpack/androidx/releases/compose-kotlin
24
24
okhttp = "4.9.2"
25
-
otel = "1.57.0"
26
-
otelInstrumentation = "2.23.0"
27
-
otelInstrumentationAlpha = "2.23.0-alpha"
25
+
otel = "1.60.1"
26
+
otelInstrumentation = "2.26.0"
27
+
otelInstrumentationAlpha = "2.26.0-alpha"
28
28
# check https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/dependencyManagement/build.gradle.kts#L49 for release version above to find a compatible version
0 commit comments