diff --git a/scripts/ql3-plugin-package-recovery-e2e-live-audit.cjs b/scripts/ql3-plugin-package-recovery-e2e-live-audit.cjs index 6c7c5c23..1e7ba9aa 100644 --- a/scripts/ql3-plugin-package-recovery-e2e-live-audit.cjs +++ b/scripts/ql3-plugin-package-recovery-e2e-live-audit.cjs @@ -4,8 +4,12 @@ const fs = require('node:fs'); 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 MIGRATION_COUNT = postgresqlMainMigrationStream.migrations.length; const LIMITATIONS = Object.freeze([ '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', @@ -269,7 +273,7 @@ function validatePluginPackageRecoveryE2ELiveReport(report) { ]; if ( !exactKeys(database, databaseKeys) || - database?.migrationCount !== 65 || + database?.migrationCount !== MIGRATION_COUNT || database?.capabilityVersion !== 64 || database?.initialState !== 'active' || database?.upgradeState !== 'failed' || @@ -487,6 +491,7 @@ module.exports = { FIXTURE, GATE_KEYS, LIMITATIONS, + MIGRATION_COUNT, readPrivateReport, validatePluginPackageRecoveryE2ELiveReport, }; diff --git a/scripts/ql3-plugin-package-recovery-e2e-live-contract.cjs b/scripts/ql3-plugin-package-recovery-e2e-live-contract.cjs index 6cf41f88..09ce2464 100644 --- a/scripts/ql3-plugin-package-recovery-e2e-live-contract.cjs +++ b/scripts/ql3-plugin-package-recovery-e2e-live-contract.cjs @@ -14,6 +14,9 @@ const { REGISTRY_EVENT_SCHEMA, createFixture, } = 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 FIXTURE_SCRIPT = path.join( @@ -1283,7 +1286,7 @@ SELECT json_build_object( { capture: true, quiet: true }, ).stdout; const value = JSON.parse(output); - assert.equal(value.migrationCount, 65); + assert.equal(value.migrationCount, MIGRATION_COUNT); assert.equal(value.capabilityVersion, 64); assert.equal(value.initialState, 'active'); assert.equal(value.initialActiveLockDigest, fixture.initial.lock.lockDigest); diff --git a/test/back/ql3PluginPackageRecoveryE2ELiveAudit.test.cjs b/test/back/ql3PluginPackageRecoveryE2ELiveAudit.test.cjs index 23eb35b7..da0ba205 100644 --- a/test/back/ql3PluginPackageRecoveryE2ELiveAudit.test.cjs +++ b/test/back/ql3PluginPackageRecoveryE2ELiveAudit.test.cjs @@ -13,6 +13,7 @@ const producerPath = path.join( const { FIXTURE, GATE_KEYS, + MIGRATION_COUNT, readPrivateReport, validatePluginPackageRecoveryE2ELiveReport, } = require('../../scripts/ql3-plugin-package-recovery-e2e-live-audit.cjs'); @@ -62,7 +63,7 @@ function validReport() { activePointerUnchanged: true, }, database: { - migrationCount: 65, + migrationCount: MIGRATION_COUNT, capabilityVersion: 64, initialState: 'active', initialActiveLockDigest: lock, diff --git a/test/back/ql3PluginPackageRecoveryE2ELiveContract.test.cjs b/test/back/ql3PluginPackageRecoveryE2ELiveContract.test.cjs index ed44c8a0..d353250d 100644 --- a/test/back/ql3PluginPackageRecoveryE2ELiveContract.test.cjs +++ b/test/back/ql3PluginPackageRecoveryE2ELiveContract.test.cjs @@ -6,6 +6,12 @@ const yaml = require('js-yaml'); const { createFixture, } = 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 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/); }); +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', () => { const value = createFixture({ 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.match(live, /initialSeed\.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, /postgresEnvironment\(\s*'PACKAGE_EXECUTOR'/); assert.match(fixture, /assertPostgresPackageExecutorSchemaReady/);