Skip to content

test: add sentrytest package#1267

Merged
giortzisg merged 3 commits intomasterfrom
test/sentrytest
Apr 16, 2026
Merged

test: add sentrytest package#1267
giortzisg merged 3 commits intomasterfrom
test/sentrytest

Conversation

@giortzisg
Copy link
Copy Markdown
Contributor

Description

The sentrytest package is a wrapper for writing simpler integration tests. The package simulates sentry.Init and runs in a synctest bubble to eliminate timing-related flakiness.

Issues

Changelog Entry Instructions

To add a custom changelog entry, uncomment the section above. Supports:

  • Single entry: just write text
  • Multiple entries: use bullet points
  • Nested bullets: indent 4+ spaces

For more details: custom changelog entries

Reminders

the sentrytest package is a wrapper for writing simpler integration
tests. The package simulates sentry.Init and runs in a synctest bubble
to eliminate timing-related flakiness.
@giortzisg giortzisg self-assigned this Apr 16, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 16, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Breaking Changes 🛠

  • Update compatibility policy to align with Go, supporting only the last two major Go versions. by giortzisg in #1264
  • Drop support for Go 1.24 by giortzisg in #1264

Internal Changes 🔧

Deps

  • Bump golangci-lint action from 2.1.1 to 2.11.4 by giortzisg in #1265
  • Bump go.opentelemetry.io/otel/sdk from 1.40.0 to 1.43.0 in /otel by dependabot in #1256
  • Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.40.0 to 1.43.0 in /otel/otlp by dependabot in #1255

Other

  • Add sentrytest package by giortzisg in #1267

🤖 This preview updates automatically when you update the PR.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1b8215e. Configure here.

Comment thread internal/sentrytest/fixture.go
// and all unexported fields.
var DefaultEventCmpOpts = cmp.Options{
cmpopts.IgnoreFields(sentry.Event{},
"Contexts",
Copy link
Copy Markdown
Member

@lcian lcian Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the test needs to check for a particular value in a Context?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I guess you can override this via the opts passed in DiffEvents right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have two options, override via DiffEvents, or since fixture.Events() exposes all the received events anyway, you can assert on event.Contexts manually.

Copy link
Copy Markdown
Member

@lcian lcian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@giortzisg giortzisg merged commit e259585 into master Apr 16, 2026
16 checks passed
@giortzisg giortzisg deleted the test/sentrytest branch April 16, 2026 13:52
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.

3 participants