mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-22 19:29:13 +08:00
fix(ql3): classify retained legacy target tables
This commit is contained in:
@@ -5,13 +5,28 @@ const {
|
||||
classifyLocalReconciliationFact,
|
||||
} = require('../dist/deployment/reconciliation/planning/inventory.js');
|
||||
|
||||
test('classifies Legacy runtime instances as preserved run history', () => {
|
||||
assert.equal(
|
||||
classifyLocalReconciliationFact('legacy', 'RunningInstances'),
|
||||
'run_history',
|
||||
);
|
||||
test('classifies known Legacy tables in source and adopted target inventories', () => {
|
||||
const knownLegacyTables = new Map([
|
||||
['Crontabs', 'automation'],
|
||||
['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(
|
||||
classifyLocalReconciliationFact('legacy', 'PluginOwnedState'),
|
||||
'unknown',
|
||||
);
|
||||
assert.equal(
|
||||
classifyLocalReconciliationFact('target', 'PluginOwnedState'),
|
||||
'unknown',
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user