mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-20 16:07:11 +08:00
fix(ql3): classify retained legacy target tables
This commit is contained in:
@@ -93,6 +93,8 @@ function legacyDomain(name: string): LocalReconciliationPlanDomain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function targetDomain(name: string): LocalReconciliationPlanDomain {
|
function targetDomain(name: string): LocalReconciliationPlanDomain {
|
||||||
|
const retainedLegacyDomain = legacyDomain(name);
|
||||||
|
if (retainedLegacyDomain !== 'unknown') return retainedLegacyDomain;
|
||||||
if (name === 'QingLong3SchemaCapabilities' || name.includes('Migration')) {
|
if (name === 'QingLong3SchemaCapabilities' || name.includes('Migration')) {
|
||||||
return 'schema_lineage';
|
return 'schema_lineage';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,13 +5,28 @@ const {
|
|||||||
classifyLocalReconciliationFact,
|
classifyLocalReconciliationFact,
|
||||||
} = require('../dist/deployment/reconciliation/planning/inventory.js');
|
} = require('../dist/deployment/reconciliation/planning/inventory.js');
|
||||||
|
|
||||||
test('classifies Legacy runtime instances as preserved run history', () => {
|
test('classifies known Legacy tables in source and adopted target inventories', () => {
|
||||||
assert.equal(
|
const knownLegacyTables = new Map([
|
||||||
classifyLocalReconciliationFact('legacy', 'RunningInstances'),
|
['Crontabs', 'automation'],
|
||||||
'run_history',
|
['CrontabViews', 'automation'],
|
||||||
);
|
['Subscriptions', 'automation'],
|
||||||
|
['Envs', 'secret_and_config'],
|
||||||
|
['Auths', 'identity_policy_audit'],
|
||||||
|
['Dependences', 'plugin_package'],
|
||||||
|
['Apps', 'plugin_package'],
|
||||||
|
['CrontabStats', 'run_history'],
|
||||||
|
['RunningInstances', 'run_history'],
|
||||||
|
]);
|
||||||
|
for (const [tableName, domain] of knownLegacyTables) {
|
||||||
|
assert.equal(classifyLocalReconciliationFact('legacy', tableName), domain);
|
||||||
|
assert.equal(classifyLocalReconciliationFact('target', tableName), domain);
|
||||||
|
}
|
||||||
assert.equal(
|
assert.equal(
|
||||||
classifyLocalReconciliationFact('legacy', 'PluginOwnedState'),
|
classifyLocalReconciliationFact('legacy', 'PluginOwnedState'),
|
||||||
'unknown',
|
'unknown',
|
||||||
);
|
);
|
||||||
|
assert.equal(
|
||||||
|
classifyLocalReconciliationFact('target', 'PluginOwnedState'),
|
||||||
|
'unknown',
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user