Skip to content

Commit

Permalink
feat: Validate schemas for all topics in the test api (#4485)
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnagara authored Jul 11, 2023
1 parent 9c94e09 commit e9f6201
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions snuba/web/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,9 +619,7 @@ def eventstream(*, entity: Entity) -> RespTuple:

storage = entity.get_writable_storage()
assert storage is not None
storage_name = storage.get_storage_key().value
# TODO: A few storages are currently excluded from schema validation
should_validate_schema = storage_name not in ["search_issues", "replays"]
should_validate_schema = True

try:
if type_ == "insert":
Expand Down
3 changes: 2 additions & 1 deletion tests/test_search_issues_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def base_insert_event(
"data": {
"received": now.timestamp(),
},
"occurrence_id": str(uuid.uuid4()),
"occurrence_data": {
"id": str(uuid.uuid4()),
"type": 1,
Expand Down Expand Up @@ -238,7 +239,7 @@ def test_eventstream_query_transaction_maps_to_tags(self) -> None:
transaction_name = "/api/im/the/best"
now = datetime.utcnow()
insert_row = base_insert_event(now)
insert_row[2]["data"]["tags"] = {"transaction": transaction_name}
insert_row[2]["data"]["tags"] = [["transaction", transaction_name]]

response = self.app.post(
"/tests/search_issues/eventstream", data=json.dumps(insert_row)
Expand Down

0 comments on commit e9f6201

Please sign in to comment.