24 lines
1.1 KiB
JavaScript
24 lines
1.1 KiB
JavaScript
/**
|
|
* Aligns seeder env (`BARE_OS_SEED_*`) with booter `/proc` operator JSON builder.
|
|
*/
|
|
import assert from 'node:assert'
|
|
import test from 'node:test'
|
|
import { buildBareOsReplicationOperatorSurfaceProcJson } from '../../bare-os-booter/lib/proc/bare-os-proc-replication-operator-surface.js'
|
|
import { buildSeederSnapshotHintsJson } from '../lib/build-seeder-snapshot-hints-json.js'
|
|
|
|
test('corestore_snapshot proc JSON matches seeder snapshot hints env', () => {
|
|
const env = {
|
|
BARE_OS_SEED_CORESTORE_SNAPSHOT_TAG: 'rel-9',
|
|
BARE_OS_SEED_SNAPSHOT_HINTS_JSON: buildSeederSnapshotHintsJson({
|
|
BARE_OS_SEED_CORESTORE_SNAPSHOT_TAG: 'rel-9'
|
|
})
|
|
}
|
|
const hints = JSON.parse(env.BARE_OS_SEED_SNAPSHOT_HINTS_JSON)
|
|
const proc = buildBareOsReplicationOperatorSurfaceProcJson('corestore_snapshot', env)
|
|
assert.strictEqual(proc.schema, 2)
|
|
assert.strictEqual(proc.snapshotTag, 'rel-9')
|
|
assert.ok(proc.snapshotHintsJson)
|
|
assert.strictEqual(proc.snapshotHintsJson.schema, hints.schema)
|
|
assert.strictEqual(proc.snapshotHintsJson.corestoreSnapshotTag, 'rel-9')
|
|
})
|