Skip to content

Commit

Permalink
updated preset golden tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PeteMango committed Mar 3, 2025
1 parent 4cf9613 commit 83e553c
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"customProperties": {
"Status": "published",
"IsPublished": "true",
"Owners": "test_username_1, test_username_2",
"Owners": "unknown",
"IsCertified": "true",
"CertifiedBy": "Certification team",
"CertificationDetails": "Approved"
Expand All @@ -39,6 +39,21 @@
},
"dashboardUrl": "mock://mock-domain.preset.io/dashboard/test_dashboard_url_1"
}
},
{
"com.linkedin.pegasus2avro.common.Ownership": {
"owners": [
{
"owner": "urn:li:corpuser:test_owner1@example.com",
"type": "TECHNICAL_OWNER"
}
],
"ownerTypes": {},
"lastModified": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
}
}
}
]
}
Expand Down Expand Up @@ -87,6 +102,21 @@
},
"dashboardUrl": "mock://mock-domain.preset.io/dashboard/test_dashboard_url_2"
}
},
{
"com.linkedin.pegasus2avro.common.Ownership": {
"owners": [
{
"owner": "urn:li:corpuser:test_owner1@example.com",
"type": "TECHNICAL_OWNER"
}
],
"ownerTypes": {},
"lastModified": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
}
}
}
]
}
Expand Down Expand Up @@ -134,6 +164,16 @@
],
"type": "BAR"
}
},
{
"com.linkedin.pegasus2avro.common.Ownership": {
"owners": [],
"ownerTypes": {},
"lastModified": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
}
}
}
]
}
Expand Down Expand Up @@ -181,6 +221,16 @@
],
"type": "PIE"
}
},
{
"com.linkedin.pegasus2avro.common.Ownership": {
"owners": [],
"ownerTypes": {},
"lastModified": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
}
}
}
]
}
Expand Down Expand Up @@ -228,6 +278,16 @@
],
"type": "AREA"
}
},
{
"com.linkedin.pegasus2avro.common.Ownership": {
"owners": [],
"ownerTypes": {},
"lastModified": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
}
}
}
]
}
Expand Down Expand Up @@ -275,6 +335,16 @@
],
"type": "HISTOGRAM"
}
},
{
"com.linkedin.pegasus2avro.common.Ownership": {
"owners": [],
"ownerTypes": {},
"lastModified": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
}
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"customProperties": {
"Status": "published",
"IsPublished": "true",
"Owners": "test_username_1, test_username_2",
"Owners": "unknown",
"IsCertified": "true",
"CertifiedBy": "Certification team",
"CertificationDetails": "Approved"
Expand All @@ -39,13 +39,28 @@
},
"dashboardUrl": "mock://mock-domain.preset.io/dashboard/test_dashboard_url_1"
}
},
{
"com.linkedin.pegasus2avro.common.Ownership": {
"owners": [
{
"owner": "urn:li:corpuser:test_owner1@example.com",
"type": "TECHNICAL_OWNER"
}
],
"ownerTypes": {},
"lastModified": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
}
}
}
]
}
},
"systemMetadata": {
"lastObserved": 1720594800000,
"runId": "preset-2024_07_10-07_00_00-xe6j8e",
"runId": "preset-2024_07_10-07_00_00-p4x3vy",
"lastRunId": "no-run-id-provided",
"pipelineName": "test_pipeline"
}
Expand Down Expand Up @@ -87,13 +102,23 @@
],
"type": "BAR"
}
},
{
"com.linkedin.pegasus2avro.common.Ownership": {
"owners": [],
"ownerTypes": {},
"lastModified": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
}
}
}
]
}
},
"systemMetadata": {
"lastObserved": 1720594800000,
"runId": "preset-2024_07_10-07_00_00-xe6j8e",
"runId": "preset-2024_07_10-07_00_00-p4x3vy",
"lastRunId": "no-run-id-provided",
"pipelineName": "test_pipeline"
}
Expand Down Expand Up @@ -135,13 +160,23 @@
],
"type": "PIE"
}
},
{
"com.linkedin.pegasus2avro.common.Ownership": {
"owners": [],
"ownerTypes": {},
"lastModified": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
}
}
}
]
}
},
"systemMetadata": {
"lastObserved": 1720594800000,
"runId": "preset-2024_07_10-07_00_00-xe6j8e",
"runId": "preset-2024_07_10-07_00_00-p4x3vy",
"lastRunId": "no-run-id-provided",
"pipelineName": "test_pipeline"
}
Expand Down Expand Up @@ -183,13 +218,23 @@
],
"type": "AREA"
}
},
{
"com.linkedin.pegasus2avro.common.Ownership": {
"owners": [],
"ownerTypes": {},
"lastModified": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
}
}
}
]
}
},
"systemMetadata": {
"lastObserved": 1720594800000,
"runId": "preset-2024_07_10-07_00_00-xe6j8e",
"runId": "preset-2024_07_10-07_00_00-p4x3vy",
"lastRunId": "no-run-id-provided",
"pipelineName": "test_pipeline"
}
Expand Down Expand Up @@ -231,13 +276,23 @@
],
"type": "HISTOGRAM"
}
},
{
"com.linkedin.pegasus2avro.common.Ownership": {
"owners": [],
"ownerTypes": {},
"lastModified": {
"time": 0,
"actor": "urn:li:corpuser:unknown"
}
}
}
]
}
},
"systemMetadata": {
"lastObserved": 1720594800000,
"runId": "preset-2024_07_10-07_00_00-xe6j8e",
"runId": "preset-2024_07_10-07_00_00-p4x3vy",
"lastRunId": "no-run-id-provided",
"pipelineName": "test_pipeline"
}
Expand All @@ -254,7 +309,7 @@
},
"systemMetadata": {
"lastObserved": 1720594800000,
"runId": "preset-2024_07_10-07_00_00-xe6j8e",
"runId": "preset-2024_07_10-07_00_00-p4x3vy",
"lastRunId": "no-run-id-provided",
"pipelineName": "test_pipeline"
}
Expand Down
75 changes: 60 additions & 15 deletions metadata-ingestion/tests/integration/preset/test_preset.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,7 @@ def register_mock_api(request_mock: Any, override_data: Optional[dict] = None) -
"status": "published",
"published": True,
"owners": [
{
"username": "test_username_1",
},
{
"username": "test_username_2",
},
{"first_name": "Test", "id": 1, "last_name": "Owner1"}
],
"certified_by": "Certification team",
"certification_details": "Approved",
Expand All @@ -91,9 +86,7 @@ def register_mock_api(request_mock: Any, override_data: Optional[dict] = None) -
"status": "draft",
"published": False,
"owners": [
{
"first_name": "name",
},
{"first_name": "Test", "id": 1, "last_name": "Owner1"}
],
"certified_by": "",
"certification_details": "",
Expand Down Expand Up @@ -181,6 +174,63 @@ def register_mock_api(request_mock: Any, override_data: Optional[dict] = None) -
},
},
},
"mock://mock-domain.preset.io/api/v1/dashboard/related/owners": {
"method": "GET",
"status_code": 200,
"json": {
"count": 2,
"result": [
{
"extra": {"active": True, "email": "test_owner1@example.com"},
"text": "test_owner1",
"value": 1,
},
{
"extra": {"active": True, "email": "test_owner2@example.com"},
"text": "test_owner2",
"value": 2,
},
],
},
},
"mock://mock-domain.preset.io/api/v1/dataset/related/owners": {
"method": "GET",
"status_code": 200,
"json": {
"count": 2,
"result": [
{
"extra": {"active": True, "email": "test_owner3@example.com"},
"text": "test_owner3",
"value": 3,
},
{
"extra": {"active": True, "email": "test_owner4@example.com"},
"text": "test_owner4",
"value": 4,
},
],
},
},
"mock://mock-domain.preset.io/api/v1/chart/related/owners": {
"method": "GET",
"status_code": 200,
"json": {
"count": 2,
"result": [
{
"extra": {"active": True, "email": "test_owner5@example.com"},
"text": "test_owner5",
"value": 5,
},
{
"extra": {"active": True, "email": "test_owner6@example.com"},
"text": "test_owner6",
"value": 6,
},
],
},
},
}

api_vs_response.update(override_data)
Expand Down Expand Up @@ -290,12 +340,7 @@ def test_preset_stateful_ingest(
"status": "published",
"published": True,
"owners": [
{
"username": "test_username_1",
},
{
"username": "test_username_2",
},
{"first_name": "Test", "id": 1, "last_name": "Owner1"}
],
"certified_by": "Certification team",
"certification_details": "Approved",
Expand Down

0 comments on commit 83e553c

Please sign in to comment.