mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-24 04:58:37 +08:00
fix(ci): bind recovery evidence to migration stream
This commit is contained in:
@@ -4,8 +4,12 @@
|
|||||||
|
|
||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
|
const {
|
||||||
|
postgresqlMainMigrationStream,
|
||||||
|
} = require('../packages/ql3-cluster-postgres/dist/migration/migration.js');
|
||||||
|
|
||||||
const FIXTURE = 'qinglong/plugin-package-recovery-e2e-live-contract@v3';
|
const FIXTURE = 'qinglong/plugin-package-recovery-e2e-live-contract@v3';
|
||||||
|
const MIGRATION_COUNT = postgresqlMainMigrationStream.migrations.length;
|
||||||
const LIMITATIONS = Object.freeze([
|
const LIMITATIONS = Object.freeze([
|
||||||
'isolated PostgreSQL uses explicit TLS disable; production manifests remain verify-full',
|
'isolated PostgreSQL uses explicit TLS disable; production manifests remain verify-full',
|
||||||
'the authenticated HTTPS OCI Distribution fixture implements the immutable GET/referrers surface used by the resolver, not a production registry storage implementation',
|
'the authenticated HTTPS OCI Distribution fixture implements the immutable GET/referrers surface used by the resolver, not a production registry storage implementation',
|
||||||
@@ -269,7 +273,7 @@ function validatePluginPackageRecoveryE2ELiveReport(report) {
|
|||||||
];
|
];
|
||||||
if (
|
if (
|
||||||
!exactKeys(database, databaseKeys) ||
|
!exactKeys(database, databaseKeys) ||
|
||||||
database?.migrationCount !== 65 ||
|
database?.migrationCount !== MIGRATION_COUNT ||
|
||||||
database?.capabilityVersion !== 64 ||
|
database?.capabilityVersion !== 64 ||
|
||||||
database?.initialState !== 'active' ||
|
database?.initialState !== 'active' ||
|
||||||
database?.upgradeState !== 'failed' ||
|
database?.upgradeState !== 'failed' ||
|
||||||
@@ -487,6 +491,7 @@ module.exports = {
|
|||||||
FIXTURE,
|
FIXTURE,
|
||||||
GATE_KEYS,
|
GATE_KEYS,
|
||||||
LIMITATIONS,
|
LIMITATIONS,
|
||||||
|
MIGRATION_COUNT,
|
||||||
readPrivateReport,
|
readPrivateReport,
|
||||||
validatePluginPackageRecoveryE2ELiveReport,
|
validatePluginPackageRecoveryE2ELiveReport,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ const {
|
|||||||
REGISTRY_EVENT_SCHEMA,
|
REGISTRY_EVENT_SCHEMA,
|
||||||
createFixture,
|
createFixture,
|
||||||
} = require('./ql3-plugin-package-recovery-e2e-fixture.cjs');
|
} = require('./ql3-plugin-package-recovery-e2e-fixture.cjs');
|
||||||
|
const {
|
||||||
|
MIGRATION_COUNT,
|
||||||
|
} = require('./ql3-plugin-package-recovery-e2e-live-audit.cjs');
|
||||||
|
|
||||||
const ROOT = path.resolve(__dirname, '..');
|
const ROOT = path.resolve(__dirname, '..');
|
||||||
const FIXTURE_SCRIPT = path.join(
|
const FIXTURE_SCRIPT = path.join(
|
||||||
@@ -1283,7 +1286,7 @@ SELECT json_build_object(
|
|||||||
{ capture: true, quiet: true },
|
{ capture: true, quiet: true },
|
||||||
).stdout;
|
).stdout;
|
||||||
const value = JSON.parse(output);
|
const value = JSON.parse(output);
|
||||||
assert.equal(value.migrationCount, 65);
|
assert.equal(value.migrationCount, MIGRATION_COUNT);
|
||||||
assert.equal(value.capabilityVersion, 64);
|
assert.equal(value.capabilityVersion, 64);
|
||||||
assert.equal(value.initialState, 'active');
|
assert.equal(value.initialState, 'active');
|
||||||
assert.equal(value.initialActiveLockDigest, fixture.initial.lock.lockDigest);
|
assert.equal(value.initialActiveLockDigest, fixture.initial.lock.lockDigest);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ const producerPath = path.join(
|
|||||||
const {
|
const {
|
||||||
FIXTURE,
|
FIXTURE,
|
||||||
GATE_KEYS,
|
GATE_KEYS,
|
||||||
|
MIGRATION_COUNT,
|
||||||
readPrivateReport,
|
readPrivateReport,
|
||||||
validatePluginPackageRecoveryE2ELiveReport,
|
validatePluginPackageRecoveryE2ELiveReport,
|
||||||
} = require('../../scripts/ql3-plugin-package-recovery-e2e-live-audit.cjs');
|
} = require('../../scripts/ql3-plugin-package-recovery-e2e-live-audit.cjs');
|
||||||
@@ -62,7 +63,7 @@ function validReport() {
|
|||||||
activePointerUnchanged: true,
|
activePointerUnchanged: true,
|
||||||
},
|
},
|
||||||
database: {
|
database: {
|
||||||
migrationCount: 65,
|
migrationCount: MIGRATION_COUNT,
|
||||||
capabilityVersion: 64,
|
capabilityVersion: 64,
|
||||||
initialState: 'active',
|
initialState: 'active',
|
||||||
initialActiveLockDigest: lock,
|
initialActiveLockDigest: lock,
|
||||||
|
|||||||
@@ -6,6 +6,12 @@ const yaml = require('js-yaml');
|
|||||||
const {
|
const {
|
||||||
createFixture,
|
createFixture,
|
||||||
} = require('../../scripts/ql3-plugin-package-recovery-e2e-fixture.cjs');
|
} = require('../../scripts/ql3-plugin-package-recovery-e2e-fixture.cjs');
|
||||||
|
const {
|
||||||
|
MIGRATION_COUNT,
|
||||||
|
} = require('../../scripts/ql3-plugin-package-recovery-e2e-live-audit.cjs');
|
||||||
|
const {
|
||||||
|
postgresqlMainMigrationStream,
|
||||||
|
} = require('../../packages/ql3-cluster-postgres/dist/migration/migration.js');
|
||||||
|
|
||||||
const root = path.resolve(__dirname, '../..');
|
const root = path.resolve(__dirname, '../..');
|
||||||
const livePath = path.join(
|
const livePath = path.join(
|
||||||
@@ -56,6 +62,10 @@ test('fixture uses a real HTTPS and content-addressed OCI Distribution surface',
|
|||||||
assert.match(live, /requestCount: packageRequests\.length/);
|
assert.match(live, /requestCount: packageRequests\.length/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('report migration evidence follows the complete PostgreSQL stream', () => {
|
||||||
|
assert.equal(MIGRATION_COUNT, postgresqlMainMigrationStream.migrations.length);
|
||||||
|
});
|
||||||
|
|
||||||
test('fixture locks are bound to durable version-three approval dispatches', () => {
|
test('fixture locks are bound to durable version-three approval dispatches', () => {
|
||||||
const value = createFixture({
|
const value = createFixture({
|
||||||
registry: 'registry.fixture.test',
|
registry: 'registry.fixture.test',
|
||||||
@@ -116,7 +126,7 @@ test('gate runs migration, healthy activation and a durable rejected upgrade', (
|
|||||||
assert.doesNotMatch(fixture, /commit-transition/);
|
assert.doesNotMatch(fixture, /commit-transition/);
|
||||||
assert.match(live, /initialSeed\.state, 'queued'/);
|
assert.match(live, /initialSeed\.state, 'queued'/);
|
||||||
assert.match(live, /upgradeSeed\.state, 'queued'/);
|
assert.match(live, /upgradeSeed\.state, 'queued'/);
|
||||||
assert.match(live, /value\.migrationCount, 65/);
|
assert.match(live, /value\.migrationCount, MIGRATION_COUNT/);
|
||||||
assert.match(live, /value\.capabilityVersion, 64/);
|
assert.match(live, /value\.capabilityVersion, 64/);
|
||||||
assert.match(live, /postgresEnvironment\(\s*'PACKAGE_EXECUTOR'/);
|
assert.match(live, /postgresEnvironment\(\s*'PACKAGE_EXECUTOR'/);
|
||||||
assert.match(fixture, /assertPostgresPackageExecutorSchemaReady/);
|
assert.match(fixture, /assertPostgresPackageExecutorSchemaReady/);
|
||||||
|
|||||||
Reference in New Issue
Block a user