fix(server): backup version checks not handling database versions correctly (#14102)

This commit is contained in:
Zack Pollard 2024-11-12 16:57:05 +00:00 committed by GitHub
parent 2f9019c0e1
commit e17bd8efc6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View file

@ -149,7 +149,6 @@ describe(BackupService.name, () => {
storageMock.unlink.mockResolvedValue();
systemMock.get.mockResolvedValue(systemConfigStub.backupEnabled);
storageMock.createWriteStream.mockReturnValue(new PassThrough());
databaseMock.getPostgresVersion.mockResolvedValue('14.3.2');
});
it('should run a database backup successfully', async () => {
const result = await sut.handleBackupDatabase();
@ -198,11 +197,13 @@ describe(BackupService.name, () => {
expect(result).toBe(JobStatus.FAILED);
});
it.each`
postgresVersion | expectedVersion
${'14.6.4'} | ${14}
${'15.3.3'} | ${15}
${'16.4.2'} | ${16}
${'17.15.1'} | ${17}
postgresVersion | expectedVersion
${'14.10'} | ${14}
${'14.10.3'} | ${14}
${'14.10 (Debian 14.10-1.pgdg120+1)'} | ${14}
${'15.3.3'} | ${15}
${'16.4.2'} | ${16}
${'17.15.1'} | ${17}
`(
`should use pg_dumpall $expectedVersion with postgres version $postgresVersion`,
async ({ postgresVersion, expectedVersion }) => {