test: Asterisk upgrade check
verified.ts records what the code relies on Asterisk doing and the version it was measured on; pnpm test fails while the Dockerfile pins another one. pnpm test:asterisk-upgrade boots the image next to a TLS provider and lists every behaviour that moved and what depends on it.
This commit is contained in:
1 parent
678d45e4f9
commit
a0121d4975
5 files changed
+416
-1
No files matched your search
@@ -0,0 +1,26 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
// A new Asterisk in asterisk/Dockerfile must go through the upgrade check first (verified.ts).
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { VERIFIED_ASTERISK, pinnedAsterisk } from './asterisk/verified.ts';
|
||||
|
||||
describe('the pinned Asterisk', () => {
|
||||
it('is the version the upgrade check last passed on', () => {
|
||||
expect(
|
||||
pinnedAsterisk(),
|
||||
`asterisk/Dockerfile pins ${pinnedAsterisk()}, the upgrade check last passed on ` +
|
||||
`${VERIFIED_ASTERISK}. Build the image, run \`pnpm test:asterisk-upgrade\` and ` +
|
||||
'`pnpm test:asterisk`, act on what moved, then set VERIFIED_ASTERISK in ' +
|
||||
'apps/api/test/asterisk/verified.ts',
|
||||
).toBe(VERIFIED_ASTERISK);
|
||||
});
|
||||
|
||||
it('is the one spec 01 §2 names', () => {
|
||||
const spec = readFileSync(
|
||||
new URL('../../../docs/spec/01-infrastructure.md', import.meta.url),
|
||||
'utf8',
|
||||
);
|
||||
expect(spec).toContain(`**Pinned: \`${pinnedAsterisk()}\``);
|
||||
expect(spec).toContain(`ARG ASTERISK_VERSION=${pinnedAsterisk()}`);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user