feat(cache,build,docs): switch cache storage to SmartMongo and align build configuration with updated dependencies

This commit is contained in:
2026-03-28 07:21:29 +00:00
parent 6260e90b09
commit 7e567d78da
13 changed files with 116 additions and 63 deletions

View File

@@ -1,4 +1,4 @@
import { assertEquals, assertExists } from 'https://deno.land/std@0.208.0/assert/mod.ts';
import { assertEquals, assertExists } from '@std/assert';
import { BaseProvider, GiteaProvider, GitLabProvider } from '../ts/providers/index.ts';
import { ConnectionManager } from '../ts/classes/connectionmanager.ts';
import { GitopsApp } from '../ts/classes/gitopsapp.ts';

View File

@@ -1,4 +1,4 @@
import { assertEquals, assertExists } from 'https://deno.land/std@0.208.0/assert/mod.ts';
import { assertEquals, assertExists } from '@std/assert';
import { StorageManager } from '../ts/storage/index.ts';
import * as smartsecret from '@push.rocks/smartsecret';

View File

@@ -1,22 +1,20 @@
import { assertEquals, assertExists } from 'https://deno.land/std@0.208.0/assert/mod.ts';
import { LocalTsmDb } from '@push.rocks/smartmongo';
import { assertEquals, assertExists } from '@std/assert';
import { SmartMongo } from '@push.rocks/smartmongo';
import { SmartdataDb, SmartDataDbDoc, Collection, svDb, unI } from '@push.rocks/smartdata';
Deno.test({
name: 'TsmDb spike: LocalTsmDb + SmartdataDb roundtrip',
name: 'TsmDb spike: SmartMongo + SmartdataDb roundtrip',
sanitizeOps: false,
sanitizeResources: false,
fn: async () => {
const tmpDir = await Deno.makeTempDir();
// 1. Start local MongoDB-compatible server
const localDb = new LocalTsmDb({ folderPath: tmpDir });
const { connectionUri } = await localDb.start();
assertExists(connectionUri);
const mongo = await SmartMongo.createAndStart();
const mongoDescriptor = await mongo.getMongoDescriptor();
assertExists(mongoDescriptor.mongoDbUrl);
// 2. Connect smartdata
const smartDb = new SmartdataDb({
mongoDbUrl: connectionUri,
mongoDbUrl: mongoDescriptor.mongoDbUrl,
mongoDbName: 'gitops_spike_test',
});
await smartDb.init();
@@ -52,8 +50,8 @@ Deno.test({
assertEquals(found.label, 'spike');
assertEquals(found.value, 42);
// 6. Cleanup — smartDb closes; localDb.stop() hangs under Deno, so fire-and-forget
// 6. Cleanup — smartDb closes; mongo.stop() may hang under Deno, so fire-and-forget
await smartDb.close();
localDb.stop().catch(() => {});
mongo.stop().catch(() => {});
},
});