Skip to content

Commit 43e78bb

Browse files
authored
Merge branch 'main' into feat/cache-tracing
2 parents 21db8da + 23b2680 commit 43e78bb

32 files changed

+743
-103
lines changed

.agents/skills

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.claude/skills

.claude/skills/test/SKILL.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
name: test
3+
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.
4+
allowed-tools: Bash, Read, Glob, AskUserQuestion
5+
argument-hint: [interactive] <module-name-or-file-path> [test-class-filter]
6+
---
7+
8+
# Run Tests
9+
10+
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.
52+
53+
With a test class filter:
54+
```bash
55+
./gradlew ':<module>:<task>' --tests="*<filter>*" --info
56+
```
57+
58+
Without a filter:
59+
```bash
60+
./gradlew ':<module>:<task>' --info
61+
```
62+
63+
## Step 3b: Run System Tests
64+
65+
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

.github/workflows/spring-boot-4-matrix.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,13 @@ jobs:
132132
--auto-init "false" \
133133
--build "true"
134134
135-
# needs a fix in opentelemetry-spring-boot-starter
136-
# - name: Run sentry-samples-spring-boot-4-opentelemetry-noagent
137-
# run: |
138-
# python3 test/system-test-runner.py test \
139-
# --module "sentry-samples-spring-boot-4-opentelemetry-noagent" \
140-
# --agent false \
141-
# --auto-init "true" \
142-
# --build "true"
135+
- name: Run sentry-samples-spring-boot-4-opentelemetry-noagent
136+
run: |
137+
python3 test/system-test-runner.py test \
138+
--module "sentry-samples-spring-boot-4-opentelemetry-noagent" \
139+
--agent false \
140+
--auto-init "true" \
141+
--build "true"
143142
144143
- name: Run sentry-samples-spring-7
145144
run: |

.github/workflows/system-tests-backend.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ jobs:
7272
- sample: "sentry-samples-spring-boot-4-webflux"
7373
agent: "false"
7474
agent-auto-init: "true"
75-
# - sample: "sentry-samples-spring-boot-4-opentelemetry-noagent"
76-
# agent: "false"
77-
# agent-auto-init: "true"
75+
- sample: "sentry-samples-spring-boot-4-opentelemetry-noagent"
76+
agent: "false"
77+
agent-auto-init: "true"
7878
- sample: "sentry-samples-spring-boot-4-opentelemetry"
7979
agent: "true"
8080
agent-auto-init: "true"

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ local.properties
1313
**/sentry-native-local
1414
target/
1515
.classpath
16+
.factorypath
1617
.project
1718
.settings/
1819
bin/
@@ -30,5 +31,6 @@ spy.log
3031
**/tomcat.8080/webapps/
3132
**/__pycache__
3233

33-
# Local Claude Code settings that should not be committed
34+
# Local Claude Code settings/state that should not be committed
3435
.claude/settings.local.json
36+
.claude/worktrees/

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Fixes
6+
7+
- Session Replay: Fix Compose text masking mismatch with weighted text ([#5218](https://github.com/getsentry/sentry-java/pull/5218))
8+
59
### Features
610

711
- Add cache tracing instrumentation for Spring Boot 2, 3, and 4 ([#5165](https://github.com/getsentry/sentry-java/pull/5165))
@@ -10,6 +14,7 @@
1014
- Add JCache (JSR-107) cache tracing via new `sentry-jcache` module ([#5165](https://github.com/getsentry/sentry-java/pull/5165))
1115
- Wraps JCache `Cache` with `SentryJCacheWrapper` to produce cache spans
1216
- Set the `enableCacheTracing` option to `true` to enable this feature
17+
- 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))
1318
- Android: Add `beforeErrorSampling` callback to Session Replay ([#5214](https://github.com/getsentry/sentry-java/pull/5214))
1419
- Allows filtering which errors trigger replay capture before the `onErrorSampleRate` is checked
1520
- Returning `false` skips replay capture entirely for that error; returning `true` proceeds with the normal sample rate check
@@ -25,6 +30,15 @@
2530
}
2631
```
2732

33+
### Dependencies
34+
35+
- Bump OpenTelemetry ([#5225](https://github.com/getsentry/sentry-java/pull/5225))
36+
- `opentelemetry` to `1.60.1` (was `1.57.0`)
37+
- `opentelemetry-instrumentation` to `2.26.0` (was `2.23.0`)
38+
- `opentelemetry-instrumentation-alpha` to `2.26.0-alpha` (was `2.23.0-alpha`)
39+
- `opentelemetry-semconv` to `1.40.0` (was `1.37.0`)
40+
- `opentelemetry-semconv-alpha` to `1.40.0-alpha` (was `1.37.0-alpha`)
41+
2842
## 8.36.0
2943

3044
### Features

gradle/libs.versions.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ nopen = "1.0.1"
2222
# see https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html#kotlin-compatibility
2323
# see https://developer.android.com/jetpack/androidx/releases/compose-kotlin
2424
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"
2828
# 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
29-
otelSemanticConventions = "1.37.0"
30-
otelSemanticConventionsAlpha = "1.37.0-alpha"
29+
otelSemanticConventions = "1.40.0"
30+
otelSemanticConventionsAlpha = "1.40.0-alpha"
3131
retrofit = "2.9.0"
3232
slf4j = "1.7.30"
3333
springboot2 = "2.7.18"

sentry-android-core/build.gradle.kts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import org.jetbrains.kotlin.config.KotlinCompilerVersion
44
plugins {
55
id("com.android.library")
66
alias(libs.plugins.kotlin.android)
7+
alias(libs.plugins.kotlin.compose)
78
jacoco
89
alias(libs.plugins.jacoco.android)
910
alias(libs.plugins.errorprone)
@@ -108,7 +109,11 @@ dependencies {
108109
testImplementation(projects.sentryCompose)
109110
testImplementation(projects.sentryAndroidNdk)
110111
testImplementation(libs.dropbox.differ)
111-
testRuntimeOnly(libs.androidx.compose.ui)
112+
testImplementation(libs.androidx.activity.compose)
113+
testImplementation(libs.androidx.compose.ui)
114+
testImplementation(libs.androidx.compose.foundation)
115+
testImplementation(libs.androidx.compose.foundation.layout)
116+
testImplementation(libs.androidx.compose.material3)
112117
testRuntimeOnly(libs.androidx.fragment.ktx)
113118
testRuntimeOnly(libs.timber)
114119
}

0 commit comments

Comments
 (0)