fix: expose migration start evidence
This commit is contained in:
@@ -753,6 +753,7 @@ test("v03 render keeps node identity as data instead of generated structure", as
|
|||||||
CLOUD_CORE_MIGRATIONS.map((migration) => path.basename(migration.path))
|
CLOUD_CORE_MIGRATIONS.map((migration) => path.basename(migration.path))
|
||||||
);
|
);
|
||||||
assert.match(externalPostgresMigrationConfig?.data?.["run.mjs"] ?? "", /DATABASE_URL is required/u);
|
assert.match(externalPostgresMigrationConfig?.data?.["run.mjs"] ?? "", /DATABASE_URL is required/u);
|
||||||
|
assert.match(externalPostgresMigrationConfig?.data?.["run.mjs"] ?? "", /hwlab-runtime-migration-started/u);
|
||||||
assert.equal(externalPostgresMigrationConfig?.metadata?.annotations?.["argocd.argoproj.io/sync-wave"], "-2");
|
assert.equal(externalPostgresMigrationConfig?.metadata?.annotations?.["argocd.argoproj.io/sync-wave"], "-2");
|
||||||
assert.equal(externalPostgresMigrationJob?.metadata?.annotations?.["argocd.argoproj.io/sync-wave"], "-1");
|
assert.equal(externalPostgresMigrationJob?.metadata?.annotations?.["argocd.argoproj.io/sync-wave"], "-1");
|
||||||
assert.equal(
|
assert.equal(
|
||||||
|
|||||||
@@ -866,6 +866,7 @@ function externalPostgresMigrationRunner() {
|
|||||||
'const files = (await readdir(root)).filter((name) => /^\\d+_.*\\.sql$/u.test(name)).sort();',
|
'const files = (await readdir(root)).filter((name) => /^\\d+_.*\\.sql$/u.test(name)).sort();',
|
||||||
'const connectionString = process.env.DATABASE_URL;',
|
'const connectionString = process.env.DATABASE_URL;',
|
||||||
'if (!connectionString) throw new Error("DATABASE_URL is required");',
|
'if (!connectionString) throw new Error("DATABASE_URL is required");',
|
||||||
|
'console.error(JSON.stringify({ event: "hwlab-runtime-migration-started", fileCount: files.length, valuesPrinted: false }));',
|
||||||
'const pool = new Pool({ connectionString, max: 1 });',
|
'const pool = new Pool({ connectionString, max: 1 });',
|
||||||
'try {',
|
'try {',
|
||||||
' for (const file of files) {',
|
' for (const file of files) {',
|
||||||
|
|||||||
Reference in New Issue
Block a user