Tests: Better error message for failing integration tests

This commit is contained in:
Klaas van Schelven
2025-02-20 09:26:04 +01:00
parent 93ae506230
commit 934764dd8c
2 changed files with 12 additions and 6 deletions

View File

@@ -312,8 +312,10 @@ class IngestViewTestCase(TransactionTestCase):
# as per send_json command ("weirdly enough a large numer of sentry test data don't actually...")
data["timestamp"] = time.time()
if not command.is_valid(data, filename) and filename not in known_broken:
raise Exception("validatity check in %s: %s" % (filename, command.stderr.getvalue()))
if not command.is_valid(data, filename):
if filename not in known_broken:
raise Exception("validatity check in %s: %s" % (filename, command.stderr.getvalue()))
command.stderr = io.StringIO() # reset the error buffer; needed in the loop w/ known_broken
event_id = data["event_id"]
if not include_event_id:
@@ -367,8 +369,10 @@ class IngestViewTestCase(TransactionTestCase):
# as per send_json command ("weirdly enough a large numer of sentry test data don't actually...")
data["timestamp"] = time.time()
if not command.is_valid(data, filename) and filename not in known_broken:
raise Exception("validatity check in %s: %s" % (filename, command.stderr.getvalue()))
if not command.is_valid(data, filename):
if filename not in known_broken:
raise Exception("validatity check in %s: %s" % (filename, command.stderr.getvalue()))
command.stderr = io.StringIO() # reset the error buffer; needed in the loop w/ known_broken
event_id = data["event_id"]

View File

@@ -493,8 +493,10 @@ class IntegrationTest(TransactionTestCase):
# tested)
data["event_id"] = uuid.uuid4().hex
if not command.is_valid(data, filename) and filename not in known_broken:
raise Exception("validatity check in %s: %s" % (filename, command.stderr.getvalue()))
if not command.is_valid(data, filename):
if filename not in known_broken:
raise Exception("validatity check in %s: %s" % (filename, command.stderr.getvalue()))
command.stderr = StringIO() # reset the error buffer; needed in the loop w/ known_broken
response = self.client.post(
f"/api/{ project.id }/store/",