Skip to content

chore: Add integration tests for tracing - #1234

Merged
tustanivsky merged 6 commits into
mainfrom
chore/tracing-e2e-tests
Feb 17, 2026
Merged

chore: Add integration tests for tracing#1234
tustanivsky merged 6 commits into
mainfrom
chore/tracing-e2e-tests

Conversation

@tustanivsky

@tustanivsky tustanivsky commented Feb 17, 2026

Copy link
Copy Markdown
Collaborator

The existing unit tests for tracing had two issues:

  • Subsystem re-initialization: Both SentrySubsystem.spec.cpp (transaction lifecycle) and SentryTraceSampling.spec.cpp (custom trace sampler) called Close() + InitializeWithSettings() in BeforeEach, which caused flakiness and interfered with other tests in the automation suite.
  • No end-to-end validation: The tests only verified local API behavior (e.g. IsFinished() returns true after Finish()). They never validated that the transaction and its spans actually reached Sentry with the expected data.

Key changes:

  • Add tracing-capture test scenario to the sample app that starts a transaction with child and grandchild spans, sets and
    removes tags and data on both, and outputs the trace ID for lookup
  • Add CppTraceSampler to the sample app that accepts transactions matching the test name and discards all others,
    exercising the custom TracesSampler pipeline
  • Use StartTransactionWithContextAndOptions with custom sampling context to cover the full transaction creation path
  • Add tracing integration tests for Desktop (Windows/Linux/Mac) and Android that verify:
    • Transaction arrives in Sentry with correct name and operation
    • Custom tags are present and removed tags are absent
    • Transaction data is present and removed data is absent
    • Child spans have correct operations, descriptions, and data
    • Span hierarchy (parent-child relationships) is correct
  • Remove SentrySubsystem.spec.cpp, SentryTraceSampling.spec.cpp, and SentryTraceSamplingHandler.h unit tests replaced by e2e coverage
  • Bump app-runner to include Get-SentrySpans and Get-SentryTestTransaction helpers that query the spans dataset
  • Update package snapshot and integration test README
  • Fix transaction/span tag removal on Android

Depends on:

Related items:

#skip-changelog

@github-actions

github-actions Bot commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

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).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread plugin-dev/Source/Sentry/Private/Android/AndroidSentrySpan.cpp
@tustanivsky
tustanivsky merged commit e268106 into main Feb 17, 2026
104 of 105 checks passed
@tustanivsky
tustanivsky deleted the chore/tracing-e2e-tests branch February 17, 2026 16:16
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.

2 participants