Skip to content

test(spring-boot): [Sample Tests 9] Move the Boot 3 GraphQL tests into the module - #6295

Draft
runningcode wants to merge 2 commits into
no/boot-jakarta-cache-metrics-flags-testfrom
no/boot-jakarta-graphql-test
Draft

runningcode wants to merge 2 commits into
no/boot-jakarta-cache-metrics-flags-testfrom
no/boot-jakarta-graphql-test

Conversation

@runningcode

@runningcode runningcode commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (Sample Tests)


📜 Description

Ports the jakarta sample's GraphqlGreetingSystemTest, GraphqlProjectSystemTest and GraphqlTaskSystemTest to the integrationTest suite in sentry-spring-boot-jakarta, and deletes them from the sample. Each request's transaction must contain the matching graphql span:

  • a query, a query with a schema mapping, and a mutation;
  • a resolver error and a mutation error. Each is reported with its own transaction.
  • fields loaded through a @BatchMapping and through a registered DataLoader. The transaction has spans for Task.assignee and Task.creator.

How it differs from the sample:

  • No Apollo client: requests are plain JSON POSTs to /graphql. That removes the Apollo and OkHttp 4 dependencies these tests needed through sentry-system-test-support.
  • Errors tied to their requests: each error event is matched by its original exception message and linked to its transaction by trace ID. This keeps the two error tests apart on the shared mock server, and checks that each error belongs to its own request's transaction. A deliberately wrong expected span makes the test fail.
  • Trimmed schema: it keeps only what the tests use. The sample's subscription and its unused crash triggers are gone.

After this PR, the jakarta sample has one system test left: KafkaQueueSystemTest.

After a coverage audit against the sample's tests:

  • The task query also checks assigneeId and creatorId, which the sample asserted.

💡 Motivation and Context

This continues the Spring Boot 3 pilot. The suite now runs 27 tests in about 6s.

💚 How did you test it?

  • All 27 suite tests pass on Spring Boot 3.5.0.
  • They also pass with the catalog set to 3.2.12, the matrix's oldest version.
  • Expecting the wrong span on the mutation error's transaction makes that test fail.
  • :sentry-spring-boot-jakarta:check passes.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Port KafkaQueueSystemTest using EmbeddedKafka. The jakarta sample then has no tests, and it can come off the system-test runner and workflows.

#skip-changelog

@sentry

sentry Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.61.0 (1) release

⚙️ sentry-android Build Distribution Settings

This was referenced Oct 20, 2026
runningcode and others added 2 commits October 21, 2026 13:22
Ports the jakarta sample's three GraphQL system tests to the
integrationTest suite as plain JSON requests, so they no longer need
the Apollo client: queries, a schema mapping, a mutation, resolver
errors, and fields loaded through a batch mapping and a data loader.

Errors are matched by their exception and tied to their transaction by
trace ID, which both keeps two error tests apart on the shared server
and checks that the error belongs to its request's transaction.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…r ids

The sample's test asserted assigneeId and creatorId, which the query
requests but the port didn't check.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@runningcode
runningcode force-pushed the no/boot-jakarta-cache-metrics-flags-test branch from 896122f to c59a493 Compare October 21, 2026 11:27
@runningcode
runningcode force-pushed the no/boot-jakarta-graphql-test branch from 5379114 to 429aa76 Compare October 21, 2026 11:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant