Fix postgres 18 TestDatabases by pinning the data dir
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-test-utils': patch
|
||||
---
|
||||
|
||||
Fix PostgreSQL 18 `TestDatabases` by pinning the data directory
|
||||
@@ -46,7 +46,7 @@ describe('TaskWorker', () => {
|
||||
const settings: TaskSettingsV2 = {
|
||||
version: 2,
|
||||
cadence: '*/2 * * * * *',
|
||||
initialDelayDuration: Duration.fromObject({ seconds: 1 }).toISO()!,
|
||||
initialDelayDuration: Duration.fromObject({ seconds: 3 }).toISO()!, // over 1 second, to cover for 1-second granularity in some database timestamps
|
||||
timeoutAfterDuration: Duration.fromObject({ minutes: 1 }).toISO()!,
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@ describe('TaskWorker', () => {
|
||||
expect(JSON.parse(row.settings_json)).toEqual({
|
||||
version: 2,
|
||||
cadence: '*/2 * * * * *',
|
||||
initialDelayDuration: 'PT1S',
|
||||
initialDelayDuration: 'PT3S',
|
||||
timeoutAfterDuration: 'PT1M',
|
||||
});
|
||||
await expect(TaskWorker.taskStates(knex)).resolves.toEqual(
|
||||
@@ -80,6 +80,10 @@ describe('TaskWorker', () => {
|
||||
]),
|
||||
);
|
||||
|
||||
// Note that this is timing sensitive - if things take too long between
|
||||
// persistTask and findReadyTask, this test will fail. We set some margin
|
||||
// of initialDelayDuration to cover for this, but if this turns out to be
|
||||
// flaky, we may have to revisit how this test is written.
|
||||
await expect(worker.findReadyTask()).resolves.toEqual({
|
||||
result: 'not-ready-yet',
|
||||
});
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
"mysql2": "^3.0.0",
|
||||
"pg": "^8.11.3",
|
||||
"pg-connection-string": "^2.3.0",
|
||||
"testcontainers": "^10.0.0",
|
||||
"testcontainers": "^11.9.0",
|
||||
"text-extensions": "^2.4.0",
|
||||
"uuid": "^11.0.0",
|
||||
"yn": "^4.0.0",
|
||||
|
||||
@@ -77,7 +77,11 @@ export async function startPostgresContainer(image: string): Promise<{
|
||||
|
||||
const container = await new GenericContainer(image)
|
||||
.withExposedPorts(5432)
|
||||
.withEnvironment({ POSTGRES_PASSWORD: password })
|
||||
.withEnvironment({
|
||||
// Since postgres 18, the default directory changed - so we pin it here
|
||||
PGDATA: '/var/lib/postgresql/data',
|
||||
POSTGRES_PASSWORD: password,
|
||||
})
|
||||
.withTmpFs({ '/var/lib/postgresql/data': 'rw' })
|
||||
.start();
|
||||
|
||||
|
||||
@@ -3097,7 +3097,7 @@ __metadata:
|
||||
pg: "npm:^8.11.3"
|
||||
pg-connection-string: "npm:^2.3.0"
|
||||
supertest: "npm:^7.0.0"
|
||||
testcontainers: "npm:^10.0.0"
|
||||
testcontainers: "npm:^11.9.0"
|
||||
text-extensions: "npm:^2.4.0"
|
||||
uuid: "npm:^11.0.0"
|
||||
yn: "npm:^4.0.0"
|
||||
@@ -20514,7 +20514,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/dockerode@npm:^3.3.35":
|
||||
"@types/dockerode@npm:^3.3.47":
|
||||
version: 3.3.47
|
||||
resolution: "@types/dockerode@npm:3.3.47"
|
||||
dependencies:
|
||||
@@ -27963,7 +27963,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"debug@npm:4, debug@npm:^4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:^4.3.6, debug@npm:^4.3.7, debug@npm:^4.4.0, debug@npm:^4.4.1":
|
||||
"debug@npm:4, debug@npm:^4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:^4.3.6, debug@npm:^4.3.7, debug@npm:^4.4.0, debug@npm:^4.4.1, debug@npm:^4.4.3":
|
||||
version: 4.4.3
|
||||
resolution: "debug@npm:4.4.3"
|
||||
dependencies:
|
||||
@@ -28560,12 +28560,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"docker-compose@npm:^0.24.8":
|
||||
version: 0.24.8
|
||||
resolution: "docker-compose@npm:0.24.8"
|
||||
"docker-compose@npm:^1.3.0":
|
||||
version: 1.3.0
|
||||
resolution: "docker-compose@npm:1.3.0"
|
||||
dependencies:
|
||||
yaml: "npm:^2.2.2"
|
||||
checksum: 10/2b8526f9797a55c819ff2d7dcea57085b012b3a3d77bc2e1a6b45c3fc9e82196312f5298cbe8299966462454a5ac8f68814bb407736b4385e0d226a2a39e877a
|
||||
checksum: 10/7c1b395fc104031eadef08cac0c028af11fd9e3084265dca9e17bc76ad27c2bfe96d8b74df258bb64b198f9e0f1792a7f2c63123cddc0d60bb776f211d54cfb2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -28581,7 +28581,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"dockerode@npm:^4.0.0, dockerode@npm:^4.0.5":
|
||||
"dockerode@npm:^4.0.0, dockerode@npm:^4.0.9":
|
||||
version: 4.0.9
|
||||
resolution: "dockerode@npm:4.0.9"
|
||||
dependencies:
|
||||
@@ -47185,7 +47185,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tar-fs@npm:^3.0.7, tar-fs@npm:^3.0.9":
|
||||
"tar-fs@npm:^3.0.9, tar-fs@npm:^3.1.1":
|
||||
version: 3.1.1
|
||||
resolution: "tar-fs@npm:3.1.1"
|
||||
dependencies:
|
||||
@@ -47398,26 +47398,26 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"testcontainers@npm:^10.0.0":
|
||||
version: 10.28.0
|
||||
resolution: "testcontainers@npm:10.28.0"
|
||||
"testcontainers@npm:^11.9.0":
|
||||
version: 11.9.0
|
||||
resolution: "testcontainers@npm:11.9.0"
|
||||
dependencies:
|
||||
"@balena/dockerignore": "npm:^1.0.2"
|
||||
"@types/dockerode": "npm:^3.3.35"
|
||||
"@types/dockerode": "npm:^3.3.47"
|
||||
archiver: "npm:^7.0.1"
|
||||
async-lock: "npm:^1.4.1"
|
||||
byline: "npm:^5.0.0"
|
||||
debug: "npm:^4.3.5"
|
||||
docker-compose: "npm:^0.24.8"
|
||||
dockerode: "npm:^4.0.5"
|
||||
debug: "npm:^4.4.3"
|
||||
docker-compose: "npm:^1.3.0"
|
||||
dockerode: "npm:^4.0.9"
|
||||
get-port: "npm:^7.1.0"
|
||||
proper-lockfile: "npm:^4.1.2"
|
||||
properties-reader: "npm:^2.3.0"
|
||||
ssh-remote-port-forward: "npm:^1.0.4"
|
||||
tar-fs: "npm:^3.0.7"
|
||||
tmp: "npm:^0.2.3"
|
||||
undici: "npm:^5.29.0"
|
||||
checksum: 10/434d3677e10a114805420f2420831a8eae4091acdaf242787fb100a8755140af0e11eab3932cdb29267f0869af22d0b572532f72ee5450d60f63f3fed30d098c
|
||||
tar-fs: "npm:^3.1.1"
|
||||
tmp: "npm:^0.2.5"
|
||||
undici: "npm:^7.16.0"
|
||||
checksum: 10/974d729dfd2e511d8623f60629ddfb60446f6c0d0b9f41ac2db279fb94d89f6bc6bf7625734bff33c8d740886c3891cc29bda8f751edc46db6d42ca9212ba9fe
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -47639,10 +47639,10 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tmp@npm:^0.2.3":
|
||||
version: 0.2.3
|
||||
resolution: "tmp@npm:0.2.3"
|
||||
checksum: 10/7b13696787f159c9754793a83aa79a24f1522d47b87462ddb57c18ee93ff26c74cbb2b8d9138f571d2e0e765c728fb2739863a672b280528512c6d83d511c6fa
|
||||
"tmp@npm:^0.2.5":
|
||||
version: 0.2.5
|
||||
resolution: "tmp@npm:0.2.5"
|
||||
checksum: 10/dd4b78b32385eab4899d3ae296007b34482b035b6d73e1201c4a9aede40860e90997a1452c65a2d21aee73d53e93cd167d741c3db4015d90e63b6d568a93d7ec
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -48590,7 +48590,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"undici@npm:^5.28.2, undici@npm:^5.29.0":
|
||||
"undici@npm:^5.28.2":
|
||||
version: 5.29.0
|
||||
resolution: "undici@npm:5.29.0"
|
||||
dependencies:
|
||||
@@ -48599,10 +48599,10 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"undici@npm:^7.2.3":
|
||||
version: 7.9.0
|
||||
resolution: "undici@npm:7.9.0"
|
||||
checksum: 10/fa92d3d9106612be566e79942174e00426c2e1f9a688fb86c8d1809c84a032c02fc57bd601d2051a45d94bbd312c50221644b58c8186c4f0d64f8ecc7f18b806
|
||||
"undici@npm:^7.16.0, undici@npm:^7.2.3":
|
||||
version: 7.16.0
|
||||
resolution: "undici@npm:7.16.0"
|
||||
checksum: 10/2bb71672b23d3dc0f56f1b7fb6c936e4487a350db46eaafc03f2f9107f99cdf8e51ecdd32e589e2381ef47a64b6369cfb31f328b2c3ea663023aa47bc5258b9e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user