sentry-unity icon indicating copy to clipboard operation
sentry-unity copied to clipboard

Improve Integration Tests

Open bitsandfoxes opened this issue 7 months ago • 2 comments
trafficstars

Problem Statement

The current integration test is limited to running the SmokeTester and crash tests with a mock server that only confirms whether events were sent, without providing visibility into their content. This creates significant testing gaps. For example, we cannot verify if scope synchronization is functioning correctly. This limitation is particularly evident when trying to observe trace changes introduced in https://github.com/getsentry/sentry-dotnet/pull/4026.

There currently is no way to validate events coming from different layers of the application.

Proposal

Rather than depending on the SmokeTester to intercept .NET SDK send-attempts and validate them on the running client, we should enhance the crash-test-server to persist envelopes to disk. When executing the CrashTest, we should then validate both the presence and contents of these stored envelopes.

Implementation steps:

  1. Start the fake server
  2. Execute the game (SmokeTester remains to trigger errors and send events)
  3. Server receives and persists events to disk
  4. Verify successful game execution
  5. Read persisted envelopes and validate their contents against expected values

Non-exhaustive list of things to check for:

  • Reporting SDKs name (sentry.cocoa.unity)
  • Synched Scope
    • Tags
    • User
    • Breadcrumbs

bitsandfoxes avatar Apr 07 '25 14:04 bitsandfoxes