Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iambriccardo committed Oct 2, 2023
1 parent 773f2d4 commit df9c8b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
5 changes: 0 additions & 5 deletions tests/sentry/api/endpoints/test_project_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,11 +717,6 @@ def test_options(self):
event=audit_log.get_event_id("PROJECT_EDIT"),
).exists()
assert project.get_option("filters:react-hydration-errors", "1")
with assume_test_silo_mode(SiloMode.CONTROL):
assert AuditLogEntry.objects.filter(
organization_id=project.organization_id,
event=audit_log.get_event_id("PROJECT_EDIT"),
).exists()
assert project.get_option("filters:chunk-load-error", "1")

def test_bookmarks(self):
Expand Down
17 changes: 17 additions & 0 deletions tests/sentry/relay/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,23 @@ def test_project_config_uses_filter_features(
assert cfg_client_ips is None


@django_db_all
@region_silo_test(stable=True)
def test_project_config_with_chunk_load_error_filter(default_project):
default_project.update_option("filters:react-hydration-errors", False)
default_project.update_option("filters:chunk-load-error", True)

project_cfg = get_project_config(default_project, full_config=True)

cfg = project_cfg.to_dict()
_validate_project_config(cfg["config"])
cfg_error_messages = get_path(cfg, "config", "filterSettings", "errorMessages")

assert cfg_error_messages == {
"patterns": ["ChunkLoadError: Loading chunk * failed.\n(error: *)"]
}


@django_db_all
@region_silo_test(stable=True)
@mock.patch("sentry.relay.config.EXPOSABLE_FEATURES", ["organizations:profiling"])
Expand Down

0 comments on commit df9c8b3

Please sign in to comment.