feat(cache,build,docs): switch cache storage to SmartMongo and align build configuration with updated dependencies
This commit is contained in:
@@ -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(() => {});
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user