Skip to content

Commit fdcd080

Browse files
runningcodeclaude
andauthored
test(log4j2): [Sample Tests 30] Move the log4j2 sample's system test into sentry-log4j2 (#6322)
* test(log4j2): Move the log4j2 sample's system test into sentry-log4j2 Adds SentryAppenderIntegrationTest, which configures the Sentry appender from XML in a logger context of its own and checks what reaches MockSentryServer: the warning event with its context tag and flag, the error with its exception and breadcrumbs, and the logs with their attributes. Logs are enabled through external configuration, as the sample's sentry.properties does, because the appender has no attribute for them. The sample has no system tests left, so it comes off the system-test runner and the backend workflow, and drops the Kotlin plugin it only needed for the test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(jul): [Sample Tests 31] Move the JUL sample's system test into sentry-jul (#6323) * test(jul): Move the JUL sample's system test into sentry-jul Adds SentryHandlerIntegrationTest, which configures the Sentry handler through a logging properties file read by LogManager, as the sample does, and checks what reaches MockSentryServer: the warning with its flag, the error with its exception and breadcrumbs, and the logs with their attributes. Its logger is outside io.sentry, whose loggers the handler drops, and the test restores the LogManager configuration the other tests read. The sample has no system tests left, so it comes off the system-test runner and the backend workflow, and drops the Kotlin plugin it only needed for the test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test: [Sample Tests 32] Add end-to-end tests of the core APIs and a profiled transaction (#6324) * test(core): Add an end-to-end test of the core APIs over the HTTP transport SentryEndToEndTest reports through the APIs an app uses without integrations and checks what reaches MockSentryServer: messages at the scope's and an explicit level, an exception with its feature flag, an event with a fingerprint, breadcrumbs from an event processor and a beforeBreadcrumb callback, ten events in a row, a transaction with a child span, and metrics with the scope's attributes. It ports the core part of the console sample's system test, which ran the sample's JAR against the Python mock server. The sample's profiling and Kafka parts follow in their own modules. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Merge the audit fixes from the branches below, and check the exception type end to end The console sample's test checked that the captured exception arrives with its type, RuntimeException, not just its value. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(core): Check that the shutdown hook delivers what an app reported before exiting The console samples' system tests ran each sample in its own JVM, asserted that it exited with 0 within 30 seconds, and relied on the shutdown hook to send everything, because the samples never flush or close Sentry. The in-process end-to-end tests flush explicitly, so neither the clean exit nor the hook's flush was tested any more. Run a small app in a child JVM that returns from main without flushing, and check that it exits with 0 and that its event, log and metric arrive. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(async-profiler): Add an end-to-end test of a profiled transaction ContinuousProfilerEndToEndTest starts a sampled transaction with the TRACE profile lifecycle and checks that its profile chunk reaches MockSentryServer, linked to the transaction by the profiler ID. It ports the profiling part of the console sample's system test. The profiler rejects a traces path with a dot anywhere in its absolute form, so the test puts it in the temp dir. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(kafka): [Sample Tests 34] Add an end-to-end test of the raw Kafka client's tracing (#6326) * test(async-profiler): Add an end-to-end test of a profiled transaction ContinuousProfilerEndToEndTest starts a sampled transaction with the TRACE profile lifecycle and checks that its profile chunk reaches MockSentryServer, linked to the transaction by the profiler ID. It ports the profiling part of the console sample's system test. The profiler rejects a traces path with a dot anywhere in its absolute form, so the test puts it in the temp dir. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(kafka): Add an end-to-end test of the raw Kafka client's tracing SentryKafkaEndToEndTest publishes a message through a wrapped KafkaProducer to an in-JVM KRaft broker, consumes it with SentryKafkaConsumerTracing, and checks what reaches MockSentryServer: the queue.publish span in the producing transaction, and a queue.process transaction with the consumer origin and the Kafka system that continues the producer's trace. It ports the Kafka part of the console sample's system test, which needed a Redpanda container. The broker comes from spring-kafka-test 3, which needs Java 17, so the test classpaths resolve Java 17 variants. The tests run on it anyway. With its core, profiling and Kafka parts ported, the console sample has no system test left, so it comes off the system-test runner and the backend workflow, whose base row moves to the console OTLP sample. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(opentelemetry): [Sample Tests 35] Add an end-to-end test of the agentless OpenTelemetry setup (#6327) * test(opentelemetry): Add an end-to-end test of the agentless OpenTelemetry setup AgentlessEndToEndTest builds the OpenTelemetry SDK through its autoconfiguration, which loads Sentry's customizer, and checks what reaches MockSentryServer: events, a transaction traced through OpenTelemetry with its child span and profile, and metrics. It ports sentry-samples-console-opentelemetry-noagent's system test, which no CI job ran. The customizer only initializes Sentry when the environment asks it to, so the test task sets SENTRY_AUTO_INIT. These are the module's first tests, so it applies the Kotlin plugin and gets an API dump. The sample has no system test left, so it comes off the system-test runner and drops the Kotlin plugin it only needed for the test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Merge the audit fixes from the branches below, and check the exception type in agentless mode Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(opentelemetry): [Sample Tests 36] Add an end-to-end test of the OTLP event linking (#6328) * test(opentelemetry): Add an end-to-end test of the OTLP event linking OtlpEndToEndTest captures a message, a log and a metric inside an OpenTelemetry span with OpenTelemetryOtlpEventProcessor installed, and checks what reaches MockSentryServer: the event carries the span's trace and span IDs, and the log and the metric arrive. It ports the OTLP-specific part of the console OTLP sample's system test, which never checked the link. The sample's other assertions are the console sample's, which SentryEndToEndTest covers. The sample has no system test left, so it comes off the system-test runner and the backend workflow, whose base row moves to the Spring Boot 4 OTLP sample, and drops the Kotlin plugin it only needed for the test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): [Sample Tests 37] Move the Boot 4 OTLP sample's tests into the module (#6329) * test(spring-boot): Move the Boot 4 OTLP sample's tests into the module Adds an integrationTestOtlp suite to sentry-spring-boot-4: the servlet app with the OpenTelemetry Spring Boot starter, set up by sentry-opentelemetry-otlp-spring, and OpenTelemetryOtlpEventProcessor. It ports the sample's tests, which were the servlet suite's without OkHttp, and keeps the log and metric attribute checks the sample had dropped. The sample's transactions came from Sentry's own tracing, which CI enabled with SENTRY_TRACES_SAMPLE_RATE, so the suite sets the sample rate the same way. A new test checks what OTLP mode is for: an error in a request carries the request's OpenTelemetry trace. Events point at that trace rather than at Sentry's transaction, so the GraphQL errors are checked next to their transactions instead of by trace ID, as the sample did. The sample has no system tests left, so it comes off the system-test runner. It was the backend workflow's last sample, so the workflow goes too. The Spring Boot 4 matrix runs the new suite. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Merge the audit fixes from the branches below, and port them to the Boot 4 OTLP suite Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test: [Sample Tests 38] Remove the system-test runner and its Python mock server (#6330) * test: Remove the system-test runner and its Python mock server Every sample's system test now lives in the module it tests, so the Python runner, its mock Sentry server, requirements.txt and the Makefile targets that ran them have nothing left to run. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test: [Sample Tests 39] Remove the io.sentry.systemtest plugin and sentry-system-test-support (#6331) * test: Remove the io.sentry.systemtest plugin and sentry-system-test-support With the runner gone, nothing applies the io.sentry.systemtest convention plugin or depends on sentry-system-test-support, which held the HTTP and GraphQL clients and the TestHelper the system tests used. The envelope matchers it delegated to stay in sentry-test-support. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * docs: [Sample Tests 40] Describe the in-module end-to-end tests instead of the system tests (#6332) * docs: Describe the in-module end-to-end tests instead of the system tests The e2e_tests rule now covers MockSentryServer, where each kind of end-to-end test lives, the Spring suites per flavor, the OpenTelemetry agent fixture, how to run them and the gotchas the migration found. The test skill runs integration suites by their source set instead of the Python runner, the new_module rule no longer asks for sample tests, and AGENTS.md drops sentry-system-test-support. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Merge the audit fixes from the branches below, and document the test client and log4j2 suite The context's TestRestTemplate adds trace headers of its own whenever Sentry customizes the RestTemplateBuilder, not only in OpenTelemetry mode, and the Spring Boot modules have an integrationTestLog4j2 suite. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent d859296 commit fdcd080

85 files changed

Lines changed: 1851 additions & 3807 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.claude/skills/test/SKILL.md‎

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
22
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.
3+
description: Run tests for a specific SDK module. Use when asked to "run tests", "test module", "run unit tests", "run integration tests", "run e2e tests", or test a specific class. Auto-detects unit tests vs integration test suites. Supports interactive mode.
44
allowed-tools: Bash, Read, Glob, AskUserQuestion
55
argument-hint: [interactive] <module-name-or-file-path> [test-class-filter]
66
---
77

88
# Run Tests
99

10-
Run tests for a specific module. Auto-detects whether to run unit tests or system tests.
10+
Run tests for a specific module. Auto-detects whether to run unit tests or an integration test
11+
suite.
1112

1213
## Step 0: Check for Interactive Mode
1314

@@ -19,7 +20,7 @@ In interactive mode, use AskUserQuestion at decision points as described in the
1920

2021
The argument can be either:
2122
- 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** (e.g., `sentry-android-core`, `sentry-spring-boot-4`)
2324
- A **module name + test filter** (e.g., `sentry ScopesTest`)
2425

2526
Extract the module name and optional test class filter from the argument.
@@ -30,10 +31,13 @@ Extract the module name and optional test class filter from the argument.
3031

3132
| Signal | Test Type |
3233
|--------|-----------|
33-
| Path contains `sentry-samples/` | System test |
34-
| Module name starts with `sentry-samples-` | System test |
34+
| Path contains `/src/integrationTest*/` or `/src/agentFixture/` | Integration test suite |
35+
| Path contains `sentry-samples/`, or module name starts with `sentry-samples-` | None: samples have no tests |
3536
| Everything else | Unit test |
3637

38+
For a sample, tell the user that samples have no tests, and that the end-to-end tests for what
39+
the sample shows live in the module it uses (see the `e2e_tests` rule).
40+
3741
## Step 3a: Run Unit Tests
3842

3943
Determine the Gradle test task:
@@ -60,30 +64,20 @@ Without a filter:
6064
./gradlew ':<module>:<task>' --info
6165
```
6266

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-
```
67+
## Step 3b: Run an Integration Test Suite
7168

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`).
69+
The suite's task is named after its source set directory: `src/integrationTestWebflux/...` runs
70+
with `integrationTestWebflux`. The OpenTelemetry agent suite runs in two tasks, one per init mode,
71+
so for `src/integrationTestOtelAgent/` or `src/agentFixture/` run both:
7372

74-
3. Run the system test:
7573
```bash
76-
.venv/bin/python test/system-test-runner.py test --module <sample-module>
74+
./gradlew ':<module>:integrationTestOtelAgent' ':<module>:integrationTestOtelAgentWithoutAutoInit'
7775
```
7876

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-
To run **every** system test instead of one module, use the Makefile targets — they also create the
82-
venv for you:
77+
Otherwise, with or without a test class filter:
8378

8479
```bash
85-
make systemTest # all system tests (--all)
86-
make systemTestInteractive # pick the setups to run (--interactive)
80+
./gradlew ':<module>:<suite>' --tests="*<filter>*"
8781
```
8882

8983
## Step 4: Report Results

‎.cursor/rules/e2e_tests.mdc‎

Lines changed: 70 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,82 @@ alwaysApply: false
33
description: Java SDK End to End Tests
44
---
55

6-
# Java SDK End to End Tests (System Tests)
6+
# Java SDK End to End Tests
77

8-
The samples in the `sentry-samples` directory are used to run end to end tests against them.
8+
End-to-end tests live in the module whose code they test, not in `sentry-samples`. Samples have no
9+
tests. A test runs the code the way an app would and asserts what reaches Sentry over the real HTTP
10+
transport.
911

10-
There is a python script (`system-test-runner.py`) that can be used to run one (using `--module SAMPLE_NAME`) or all (using `--all`) system tests.
12+
## MockSentryServer
1113

12-
The script has an interactive mode (`-i`) which allows selection of test setups to execute, whether to run the tests or just prepare infrastructure for testing from IDE.
14+
`MockSentryServer` (`sentry-test-support`) is an in-process HTTP server on a free port. Point the
15+
SDK at `server.dsn`, then:
1316

14-
The tests run a mock Sentry server via `system-test-sentry-server.py`. Any system under test will then have a DSN set that reflects this local mock server like `http://502f25099c204a2fbf4cb16edc5975d1@localhost:8000/0`.
15-
By using this local DSN, the system under test sends events to the local mock server.
16-
The tests can then use `TestHelper` to assert envelopes that were received by the mock server.
17-
`TestHelper` uses HTTP requests to retrieve the JSON payload of the received events and deserialize them back to objects for easier assertion.
18-
Tests can then assert events, transactions, logs etc. similar to how they would appear in `beforeSend` and similar callbacks.
17+
- `awaitEnvelope(timeoutMillis) { predicate }` polls for a matching envelope and fails with what it
18+
received on timeout.
19+
- `assertNoEnvelope(millis) { predicate }` checks that nothing matching arrives.
20+
- `MockSentryServer { ... }` takes a hook that runs before each check while waiting, for example to
21+
flush an OpenTelemetry tracer provider.
1922

20-
`TestHelper` has a lot of helper methods for asserting, e.g. by span name, log body etc.
23+
`EnvelopeMatchers.kt` has the accessors and matchers: `event()`, `transaction()`, `logs()`,
24+
`metrics()`, `profileChunk()`, `hasSpanWithOp`, `hasFlag`, `hasLogWithAttribute`, `hasMetric` and
25+
so on.
2126

22-
The end to end tests either expect the system under test to either be running on a server or call `java -jar` to execute a CLI system under test.
27+
Call `Sentry.flush()` before awaiting when Sentry runs in the test's JVM: logs and metrics are
28+
batched. Envelopes that arrive late can outlive a server's `reset()`, so tests that share a server
29+
match on values only they produce.
2330

24-
For Spring Boot, we spin up the Spring Boot server. The tests then send requests to that server and assert what is sent to Sentry.
31+
## Where the tests are
2532

26-
End to end tests are also executed on CI using a matrix build, as defined in `.github/workflows/system-tests-backend.yml`.
33+
- **Core and plain integrations** use their module's `src/test`. Examples: `SentryEndToEndTest`
34+
(`sentry`), `SentryAppenderIntegrationTest` (`sentry-logback`, `sentry-log4j2`, loading the
35+
appender from XML), `SentryHandlerIntegrationTest` (`sentry-jul`),
36+
`ContinuousProfilerEndToEndTest` (`sentry-async-profiler`), `SentryKafkaEndToEndTest`
37+
(`sentry-kafka`), `AgentlessEndToEndTest` and `OtlpEndToEndTest` (`sentry-opentelemetry-*`).
38+
- **Spring Boot** (`sentry-spring-boot`, `sentry-spring-boot-jakarta`, `sentry-spring-boot-4`) has
39+
one JVM test suite per flavor, because a flavor is a classpath: Sentry's auto-configuration and
40+
OpenTelemetry mode switch on which classes are present.
41+
- `integrationTest`: servlet app.
42+
- `integrationTestWebflux`: reactive app.
43+
- `integrationTestOtelNoAgent`: `sentry-opentelemetry-agentless-spring`.
44+
- `integrationTestOtelAgent` and `integrationTestOtelAgentWithoutAutoInit`: the built agent.
45+
- `integrationTestOtlp` (Boot 4): `sentry-opentelemetry-otlp-spring`.
46+
- `integrationTestLog4j2` (Boot 3, 4): Log4j2 instead of Logback, for the auto-configured
47+
Log4j2 appender.
2748

28-
Some of the samples are tested in multiple ways, e.g. with OpenTelemetry Agent auto init turned on and off.
49+
Each suite has a base class with `@SpringBootTest(RANDOM_PORT)` and a `@DynamicPropertySource`
50+
that sets `sentry.dsn`. Subclasses share one context and one server.
51+
- **Plain Spring** (`sentry-spring`, `sentry-spring-jakarta`, `sentry-spring-7`) has an
52+
`integrationTest` suite that starts the app in an embedded Tomcat, the way a WAR starts. Spring
53+
Boot stays off its classpath, because `SentrySpringServletContainerInitializer` behaves
54+
differently with it.
55+
56+
## The OpenTelemetry agent
57+
58+
The agent must not run in the test's JVM, because it would instrument the test's own HTTP client
59+
and server. The Spring Boot modules have an `agentFixture` source set with the app. `AgentApp`
60+
starts it once per test JVM in a child process, with `ChildJvmApp` and the agent jar passed through
61+
`ChildJvmTestArguments`. The suite's task runs with the agent initializing Sentry, and
62+
`integrationTestOtelAgentWithoutAutoInit` runs the same tests with the Spring Boot starter doing
63+
it. Gradle runs the two in parallel.
64+
65+
## Running them
66+
67+
- The `spring-boot-{2,3,4}-matrix.yml` workflows run the suites against each supported Spring Boot
68+
version, by setting the version in `gradle/libs.versions.toml`. The suites aren't part of
69+
`check`, so a new suite only runs on CI once it's added to its matrix.
70+
71+
## Gotchas
72+
73+
- Don't use the context's `TestRestTemplate`. It comes from the `RestTemplateBuilder` that Sentry
74+
customizes, and that the OpenTelemetry starter instruments, so it adds or replaces trace headers
75+
on the requests a test sends. Build one outside the context.
76+
- Sentry exports OpenTelemetry spans in batches every 5 seconds. In-process, flush the tracer
77+
provider from the server's hook. With the agent this isn't possible, so each test waits for a
78+
batch and negative checks wait at least 6 seconds.
79+
- Sentry is global, so a second live Spring context in an OpenTelemetry suite takes it over. Keep
80+
one live context per JVM (`@DirtiesContext` when a test needs its own).
81+
- The async profiler rejects a traces path with a `.` anywhere in its absolute form. Put the path
82+
in `java.io.tmpdir`.
83+
- Kafka uses an in-JVM broker (`@EmbeddedKafka` or spring-kafka-test's broker classes), so no
84+
Docker is needed.

‎.cursor/rules/new_module.mdc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ static {
6969
addIntegrationToSdkVersion("{IntegrationName}");
7070
```
7171

72-
7. If adding a JVM sample, add E2E (system) tests, following the structure we have in the existing JVM examples.
73-
The test should then be added to `test/system-test-runner.py` and `.github/workflows/system-tests-backend.yml`.
72+
7. Samples have no tests. Add end-to-end coverage of what the sample shows to the module it uses,
73+
against `MockSentryServer`, as described in the `e2e_tests` rule.
7474

7575
`sentry-bom` and the root `build.gradle.kts` need no change — they iterate over subprojects.
7676

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ jobs:
6666
:sentry-spring-boot-4:integrationTestOtelNoAgent \
6767
:sentry-spring-boot-4:integrationTestLog4j2 \
6868
:sentry-spring-boot-4:integrationTestOtelAgent \
69-
:sentry-spring-boot-4:integrationTestOtelAgentWithoutAutoInit
69+
:sentry-spring-boot-4:integrationTestOtelAgentWithoutAutoInit \
70+
:sentry-spring-boot-4:integrationTestOtlp
7071
7172
- name: Upload test results
7273
if: always()

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

Lines changed: 0 additions & 91 deletions
This file was deleted.

‎AGENTS.md‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ rule file in `.cursor/rules/`:
2020
| `continuous_profiling_jvm` | `sentry-async-profiler`, `IContinuousProfiler`, `ProfileChunk`, JFR files, `ProfileLifecycle` |
2121
| `opentelemetry` | `sentry-opentelemetry-*`, agent vs agentless, span processing, sampling, context propagation |
2222
| `new_module` | Adding a new integration or sample module |
23-
| `e2e_tests` | System tests, sample applications, `system-test-runner.py`, mock Sentry server |
23+
| `e2e_tests` | End-to-end tests, `MockSentryServer`, integration test suites, the OpenTelemetry agent fixture |
2424

2525
Rules can be combined — a tracing scope issue may need both `scopes` and `opentelemetry`.
2626
There is no rule for Android profiling yet; read the `sentry-android-core` profiling code
@@ -55,7 +55,7 @@ The project uses **Gradle** with Kotlin DSL. Key build files:
5555
```
5656

5757
To run tests, use the `test` skill rather than composing the Gradle invocation by hand — it
58-
resolves the per-module test task and the unit-test vs system-test split for you.
58+
resolves the per-module test task, including integration test suites, for you.
5959

6060
### Android-Specific Commands
6161
```bash
@@ -109,8 +109,7 @@ The repository is organized into multiple modules:
109109
- **Other**: `sentry-spotlight`, `sentry-kotlin-extensions`, `sentry-android-distribution`
110110

111111
### Utility Modules
112-
- **`sentry-test-support`** - Shared test utilities
113-
- **`sentry-system-test-support`** - System testing infrastructure
112+
- **`sentry-test-support`** - Shared test utilities, including `MockSentryServer` and envelope matchers
114113
- **`sentry-samples`** - Example applications
115114
- **`sentry-bom`** - Bill of Materials for dependency management
116115

@@ -158,7 +157,7 @@ PR description why the broad catch is necessary.
158157
### Testing Requirements
159158
- Write comprehensive unit tests for new features
160159
- Android modules require both unit tests and instrumented tests where applicable
161-
- System tests validate end-to-end functionality with sample applications
160+
- End-to-end tests run in the module they test, against `MockSentryServer`. Samples have no tests
162161
- **Assertions**: For new unit tests, prefer [Google Truth](https://truth.dev/) (`com.google.common.truth.Truth.assertThat`) over `kotlin.test`/JUnit assertions for its readable, fluent API. Keep using `kotlin.test` for test structure (`@Test`, `assertFailsWith`). See `sentry/src/test/java/io/sentry/DsnTest.kt` for the style. Don't rewrite existing `kotlin.test` assertions solely to switch libraries.
163162
- Truth is wired into the `sentry` module. When adding Truth-based tests to another module, add `testImplementation(libs.google.truth)` to that module's `build.gradle.kts`.
164163

‎Makefile‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: all clean compile javadocs dryRelease update checkFormat api assembleUiTestRelease assembleUiTestCriticalRelease runUiTestCritical setupPython systemTest systemTestInteractive check preMerge publish
1+
.PHONY: all clean compile javadocs dryRelease update checkFormat api assembleUiTestRelease assembleUiTestCriticalRelease runUiTestCritical check preMerge publish
22

33
all: stop clean javadocs compile
44
assembleUiTests: assembleUiTestRelease
@@ -46,20 +46,6 @@ assembleUiTestCriticalRelease:
4646
runUiTestCritical:
4747
./scripts/test-ui-critical.sh
4848

49-
# Create the Python virtual environment for system tests, and install the necessary dependencies
50-
setupPython:
51-
@test -d .venv || python3 -m venv .venv
52-
.venv/bin/pip install --upgrade pip
53-
.venv/bin/pip install -r requirements.txt
54-
55-
# Run system tests for sample applications
56-
systemTest: setupPython
57-
.venv/bin/python test/system-test-runner.py test --all
58-
59-
# Run system tests with interactive module selection
60-
systemTestInteractive: setupPython
61-
.venv/bin/python test/system-test-runner.py test --interactive
62-
6349
# Run tests and lint
6450
check:
6551
./gradlew check

‎build-logic/src/main/kotlin/io.sentry.systemtest.gradle.kts‎

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)