Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Segment Masking Test Failures (#375)
Browse files Browse the repository at this point in the history
* Investigate segment masking test failures.

* Remove pause - if there are future test failures we may need to investigate again.

* Restore pause.
  • Loading branch information
pattisdr authored Apr 8, 2022
1 parent 351fb23 commit dc34a14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions tests/integration_tests/saas/test_segment_task.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from typing import Dict
import time
import random
import requests
Expand Down Expand Up @@ -146,9 +145,10 @@ def _create_test_segment_email(base_email: str, timestamp: int) -> str:


def create_segment_test_data(
segment_secrets: Dict[str, str], segment_identity_email: str
segment_connection_config, segment_identity_email: str
):
"""Seeds a segment user and event"""
segment_secrets = segment_connection_config.secrets
if not segment_identity_email: # Don't run unnecessarily locally
return

Expand Down Expand Up @@ -218,13 +218,13 @@ def test_segment_saas_erasure_request_task(
segment_connection_config,
segment_dataset_config,
segment_identity_email,
segment_secrets,
) -> None:
"""Full erasure request based on the Segment SaaS config"""
config.execution.MASKING_STRICT = False # Allow GDPR Delete

# Create user for GDPR delete
erasure_email = create_segment_test_data(segment_secrets, segment_identity_email)
erasure_email = create_segment_test_data(segment_connection_config, segment_identity_email)
time.sleep(2) # Pause before making access/erasure requests
privacy_request = PrivacyRequest(
id=f"test_saas_access_request_task_{random.randint(0, 1000)}"
)
Expand Down
7 changes: 4 additions & 3 deletions tests/integration_tests/saas/test_sentry_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ def test_sentry_saas_access_request_task(
)


def sentry_erasure_test_prep(sentry_secrets, sentry_connection_config, db):
def sentry_erasure_test_prep(sentry_connection_config, db):
sentry_secrets = sentry_connection_config.secrets
# Set the assignedTo field on a sentry issue to a given employee
token = sentry_secrets.get("erasure_access_token")
issue_url = sentry_secrets.get("issue_url")
Expand Down Expand Up @@ -235,11 +236,11 @@ def sentry_erasure_test_prep(sentry_secrets, sentry_connection_config, db):
@pytest.mark.integration_saas
@pytest.mark.integration_sentry
def test_sentry_saas_erasure_request_task(
db, policy, sentry_connection_config, sentry_dataset_config, sentry_secrets
db, policy, sentry_connection_config, sentry_dataset_config
) -> None:
"""Full erasure request based on the Sentry SaaS config. Also verifies issue data in access request"""
erasure_email, issue_url, headers = sentry_erasure_test_prep(
sentry_secrets, sentry_connection_config, db
sentry_connection_config, db
)

privacy_request = PrivacyRequest(
Expand Down

0 comments on commit dc34a14

Please sign in to comment.