feat(api): complete NaxOS management daemon, GitOps engine, ZFS controller, and test suite
CI & Test NaxOS Management API / test (push) Failing after 2m49s
CI & Test NaxOS Management API / test (push) Failing after 2m49s
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
||||
import { GitOpsService } from '../src/services/gitops.service.js';
|
||||
import { AppsService } from '../src/services/apps.service.js';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import fs from 'fs/promises';
|
||||
|
||||
describe('AppsService', () => {
|
||||
let gitops: GitOpsService;
|
||||
let apps: AppsService;
|
||||
let testRepoDir: string;
|
||||
|
||||
beforeEach(async () => {
|
||||
testRepoDir = path.join(os.tmpdir(), `naxos-apps-test-${Date.now()}-${Math.random().toString(36).slice(2)}`);
|
||||
gitops = new GitOpsService(testRepoDir);
|
||||
await gitops.init();
|
||||
apps = new AppsService(gitops);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
try {
|
||||
await fs.rm(testRepoDir, { recursive: true, force: true });
|
||||
} catch {}
|
||||
});
|
||||
|
||||
it('should return the curated app catalog', () => {
|
||||
const catalog = apps.getCatalog();
|
||||
expect(catalog.length).toBeGreaterThanOrEqual(5);
|
||||
const immich = catalog.find((c) => c.id === 'immich');
|
||||
expect(immich).toBeDefined();
|
||||
expect(immich?.recommendedRuntime).toBe('systemd');
|
||||
});
|
||||
|
||||
it('should install app into active workloads', async () => {
|
||||
const installed = await apps.installApp({ appId: 'vaultwarden' });
|
||||
expect(installed.appId).toBe('vaultwarden');
|
||||
expect(installed.status).toBe('running');
|
||||
|
||||
const list = apps.getInstalledApps();
|
||||
expect(list.some((a) => a.appId === 'vaultwarden')).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user