Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #14331 - Add Test Case Incident Manager Migration #14386

Merged
merged 14 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,17 @@ SET json = REPLACE(json, '"customMetricsProfile"', '"customMetrics"');

-- Delete customMetricsProfile from entity_extension
-- This was not supported on the processing side before 1.3.
DELETE FROM openmetadata_db.entity_extension ee
where extension like '%customMetrics';
DELETE FROM entity_extension ee
where extension like '%customMetrics';

-- BEGIN: Incident Manager Migration
-- STEP 1: Update test case testCaseResult.testCaseFailureStatus field
UPDATE test_case
SET json = JSON_REMOVE(json, '$.testCaseResult.testCaseFailureStatus')
WHERE json -> '$.testCaseResult.testCaseFailureStatus' IS NOT NULL;


-- STEP 2: remove all `testCaseFailureStatus` field in test results
UPDATE data_quality_data_time_series d
SET json = JSON_REMOVE(json, '$.testCaseFailureStatus');
-- END: Incident Manager Migration
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,13 @@ SET json = REPLACE(json::text, '"customMetricsProfile"', '"customMetrics"')::jso
-- Delete customMetricsProfile from entity_extension
-- This was not supported on the processing side before 1.3.
DELETE FROM entity_extension ee
where extension like '%customMetrics';
where extension like '%customMetrics';

-- BEGIN: Incident Manager Migration
-- STEP 1: Update test case testCaseResult.testCaseFailureStatus field
UPDATE test_case
SET json = json::jsonb#-'{testCaseResult,testCaseFailureStatus}';
-- STEP 2: remove all `testCaseFailureStatus` field in test results
UPDATE data_quality_data_time_series d
SET json = json::jsonb#-'{testCaseFailureStatus}';
-- END: Incident Manager Migration
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public TestCaseResolutionStatus createNewRecord(
TestCaseResolutionStatus recordEntity, String extension, String recordFQN) {
TestCaseResolutionStatus latestTestCaseFailure =
getLatestRecord(recordEntity.getTestCaseReference().getFullyQualifiedName());

recordEntity.setStateId(
((latestTestCaseFailure != null)
&& (latestTestCaseFailure.getTestCaseResolutionStatusType()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,7 @@ public void assertFieldChange(String fieldName, Object expected, Object actual)
}
}

private ResultList<TestCaseResolutionStatus> getTestCaseFailureStatus(
public ResultList<TestCaseResolutionStatus> getTestCaseFailureStatus(
Long startTs,
Long endTs,
String assignee,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@
"description": "Reference to the failure status object for the test case result.",
"$ref": "./testCaseResolutionStatus.json"
}
},
"additionalProperties": false
}
},
"testSuiteExecutionFrequency": {
"description": "How often the test case should run.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
"$ref": "../type/entityReference.json"
}
},
"required": ["testCaseFailureReason", "resolvedBy", "testCaseFailureComment"],
"required": ["testCaseFailureReason", "testCaseFailureComment"],
"additionalProperties": false
}
Loading