Remove Komodo backend in favor of native hosts
This commit is contained in:
@@ -10,7 +10,7 @@ const server = 't5_zombie_theater_1';
|
||||
beforeEach(async () => {
|
||||
vi.resetModules();
|
||||
fixture = await newFixture([]);
|
||||
vi.stubEnv('KOMODO_ADDRESS', ''); vi.stubEnv('KOMODO_API_KEY', ''); vi.stubEnv('KOMODO_API_SECRET', '');
|
||||
|
||||
vi.stubEnv('RCON_PASSWORD', '');
|
||||
});
|
||||
afterEach(async () => { vi.restoreAllMocks(); await fixture.cleanup(); vi.unstubAllEnvs(); });
|
||||
@@ -30,12 +30,12 @@ async function intent() {
|
||||
}
|
||||
|
||||
describe('native creation intents before placement', () => {
|
||||
it('retains its identity and native history across restart without falling into legacy provisioning', async () => {
|
||||
it('retains its identity and native history across restart without changing ownership', async () => {
|
||||
const id = await intent();
|
||||
const { db, closeDb } = await import('../../src/lib/server/db/index.js');
|
||||
const { getDeployment, interruptDeployments } = await import('../../src/lib/server/provisioning/history.js');
|
||||
const { nativeDeployment, unplacedNativeCreation } = await import('../../src/lib/server/backends/native.js');
|
||||
const { nextLobbyNumber, processCreations } = await import('../../src/lib/server/provisioning/instances.js');
|
||||
const { nextLobbyNumber } = await import('../../src/lib/server/provisioning/instances.js');
|
||||
const { requestLifecycle } = await import('../../src/lib/server/provisioning/requests.js');
|
||||
expect(nativeDeployment(id)).toBe(true);
|
||||
expect(unplacedNativeCreation(server)).toBe(id);
|
||||
@@ -43,7 +43,8 @@ describe('native creation intents before placement', () => {
|
||||
expect(requestLifecycle(server, 'stop')).toMatchObject({ ok: false, status: 409 });
|
||||
closeDb();
|
||||
interruptDeployments();
|
||||
await processCreations();
|
||||
const { processProvisioning } = await import('../../src/lib/server/provisioning/worker.js');
|
||||
await processProvisioning();
|
||||
expect(getDeployment(id)).toMatchObject({ backend: 'native', canCancelCreation: true, agentOperation: null,
|
||||
deployment: { state: 'queued', server_exists: 0 } });
|
||||
expect(db().prepare('SELECT port FROM server_creation_jobs WHERE deployment_id=?').get(id)).toEqual({ port: null });
|
||||
@@ -78,7 +79,7 @@ describe('native creation intents before placement', () => {
|
||||
it('will not cancel an unplaced historical intent against a replacement server', async () => {
|
||||
const id = await intent();
|
||||
const { db } = await import('../../src/lib/server/db/index.js');
|
||||
db().prepare("INSERT INTO servers(name,komodo_name) VALUES(?,'replacement')").run(server);
|
||||
db().prepare("INSERT INTO servers(name) VALUES(?)").run(server);
|
||||
const { cancelCreation, canCancelCreation } = await import('../../src/lib/server/provisioning/cancel-creation.js');
|
||||
expect(canCancelCreation(id)).toBe(false);
|
||||
expect(cancelCreation(id)).toBeNull();
|
||||
|
||||
Reference in New Issue
Block a user