Update Harbor client and gateway integration workflows
This commit is contained in:
@@ -115,6 +115,39 @@ test('schema v5 migrates rules and diagnostics settings with an exact backup', (
|
||||
assert.equal(fs.readFileSync(store.migration.backupPath, 'utf8'), bytes);
|
||||
});
|
||||
|
||||
test('schema v7 migrates failover disabled without losing canonical state', (t) => {
|
||||
const filePath = fixture(t);
|
||||
const legacy = {
|
||||
schemaVersion: 7,
|
||||
revision: 19,
|
||||
profiles: [],
|
||||
desiredProfileId: '',
|
||||
appliedProfileId: '',
|
||||
appliedServerId: '',
|
||||
appliedServerSnapshot: null,
|
||||
routeRules: [],
|
||||
appliedRouteRules: [],
|
||||
routeRulesRevision: 4,
|
||||
diagnostics: { configured: true, customServices: [], hiddenServiceIds: ['google'] },
|
||||
};
|
||||
fs.writeFileSync(filePath, JSON.stringify(legacy));
|
||||
|
||||
const store = createStateStore(filePath, {
|
||||
now: () => new Date('2026-08-19T12:00:00.000Z'),
|
||||
});
|
||||
const migrated = store.read();
|
||||
|
||||
assert.equal(migrated.schemaVersion, 8);
|
||||
assert.equal(migrated.revision, 19);
|
||||
assert.equal(migrated.routeRulesRevision, 4);
|
||||
assert.equal(migrated.failoverPolicy.enabled, false);
|
||||
assert.equal(migrated.failoverRuntimeState.lastSwitchAt, null);
|
||||
assert.equal(migrated.appliedFailoverPolicy, null);
|
||||
assert.deepEqual(migrated.diagnostics.hiddenServiceIds, ['google']);
|
||||
assert.equal(store.migration.fromVersion, 7);
|
||||
assert.deepEqual(JSON.parse(fs.readFileSync(store.migration.backupPath, 'utf8')), legacy);
|
||||
});
|
||||
|
||||
test('schema v6 rejects missing or unknown outbound without rewriting source bytes', (t) => {
|
||||
for (const [name, rule] of [
|
||||
['missing', { type: 'domain', value: 'example.com', enabled: true }],
|
||||
|
||||
Reference in New Issue
Block a user