Persist configurable connectivity diagnostics
Build and Deploy Gateway / build-and-push (push) Successful in 21s
Build and Deploy Gateway / deploy (push) Successful in 14s

This commit is contained in:
2026-08-19 13:38:19 +03:00
parent df865fbe3d
commit 416b2b294a
22 changed files with 407 additions and 131 deletions
+8 -3
View File
@@ -74,7 +74,7 @@ test('schema v2 state migrates built-in .ru into a normal enabled rule', (t) =>
assert.equal(JSON.parse(fs.readFileSync(filePath, 'utf8')).schemaVersion, STATE_SCHEMA_VERSION);
});
test('schema v5 migrates saved and applied rules to v6 with an exact backup', (t) => {
test('schema v5 migrates rules and diagnostics settings with an exact backup', (t) => {
const filePath = fixture(t);
const legacy = {
schemaVersion: 5,
@@ -97,7 +97,12 @@ test('schema v5 migrates saved and applied rules to v6 with an exact backup', (t
});
const migrated = store.read();
assert.equal(migrated.schemaVersion, 6);
assert.equal(migrated.schemaVersion, STATE_SCHEMA_VERSION);
assert.deepEqual(migrated.diagnostics, {
configured: false,
customServices: [],
hiddenServiceIds: [],
});
assert.equal(migrated.routeRulesRevision, 7);
assert.deepEqual(migrated.routeRules.map(({ outbound }) => outbound), ['direct', 'direct']);
assert.deepEqual(migrated.appliedRouteRules.map(({ type, outbound }) => [type, outbound]), [
@@ -105,7 +110,7 @@ test('schema v5 migrates saved and applied rules to v6 with an exact backup', (t
['domain', 'direct'],
]);
assert.equal(store.migration.fromVersion, 5);
assert.equal(store.migration.toVersion, 6);
assert.equal(store.migration.toVersion, STATE_SCHEMA_VERSION);
assert.match(store.migration.backupPath, /\.backup-v5-/);
assert.equal(fs.readFileSync(store.migration.backupPath, 'utf8'), bytes);
});