Skip to content

Commit

Permalink
Add flags integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
cmanallen committed Jan 21, 2025
1 parent 4c3c9b2 commit ecfd493
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/integration/test_flags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import json
import uuid

from sentry_sdk.envelope import Envelope, Item, PayloadRef


def test_user_report_with_event(relay_with_processing, mini_sentry):
project_id = 42
relay = relay_with_processing()
mini_sentry.add_full_project_config(project_id)

event_id = uuid.uuid1().hex
error_payload = {
"event_id": event_id,
"message": "test",
"context": {"flags": {"values": [{"flag": "hello", "result": "world"}]}},
"type": "error",
"environment": "production",
"release": "[email protected]",
}

envelope = Envelope(headers={"event_id": event_id})
envelope.add_item(Item(PayloadRef(json=error_payload), type="event"))

relay.send_envelope(project_id, envelope)

envelope = mini_sentry.captured_events.get(timeout=1)
assert envelope

0 comments on commit ecfd493

Please sign in to comment.