Fix release version labels across deployment views

This commit is contained in:
2026-10-17 09:45:53 -04:00
parent b5037a70fe
commit ba9bed6a0d
20 changed files with 485 additions and 39 deletions
+50
View File
@@ -82,12 +82,62 @@ describe('launch recipes and previews', () => {
expect(second.name).toBe(first.name);
expect(second.port).toBe(first.port);
expect(first.recipe.files).toHaveLength(3);
expect(first.recipe.files[0]).toMatchObject({ version: 1, releaseVersion: '1.0.0' });
expect(first.recipe.files[0]).not.toHaveProperty('content');
expect(db().prepare('SELECT * FROM server_keys').all()).toEqual([]);
expect(db().prepare('SELECT * FROM server_creation_jobs').all()).toEqual([]);
expect(JSON.stringify(first)).not.toContain('private-');
});
it('retains the selected script and plugin release in both planned and captured files', async () => {
const { script } = await seedArtifacts();
const { createScript, uploadNewVersion } =
await import('../../src/lib/server/fleet/scripts.js');
const { captureRecipe, captureRecipePlan } =
await import('../../src/lib/server/fleet/launch-recipes.js');
const { db } = await import('../../src/lib/server/db/index.js');
const selected = uploadNewVersion(
script.script.id,
Buffer.from('updated perks'),
undefined,
'2.3.4'
);
const plugin = createScript({
name: 'Native perks',
kind: 'plugin',
scopeType: 'game',
scopeValue: 't5',
targetRelPath: 'perks.dll',
content: Buffer.from('plugin'),
releaseVersion: 'v4.5.6'
});
for (const [id, versionId] of [
[script.script.id, selected.id],
[plugin.script.id, plugin.version.id]
])
db()
.prepare('UPDATE scripts SET current_version_id = ? WHERE id = ?')
.run(versionId, id);
for (const capture of [captureRecipePlan, captureRecipe]) {
const recipe = capture('t5', 'theater');
expect(recipe.files).toEqual(
expect.arrayContaining([
expect.objectContaining({
path: 'perks.gsc',
version: 2,
releaseVersion: '2.3.4'
}),
expect.objectContaining({
path: 'perks.dll',
version: 1,
releaseVersion: 'v4.5.6'
}),
expect.objectContaining({ kind: 'config', version: null, releaseVersion: null })
])
);
}
});
it('returns the same operation for repeated submission, even after expiry and restart', async () => {
const { previewCreation, queueCreateServer } =
await import('../../src/lib/server/fleet/create.js');