@platforma-sdk/test 1.52.3 → 1.52.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/test-block.cjs +12 -4
- package/dist/test-block.cjs.map +1 -1
- package/dist/test-block.d.ts.map +1 -1
- package/dist/test-block.js +12 -4
- package/dist/test-block.js.map +1 -1
- package/dist/test-pl.cjs +24 -14
- package/dist/test-pl.cjs.map +1 -1
- package/dist/test-pl.d.ts.map +1 -1
- package/dist/test-pl.js +24 -14
- package/dist/test-pl.js.map +1 -1
- package/package.json +8 -8
package/dist/test-block.cjs
CHANGED
|
@@ -96,15 +96,23 @@ const blockTest = testPl.plTest.extend({
|
|
|
96
96
|
ml.addRuntimeCapability('requiresUIAPIVersion', 1);
|
|
97
97
|
ml.addRuntimeCapability('requiresUIAPIVersion', 2);
|
|
98
98
|
ml.addRuntimeCapability('requiresUIAPIVersion', 3);
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
try {
|
|
100
|
+
await use(ml);
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
await ml.close();
|
|
104
|
+
}
|
|
101
105
|
},
|
|
102
106
|
rawPrj: async ({ ml }, use) => {
|
|
103
107
|
const pRid1 = await ml.createProject({ label: 'Test Project' }, 'test_project');
|
|
104
108
|
await ml.openProject(pRid1);
|
|
105
109
|
const prj = ml.getOpenedProject(pRid1);
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
try {
|
|
111
|
+
await use(prj);
|
|
112
|
+
}
|
|
113
|
+
finally {
|
|
114
|
+
ml.closeProject(pRid1);
|
|
115
|
+
}
|
|
108
116
|
},
|
|
109
117
|
helpers: async ({ ml, rawPrj }, use) => {
|
|
110
118
|
await use({
|
package/dist/test-block.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-block.cjs","sources":["../src/test-block.ts"],"sourcesContent":["import path from 'node:path';\nimport * as fsp from 'node:fs/promises';\nimport type {\n InferBlockState,\n LocalImportFileHandle,\n Platforma,\n Project,\n} from '@milaboratories/pl-middle-layer';\nimport {\n MiddleLayer,\n} from '@milaboratories/pl-middle-layer';\nimport { plTest } from './test-pl';\nimport { awaitStableState } from './util';\n\nexport type AwaitBlockDoneOps = {\n timeout?: number | AbortSignal;\n ignoreBlockError?: boolean;\n};\n\nexport type AwaitBlockDoneNormalized = {\n timeout: AbortSignal;\n ignoreBlockError: boolean;\n};\n\nfunction normalizeABDOpts(\n timeoutOrOps?: number | AwaitBlockDoneOps,\n): AwaitBlockDoneNormalized {\n let ops: AwaitBlockDoneOps = {};\n if (timeoutOrOps !== undefined) {\n if (\n typeof timeoutOrOps === 'object'\n && !(timeoutOrOps instanceof AbortSignal)\n )\n ops = { ...ops, ...timeoutOrOps };\n else ops.timeout = timeoutOrOps;\n }\n const abortSignal\n = typeof ops.timeout === 'undefined'\n ? AbortSignal.timeout(DEFAULT_AWAIT_BLOCK_DONE_TIMEOUT)\n : typeof ops.timeout === 'number'\n ? AbortSignal.timeout(ops.timeout)\n : ops.timeout;\n return {\n timeout: abortSignal,\n ignoreBlockError: Boolean(ops.ignoreBlockError),\n };\n}\n\nexport const DEFAULT_AWAIT_BLOCK_DONE_TIMEOUT = 5000;\n\nasync function awaitBlockDone(\n prj: Project,\n blockId: string,\n timeoutOrOps?: number | AwaitBlockDoneOps,\n) {\n const ops = normalizeABDOpts(timeoutOrOps);\n const overview = prj.overview;\n const state = prj.getBlockState(blockId);\n while (true) {\n const overviewSnapshot = (await overview.getValue())!;\n const blockOverview = overviewSnapshot.blocks.find((b) => b.id == blockId);\n if (blockOverview === undefined)\n throw new Error(`Blocks not found: ${blockId}`);\n if (blockOverview.outputErrors) {\n if (ops.ignoreBlockError) return;\n else {\n let errorMessage = blockOverview.outputsError;\n if (errorMessage === undefined)\n errorMessage = blockOverview.exportsError;\n throw new Error('Block error: ' + (errorMessage ?? 'no message'));\n }\n }\n if (blockOverview.calculationStatus === 'Done') return;\n if (blockOverview.calculationStatus !== 'Running')\n throw new Error(\n `Unexpected block status, block not calculating anything at the moment: ${blockOverview.calculationStatus}`,\n );\n try {\n await overview.awaitChange(ops.timeout);\n } catch (e: any) {\n console.dir(blockOverview, { depth: 5 });\n console.dir(await state.getValue(), { depth: 5 });\n throw new Error('Aborted while awaiting block done.', { cause: e });\n }\n }\n}\n\nexport interface RawHelpers {\n awaitBlockDone(\n blockId: string,\n timeoutOrOps?: number | AwaitBlockDoneOps\n ): Promise<void>;\n awaitBlockDoneAndGetStableBlockState<Pl extends Platforma>(\n blockId: string,\n timeoutOrOps?: number | AwaitBlockDoneOps\n ): Promise<InferBlockState<Pl>>;\n getLocalFileHandle(localPath: string): Promise<LocalImportFileHandle>;\n}\n\nexport const blockTest = plTest.extend<{\n ml: MiddleLayer;\n rawPrj: Project;\n helpers: RawHelpers;\n}>({\n ml: async ({ pl, tmpFolder }, use) => {\n const frontendFolder = path.join(tmpFolder, 'frontend');\n const downloadFolder = path.join(tmpFolder, 'download');\n await fsp.mkdir(frontendFolder, { recursive: true });\n await fsp.mkdir(downloadFolder, { recursive: true });\n\n const ml = await MiddleLayer.init(pl, tmpFolder, {\n defaultTreeOptions: { pollingInterval: 250, stopPollingDelay: 500 },\n devBlockUpdateRecheckInterval: 300,\n localSecret: MiddleLayer.generateLocalSecret(),\n localProjections: [], // TODO must be different with local pl\n openFileDialogCallback: () => {\n throw new Error('Not implemented.');\n },\n });\n ml.addRuntimeCapability('requiresUIAPIVersion', 1);\n ml.addRuntimeCapability('requiresUIAPIVersion', 2);\n ml.addRuntimeCapability('requiresUIAPIVersion', 3);\n\n await use(ml);\n\n
|
|
1
|
+
{"version":3,"file":"test-block.cjs","sources":["../src/test-block.ts"],"sourcesContent":["import path from 'node:path';\nimport * as fsp from 'node:fs/promises';\nimport type {\n InferBlockState,\n LocalImportFileHandle,\n Platforma,\n Project,\n} from '@milaboratories/pl-middle-layer';\nimport {\n MiddleLayer,\n} from '@milaboratories/pl-middle-layer';\nimport { plTest } from './test-pl';\nimport { awaitStableState } from './util';\n\nexport type AwaitBlockDoneOps = {\n timeout?: number | AbortSignal;\n ignoreBlockError?: boolean;\n};\n\nexport type AwaitBlockDoneNormalized = {\n timeout: AbortSignal;\n ignoreBlockError: boolean;\n};\n\nfunction normalizeABDOpts(\n timeoutOrOps?: number | AwaitBlockDoneOps,\n): AwaitBlockDoneNormalized {\n let ops: AwaitBlockDoneOps = {};\n if (timeoutOrOps !== undefined) {\n if (\n typeof timeoutOrOps === 'object'\n && !(timeoutOrOps instanceof AbortSignal)\n )\n ops = { ...ops, ...timeoutOrOps };\n else ops.timeout = timeoutOrOps;\n }\n const abortSignal\n = typeof ops.timeout === 'undefined'\n ? AbortSignal.timeout(DEFAULT_AWAIT_BLOCK_DONE_TIMEOUT)\n : typeof ops.timeout === 'number'\n ? AbortSignal.timeout(ops.timeout)\n : ops.timeout;\n return {\n timeout: abortSignal,\n ignoreBlockError: Boolean(ops.ignoreBlockError),\n };\n}\n\nexport const DEFAULT_AWAIT_BLOCK_DONE_TIMEOUT = 5000;\n\nasync function awaitBlockDone(\n prj: Project,\n blockId: string,\n timeoutOrOps?: number | AwaitBlockDoneOps,\n) {\n const ops = normalizeABDOpts(timeoutOrOps);\n const overview = prj.overview;\n const state = prj.getBlockState(blockId);\n while (true) {\n const overviewSnapshot = (await overview.getValue())!;\n const blockOverview = overviewSnapshot.blocks.find((b) => b.id == blockId);\n if (blockOverview === undefined)\n throw new Error(`Blocks not found: ${blockId}`);\n if (blockOverview.outputErrors) {\n if (ops.ignoreBlockError) return;\n else {\n let errorMessage = blockOverview.outputsError;\n if (errorMessage === undefined)\n errorMessage = blockOverview.exportsError;\n throw new Error('Block error: ' + (errorMessage ?? 'no message'));\n }\n }\n if (blockOverview.calculationStatus === 'Done') return;\n if (blockOverview.calculationStatus !== 'Running')\n throw new Error(\n `Unexpected block status, block not calculating anything at the moment: ${blockOverview.calculationStatus}`,\n );\n try {\n await overview.awaitChange(ops.timeout);\n } catch (e: any) {\n console.dir(blockOverview, { depth: 5 });\n console.dir(await state.getValue(), { depth: 5 });\n throw new Error('Aborted while awaiting block done.', { cause: e });\n }\n }\n}\n\nexport interface RawHelpers {\n awaitBlockDone(\n blockId: string,\n timeoutOrOps?: number | AwaitBlockDoneOps\n ): Promise<void>;\n awaitBlockDoneAndGetStableBlockState<Pl extends Platforma>(\n blockId: string,\n timeoutOrOps?: number | AwaitBlockDoneOps\n ): Promise<InferBlockState<Pl>>;\n getLocalFileHandle(localPath: string): Promise<LocalImportFileHandle>;\n}\n\nexport const blockTest = plTest.extend<{\n ml: MiddleLayer;\n rawPrj: Project;\n helpers: RawHelpers;\n}>({\n ml: async ({ pl, tmpFolder }, use) => {\n const frontendFolder = path.join(tmpFolder, 'frontend');\n const downloadFolder = path.join(tmpFolder, 'download');\n await fsp.mkdir(frontendFolder, { recursive: true });\n await fsp.mkdir(downloadFolder, { recursive: true });\n\n const ml = await MiddleLayer.init(pl, tmpFolder, {\n defaultTreeOptions: { pollingInterval: 250, stopPollingDelay: 500 },\n devBlockUpdateRecheckInterval: 300,\n localSecret: MiddleLayer.generateLocalSecret(),\n localProjections: [], // TODO must be different with local pl\n openFileDialogCallback: () => {\n throw new Error('Not implemented.');\n },\n });\n ml.addRuntimeCapability('requiresUIAPIVersion', 1);\n ml.addRuntimeCapability('requiresUIAPIVersion', 2);\n ml.addRuntimeCapability('requiresUIAPIVersion', 3);\n\n try {\n await use(ml);\n } finally {\n await ml.close();\n }\n },\n rawPrj: async ({ ml }, use) => {\n const pRid1 = await ml.createProject(\n { label: 'Test Project' },\n 'test_project',\n );\n await ml.openProject(pRid1);\n const prj = ml.getOpenedProject(pRid1);\n try {\n await use(prj);\n } finally {\n ml.closeProject(pRid1);\n }\n },\n helpers: async ({ ml, rawPrj }, use) => {\n await use({\n async awaitBlockDone(blockId, timeout) {\n await awaitBlockDone(rawPrj, blockId, timeout);\n },\n awaitBlockDoneAndGetStableBlockState: async <Pl extends Platforma>(\n blockId: string,\n timeoutOrOps?: number | AwaitBlockDoneOps,\n ) => {\n const ops = normalizeABDOpts(timeoutOrOps);\n await awaitBlockDone(rawPrj, blockId, ops);\n return (await awaitStableState(\n rawPrj.getBlockState(blockId),\n ops.timeout,\n )) as InferBlockState<Pl>;\n },\n async getLocalFileHandle(localPath) {\n return await ml.internalDriverKit.lsDriver.getLocalFileHandle(\n path.resolve(localPath),\n );\n },\n });\n },\n});\n"],"names":["plTest","fsp","MiddleLayer","awaitStableState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAS,gBAAgB,CACvB,YAAyC,EAAA;IAEzC,IAAI,GAAG,GAAsB,EAAE;AAC/B,IAAA,IAAI,YAAY,KAAK,SAAS,EAAE;QAC9B,IACE,OAAO,YAAY,KAAK;AACrB,eAAA,EAAE,YAAY,YAAY,WAAW,CAAC;YAEzC,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,GAAG,YAAY,EAAE;;AAC9B,YAAA,GAAG,CAAC,OAAO,GAAG,YAAY;IACjC;AACA,IAAA,MAAM,WAAW,GACb,OAAO,GAAG,CAAC,OAAO,KAAK;AACvB,UAAE,WAAW,CAAC,OAAO,CAAC,gCAAgC;AACtD,UAAE,OAAO,GAAG,CAAC,OAAO,KAAK;cACrB,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO;AACjC,cAAE,GAAG,CAAC,OAAO;IACnB,OAAO;AACL,QAAA,OAAO,EAAE,WAAW;AACpB,QAAA,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;KAChD;AACH;AAEO,MAAM,gCAAgC,GAAG;AAEhD,eAAe,cAAc,CAC3B,GAAY,EACZ,OAAe,EACf,YAAyC,EAAA;AAEzC,IAAA,MAAM,GAAG,GAAG,gBAAgB,CAAC,YAAY,CAAC;AAC1C,IAAA,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ;IAC7B,MAAM,KAAK,GAAG,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC;IAC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ClC,EAAE,KAAK,EAAE,cAAc,EAAE,EACzB,cAAc,CACf;AACD,QAAA,MAAM,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC;QAC3B,MAAM,GAAG,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC;AACtC,QAAA,IAAI;AACF,YAAA,MAAM,GAAG,CAAC,GAAG,CAAC;QAChB;gBAAU;AACR,YAAA,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC;QACxB;IACF,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAG,KAAI;AACrC,QAAA,MAAM,GAAG,CAAC;AACR,YAAA,MAAM,cAAc,CAAC,OAAO,EAAE,OAAO,EAAA;gBACnC,MAAM,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;YAChD,CAAC;AACD,YAAA,oCAAoC,EAAE,OACpC,OAAe,EACf,YAAyC,KACvC;AACF,gBAAA,MAAM,GAAG,GAAG,gBAAgB,CAAC,YAAY,CAAC;gBAC1C,MAAM,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC;AAC1C,gBAAA,QAAQ,MAAMC,qBAAgB,CAC5B,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,EAC7B,GAAG,CAAC,OAAO,CACZ;YACH,CAAC;YACD,MAAM,kBAAkB,CAAC,SAAS,EAAA;AAChC,gBAAA,OAAO,MAAM,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,kBAAkB,CAC3D,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CACxB;YACH,CAAC;AACF,SAAA,CAAC;IACJ,CAAC;AACF,CAAA;;;;;"}
|
package/dist/test-block.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-block.d.ts","sourceRoot":"","sources":["../src/test-block.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EACrB,SAAS,EACT,O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3B,CAAC;AA0BF,eAAO,MAAM,gCAAgC,OAAO,CAAC;AAuCrD,MAAM,WAAW,UAAU;IACzB,cAAc,CACZ,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,MAAM,GAAG,iBAAiB,GACxC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,oCAAoC,CAAC,EAAE,SAAS,SAAS,EACvD,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,MAAM,GAAG,iBAAiB,GACxC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC;IAChC,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACvE;AAED,eAAO,MAAM,SAAS;;;;;;;;EAkEpB,CAAC"}
|
package/dist/test-block.js
CHANGED
|
@@ -75,15 +75,23 @@ const blockTest = plTest.extend({
|
|
|
75
75
|
ml.addRuntimeCapability('requiresUIAPIVersion', 1);
|
|
76
76
|
ml.addRuntimeCapability('requiresUIAPIVersion', 2);
|
|
77
77
|
ml.addRuntimeCapability('requiresUIAPIVersion', 3);
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
try {
|
|
79
|
+
await use(ml);
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
await ml.close();
|
|
83
|
+
}
|
|
80
84
|
},
|
|
81
85
|
rawPrj: async ({ ml }, use) => {
|
|
82
86
|
const pRid1 = await ml.createProject({ label: 'Test Project' }, 'test_project');
|
|
83
87
|
await ml.openProject(pRid1);
|
|
84
88
|
const prj = ml.getOpenedProject(pRid1);
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
try {
|
|
90
|
+
await use(prj);
|
|
91
|
+
}
|
|
92
|
+
finally {
|
|
93
|
+
ml.closeProject(pRid1);
|
|
94
|
+
}
|
|
87
95
|
},
|
|
88
96
|
helpers: async ({ ml, rawPrj }, use) => {
|
|
89
97
|
await use({
|
package/dist/test-block.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-block.js","sources":["../src/test-block.ts"],"sourcesContent":["import path from 'node:path';\nimport * as fsp from 'node:fs/promises';\nimport type {\n InferBlockState,\n LocalImportFileHandle,\n Platforma,\n Project,\n} from '@milaboratories/pl-middle-layer';\nimport {\n MiddleLayer,\n} from '@milaboratories/pl-middle-layer';\nimport { plTest } from './test-pl';\nimport { awaitStableState } from './util';\n\nexport type AwaitBlockDoneOps = {\n timeout?: number | AbortSignal;\n ignoreBlockError?: boolean;\n};\n\nexport type AwaitBlockDoneNormalized = {\n timeout: AbortSignal;\n ignoreBlockError: boolean;\n};\n\nfunction normalizeABDOpts(\n timeoutOrOps?: number | AwaitBlockDoneOps,\n): AwaitBlockDoneNormalized {\n let ops: AwaitBlockDoneOps = {};\n if (timeoutOrOps !== undefined) {\n if (\n typeof timeoutOrOps === 'object'\n && !(timeoutOrOps instanceof AbortSignal)\n )\n ops = { ...ops, ...timeoutOrOps };\n else ops.timeout = timeoutOrOps;\n }\n const abortSignal\n = typeof ops.timeout === 'undefined'\n ? AbortSignal.timeout(DEFAULT_AWAIT_BLOCK_DONE_TIMEOUT)\n : typeof ops.timeout === 'number'\n ? AbortSignal.timeout(ops.timeout)\n : ops.timeout;\n return {\n timeout: abortSignal,\n ignoreBlockError: Boolean(ops.ignoreBlockError),\n };\n}\n\nexport const DEFAULT_AWAIT_BLOCK_DONE_TIMEOUT = 5000;\n\nasync function awaitBlockDone(\n prj: Project,\n blockId: string,\n timeoutOrOps?: number | AwaitBlockDoneOps,\n) {\n const ops = normalizeABDOpts(timeoutOrOps);\n const overview = prj.overview;\n const state = prj.getBlockState(blockId);\n while (true) {\n const overviewSnapshot = (await overview.getValue())!;\n const blockOverview = overviewSnapshot.blocks.find((b) => b.id == blockId);\n if (blockOverview === undefined)\n throw new Error(`Blocks not found: ${blockId}`);\n if (blockOverview.outputErrors) {\n if (ops.ignoreBlockError) return;\n else {\n let errorMessage = blockOverview.outputsError;\n if (errorMessage === undefined)\n errorMessage = blockOverview.exportsError;\n throw new Error('Block error: ' + (errorMessage ?? 'no message'));\n }\n }\n if (blockOverview.calculationStatus === 'Done') return;\n if (blockOverview.calculationStatus !== 'Running')\n throw new Error(\n `Unexpected block status, block not calculating anything at the moment: ${blockOverview.calculationStatus}`,\n );\n try {\n await overview.awaitChange(ops.timeout);\n } catch (e: any) {\n console.dir(blockOverview, { depth: 5 });\n console.dir(await state.getValue(), { depth: 5 });\n throw new Error('Aborted while awaiting block done.', { cause: e });\n }\n }\n}\n\nexport interface RawHelpers {\n awaitBlockDone(\n blockId: string,\n timeoutOrOps?: number | AwaitBlockDoneOps\n ): Promise<void>;\n awaitBlockDoneAndGetStableBlockState<Pl extends Platforma>(\n blockId: string,\n timeoutOrOps?: number | AwaitBlockDoneOps\n ): Promise<InferBlockState<Pl>>;\n getLocalFileHandle(localPath: string): Promise<LocalImportFileHandle>;\n}\n\nexport const blockTest = plTest.extend<{\n ml: MiddleLayer;\n rawPrj: Project;\n helpers: RawHelpers;\n}>({\n ml: async ({ pl, tmpFolder }, use) => {\n const frontendFolder = path.join(tmpFolder, 'frontend');\n const downloadFolder = path.join(tmpFolder, 'download');\n await fsp.mkdir(frontendFolder, { recursive: true });\n await fsp.mkdir(downloadFolder, { recursive: true });\n\n const ml = await MiddleLayer.init(pl, tmpFolder, {\n defaultTreeOptions: { pollingInterval: 250, stopPollingDelay: 500 },\n devBlockUpdateRecheckInterval: 300,\n localSecret: MiddleLayer.generateLocalSecret(),\n localProjections: [], // TODO must be different with local pl\n openFileDialogCallback: () => {\n throw new Error('Not implemented.');\n },\n });\n ml.addRuntimeCapability('requiresUIAPIVersion', 1);\n ml.addRuntimeCapability('requiresUIAPIVersion', 2);\n ml.addRuntimeCapability('requiresUIAPIVersion', 3);\n\n await use(ml);\n\n
|
|
1
|
+
{"version":3,"file":"test-block.js","sources":["../src/test-block.ts"],"sourcesContent":["import path from 'node:path';\nimport * as fsp from 'node:fs/promises';\nimport type {\n InferBlockState,\n LocalImportFileHandle,\n Platforma,\n Project,\n} from '@milaboratories/pl-middle-layer';\nimport {\n MiddleLayer,\n} from '@milaboratories/pl-middle-layer';\nimport { plTest } from './test-pl';\nimport { awaitStableState } from './util';\n\nexport type AwaitBlockDoneOps = {\n timeout?: number | AbortSignal;\n ignoreBlockError?: boolean;\n};\n\nexport type AwaitBlockDoneNormalized = {\n timeout: AbortSignal;\n ignoreBlockError: boolean;\n};\n\nfunction normalizeABDOpts(\n timeoutOrOps?: number | AwaitBlockDoneOps,\n): AwaitBlockDoneNormalized {\n let ops: AwaitBlockDoneOps = {};\n if (timeoutOrOps !== undefined) {\n if (\n typeof timeoutOrOps === 'object'\n && !(timeoutOrOps instanceof AbortSignal)\n )\n ops = { ...ops, ...timeoutOrOps };\n else ops.timeout = timeoutOrOps;\n }\n const abortSignal\n = typeof ops.timeout === 'undefined'\n ? AbortSignal.timeout(DEFAULT_AWAIT_BLOCK_DONE_TIMEOUT)\n : typeof ops.timeout === 'number'\n ? AbortSignal.timeout(ops.timeout)\n : ops.timeout;\n return {\n timeout: abortSignal,\n ignoreBlockError: Boolean(ops.ignoreBlockError),\n };\n}\n\nexport const DEFAULT_AWAIT_BLOCK_DONE_TIMEOUT = 5000;\n\nasync function awaitBlockDone(\n prj: Project,\n blockId: string,\n timeoutOrOps?: number | AwaitBlockDoneOps,\n) {\n const ops = normalizeABDOpts(timeoutOrOps);\n const overview = prj.overview;\n const state = prj.getBlockState(blockId);\n while (true) {\n const overviewSnapshot = (await overview.getValue())!;\n const blockOverview = overviewSnapshot.blocks.find((b) => b.id == blockId);\n if (blockOverview === undefined)\n throw new Error(`Blocks not found: ${blockId}`);\n if (blockOverview.outputErrors) {\n if (ops.ignoreBlockError) return;\n else {\n let errorMessage = blockOverview.outputsError;\n if (errorMessage === undefined)\n errorMessage = blockOverview.exportsError;\n throw new Error('Block error: ' + (errorMessage ?? 'no message'));\n }\n }\n if (blockOverview.calculationStatus === 'Done') return;\n if (blockOverview.calculationStatus !== 'Running')\n throw new Error(\n `Unexpected block status, block not calculating anything at the moment: ${blockOverview.calculationStatus}`,\n );\n try {\n await overview.awaitChange(ops.timeout);\n } catch (e: any) {\n console.dir(blockOverview, { depth: 5 });\n console.dir(await state.getValue(), { depth: 5 });\n throw new Error('Aborted while awaiting block done.', { cause: e });\n }\n }\n}\n\nexport interface RawHelpers {\n awaitBlockDone(\n blockId: string,\n timeoutOrOps?: number | AwaitBlockDoneOps\n ): Promise<void>;\n awaitBlockDoneAndGetStableBlockState<Pl extends Platforma>(\n blockId: string,\n timeoutOrOps?: number | AwaitBlockDoneOps\n ): Promise<InferBlockState<Pl>>;\n getLocalFileHandle(localPath: string): Promise<LocalImportFileHandle>;\n}\n\nexport const blockTest = plTest.extend<{\n ml: MiddleLayer;\n rawPrj: Project;\n helpers: RawHelpers;\n}>({\n ml: async ({ pl, tmpFolder }, use) => {\n const frontendFolder = path.join(tmpFolder, 'frontend');\n const downloadFolder = path.join(tmpFolder, 'download');\n await fsp.mkdir(frontendFolder, { recursive: true });\n await fsp.mkdir(downloadFolder, { recursive: true });\n\n const ml = await MiddleLayer.init(pl, tmpFolder, {\n defaultTreeOptions: { pollingInterval: 250, stopPollingDelay: 500 },\n devBlockUpdateRecheckInterval: 300,\n localSecret: MiddleLayer.generateLocalSecret(),\n localProjections: [], // TODO must be different with local pl\n openFileDialogCallback: () => {\n throw new Error('Not implemented.');\n },\n });\n ml.addRuntimeCapability('requiresUIAPIVersion', 1);\n ml.addRuntimeCapability('requiresUIAPIVersion', 2);\n ml.addRuntimeCapability('requiresUIAPIVersion', 3);\n\n try {\n await use(ml);\n } finally {\n await ml.close();\n }\n },\n rawPrj: async ({ ml }, use) => {\n const pRid1 = await ml.createProject(\n { label: 'Test Project' },\n 'test_project',\n );\n await ml.openProject(pRid1);\n const prj = ml.getOpenedProject(pRid1);\n try {\n await use(prj);\n } finally {\n ml.closeProject(pRid1);\n }\n },\n helpers: async ({ ml, rawPrj }, use) => {\n await use({\n async awaitBlockDone(blockId, timeout) {\n await awaitBlockDone(rawPrj, blockId, timeout);\n },\n awaitBlockDoneAndGetStableBlockState: async <Pl extends Platforma>(\n blockId: string,\n timeoutOrOps?: number | AwaitBlockDoneOps,\n ) => {\n const ops = normalizeABDOpts(timeoutOrOps);\n await awaitBlockDone(rawPrj, blockId, ops);\n return (await awaitStableState(\n rawPrj.getBlockState(blockId),\n ops.timeout,\n )) as InferBlockState<Pl>;\n },\n async getLocalFileHandle(localPath) {\n return await ml.internalDriverKit.lsDriver.getLocalFileHandle(\n path.resolve(localPath),\n );\n },\n });\n },\n});\n"],"names":[],"mappings":";;;;;;AAwBA,SAAS,gBAAgB,CACvB,YAAyC,EAAA;IAEzC,IAAI,GAAG,GAAsB,EAAE;AAC/B,IAAA,IAAI,YAAY,KAAK,SAAS,EAAE;QAC9B,IACE,OAAO,YAAY,KAAK;AACrB,eAAA,EAAE,YAAY,YAAY,WAAW,CAAC;YAEzC,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,GAAG,YAAY,EAAE;;AAC9B,YAAA,GAAG,CAAC,OAAO,GAAG,YAAY;IACjC;AACA,IAAA,MAAM,WAAW,GACb,OAAO,GAAG,CAAC,OAAO,KAAK;AACvB,UAAE,WAAW,CAAC,OAAO,CAAC,gCAAgC;AACtD,UAAE,OAAO,GAAG,CAAC,OAAO,KAAK;cACrB,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO;AACjC,cAAE,GAAG,CAAC,OAAO;IACnB,OAAO;AACL,QAAA,OAAO,EAAE,WAAW;AACpB,QAAA,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;KAChD;AACH;AAEO,MAAM,gCAAgC,GAAG;AAEhD,eAAe,cAAc,CAC3B,GAAY,EACZ,OAAe,EACf,YAAyC,EAAA;AAEzC,IAAA,MAAM,GAAG,GAAG,gBAAgB,CAAC,YAAY,CAAC;AAC1C,IAAA,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ;IAC7B,MAAM,KA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,KAAK,GAAG,MAAM,EAAE,CAAC,aAAa,CAClC,EAAE,KAAK,EAAE,cAAc,EAAE,EACzB,cAAc,CACf;AACD,QAAA,MAAM,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC;QAC3B,MAAM,GAAG,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC;AACtC,QAAA,IAAI;AACF,YAAA,MAAM,GAAG,CAAC,GAAG,CAAC;QAChB;gBAAU;AACR,YAAA,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC;QACxB;IACF,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAG,KAAI;AACrC,QAAA,MAAM,GAAG,CAAC;AACR,YAAA,MAAM,cAAc,CAAC,OAAO,EAAE,OAAO,EAAA;gBACnC,MAAM,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;YAChD,CAAC;AACD,YAAA,oCAAoC,EAAE,OACpC,OAAe,EACf,YAAyC,KACvC;AACF,gBAAA,MAAM,GAAG,GAAG,gBAAgB,CAAC,YAAY,CAAC;gBAC1C,MAAM,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC;AAC1C,gBAAA,QAAQ,MAAM,gBAAgB,CAC5B,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,EAC7B,GAAG,CAAC,OAAO,CACZ;YACH,CAAC;YACD,MAAM,kBAAkB,CAAC,SAAS,EAAA;AAChC,gBAAA,OAAO,MAAM,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,kBAAkB,CAC3D,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CACxB;YACH,CAAC;AACF,SAAA,CAAC;IACJ,CAAC;AACF,CAAA;;;;"}
|
package/dist/test-pl.cjs
CHANGED
|
@@ -45,7 +45,14 @@ const plTest = vitest.test.extend({
|
|
|
45
45
|
let altRootId = plMiddleLayer.NullResourceId;
|
|
46
46
|
const client = await plMiddleLayer.TestHelpers.getTestClient(alternativeRoot);
|
|
47
47
|
altRootId = client.clientRoot;
|
|
48
|
-
|
|
48
|
+
try {
|
|
49
|
+
await use(client);
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
// Close the test client to avoid dangling gRPC channels
|
|
53
|
+
// that can cause segfaults during process exit
|
|
54
|
+
await client.close();
|
|
55
|
+
}
|
|
49
56
|
onTestFinished(async (context) => {
|
|
50
57
|
if (context.task.result?.state === 'pass') {
|
|
51
58
|
const rawClient = await plMiddleLayer.TestHelpers.getTestClient();
|
|
@@ -65,20 +72,23 @@ const plTest = vitest.test.extend({
|
|
|
65
72
|
},
|
|
66
73
|
createTree: async ({ pl }, use) => {
|
|
67
74
|
const trees = new Map();
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
try {
|
|
76
|
+
await use((res, ops) => {
|
|
77
|
+
let treePromise = trees.get(res);
|
|
78
|
+
if (treePromise === undefined) {
|
|
79
|
+
treePromise = plTree.SynchronizedTreeState.init(pl, res, ops ?? {
|
|
80
|
+
pollingInterval: 200,
|
|
81
|
+
stopPollingDelay: 400,
|
|
82
|
+
});
|
|
83
|
+
trees.set(res, treePromise);
|
|
84
|
+
}
|
|
85
|
+
return treePromise;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
for (const [, treePromise] of trees) {
|
|
90
|
+
await (await treePromise).terminate();
|
|
76
91
|
}
|
|
77
|
-
return treePromise;
|
|
78
|
-
});
|
|
79
|
-
for (const [, treePromise] of trees) {
|
|
80
|
-
// TODO implement termination
|
|
81
|
-
await (await treePromise).terminate();
|
|
82
92
|
}
|
|
83
93
|
},
|
|
84
94
|
rootTree: async ({ pl, createTree: tree }, use) => {
|
package/dist/test-pl.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-pl.cjs","sources":["../src/test-pl.ts"],"sourcesContent":["import type {\n OptionalResourceId,\n PlClient,\n ResourceId } from '@milaboratories/pl-middle-layer';\nimport {\n NullResourceId,\n resourceIdToString,\n TestHelpers,\n} from '@milaboratories/pl-middle-layer';\nimport type { SynchronizedTreeOps } from '@milaboratories/pl-tree';\nimport { SynchronizedTreeState } from '@milaboratories/pl-tree';\nimport { randomUUID } from 'node:crypto';\nimport * as fsp from 'node:fs/promises';\nimport path from 'node:path';\nimport { test } from 'vitest';\n\nexport const plTest = test.extend<{\n pl: PlClient;\n createTree: (\n res: ResourceId,\n ops?: SynchronizedTreeOps\n ) => Promise<SynchronizedTreeState>;\n rootTree: SynchronizedTreeState;\n tmpFolder: string;\n}>({\n tmpFolder: async ({ onTestFinished }, use) => {\n const workFolder = path.resolve(`work/${randomUUID()}`);\n await fsp.mkdir(workFolder, { recursive: true });\n await use(workFolder);\n onTestFinished(async (context) => {\n if (context.task.result?.state === 'pass') {\n await fsp.rm(workFolder, { recursive: true });\n } else {\n console.log(\n `TEST FAILED TMP FOLDER IS PRESERVED: ${workFolder}`,\n );\n }\n });\n },\n\n pl: async ({ onTestFinished }, use) => {\n const alternativeRoot = `test_${Date.now()}_${randomUUID()}`;\n let altRootId: OptionalResourceId = NullResourceId;\n const client = await TestHelpers.getTestClient(alternativeRoot);\n altRootId = client.clientRoot;\n await use(client);\n onTestFinished(async (context) => {\n if (context.task.result?.state === 'pass') {\n const rawClient = await TestHelpers.getTestClient();\n try {\n await rawClient.deleteAlternativeRoot(alternativeRoot);\n } finally {\n // Close the cleanup client to avoid dangling gRPC channels\n // that can cause segfaults during process exit\n await rawClient.close();\n }\n } else {\n console.log(\n `TEST FAILED SO ALTERNATIVE ROOT IS PRESERVED IN PL: ${alternativeRoot} (${resourceIdToString(\n altRootId,\n )})`,\n );\n }\n });\n },\n\n createTree: async ({ pl }, use) => {\n const trees = new Map<ResourceId, Promise<SynchronizedTreeState>>();\n await use((res, ops) => {\n
|
|
1
|
+
{"version":3,"file":"test-pl.cjs","sources":["../src/test-pl.ts"],"sourcesContent":["import type {\n OptionalResourceId,\n PlClient,\n ResourceId } from '@milaboratories/pl-middle-layer';\nimport {\n NullResourceId,\n resourceIdToString,\n TestHelpers,\n} from '@milaboratories/pl-middle-layer';\nimport type { SynchronizedTreeOps } from '@milaboratories/pl-tree';\nimport { SynchronizedTreeState } from '@milaboratories/pl-tree';\nimport { randomUUID } from 'node:crypto';\nimport * as fsp from 'node:fs/promises';\nimport path from 'node:path';\nimport { test } from 'vitest';\n\nexport const plTest = test.extend<{\n pl: PlClient;\n createTree: (\n res: ResourceId,\n ops?: SynchronizedTreeOps\n ) => Promise<SynchronizedTreeState>;\n rootTree: SynchronizedTreeState;\n tmpFolder: string;\n}>({\n tmpFolder: async ({ onTestFinished }, use) => {\n const workFolder = path.resolve(`work/${randomUUID()}`);\n await fsp.mkdir(workFolder, { recursive: true });\n await use(workFolder);\n onTestFinished(async (context) => {\n if (context.task.result?.state === 'pass') {\n await fsp.rm(workFolder, { recursive: true });\n } else {\n console.log(\n `TEST FAILED TMP FOLDER IS PRESERVED: ${workFolder}`,\n );\n }\n });\n },\n\n pl: async ({ onTestFinished }, use) => {\n const alternativeRoot = `test_${Date.now()}_${randomUUID()}`;\n let altRootId: OptionalResourceId = NullResourceId;\n const client = await TestHelpers.getTestClient(alternativeRoot);\n altRootId = client.clientRoot;\n try {\n await use(client);\n } finally {\n // Close the test client to avoid dangling gRPC channels\n // that can cause segfaults during process exit\n await client.close();\n }\n onTestFinished(async (context) => {\n if (context.task.result?.state === 'pass') {\n const rawClient = await TestHelpers.getTestClient();\n try {\n await rawClient.deleteAlternativeRoot(alternativeRoot);\n } finally {\n // Close the cleanup client to avoid dangling gRPC channels\n // that can cause segfaults during process exit\n await rawClient.close();\n }\n } else {\n console.log(\n `TEST FAILED SO ALTERNATIVE ROOT IS PRESERVED IN PL: ${alternativeRoot} (${resourceIdToString(\n altRootId,\n )})`,\n );\n }\n });\n },\n\n createTree: async ({ pl }, use) => {\n const trees = new Map<ResourceId, Promise<SynchronizedTreeState>>();\n try {\n await use((res, ops) => {\n let treePromise = trees.get(res);\n if (treePromise === undefined) {\n treePromise = SynchronizedTreeState.init(\n pl,\n res,\n ops ?? {\n pollingInterval: 200,\n stopPollingDelay: 400,\n },\n );\n trees.set(res, treePromise);\n }\n return treePromise;\n });\n } finally {\n for (const [, treePromise] of trees) {\n await (await treePromise).terminate();\n }\n }\n },\n\n rootTree: async ({ pl, createTree: tree }, use) => {\n await use(await tree(pl.clientRoot));\n },\n });\n"],"names":["test","randomUUID","fsp","NullResourceId","TestHelpers","resourceIdToString","SynchronizedTreeState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBO,MAAM,MAAM,GAAGA,WAAI,CAAC,MAAM,CAQ9B;IACG,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,GAAG,KAAI;QAC3C,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,CAAA,KAAA,EAAQC,sBAAU,EAAE,CAAA,CAAE,CAAC;AACvD,QAAA,MAAMC,cAAG,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAChD,QAAA,MAAM,GAAG,CAAC,UAAU,CAAC;AACrB,QAAA,cAAc,CAAC,OAAO,OAAO,KAAI;YAC/B,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,KAAK,MAAM,EAAE;AACzC,gBAAA,MAAMA,cAAG,CAAC,EAAE,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;YAC/C;iBAAO;AACL,gBAAA,OAAO,CAAC,GAAG,CACT,wCAAwC,UAAU,CAAA,CAAE,CACrD;YACH;AACF,QAAA,CAAC,CAAC;IACJ,CAAC;IAED,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,GAAG,KAAI;QACpC,MAAM,eAAe,GAAG,CAAA,KAAA,EAAQ,IAAI,CAAC,GAAG,EAAE,CAAA,CAA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AAE,GAAG;AACtB,qBAAA,CACF;AACD,oBAAA,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC;gBAC7B;AACA,gBAAA,OAAO,WAAW;AACpB,YAAA,CAAC,CAAC;QACJ;gBAAU;YACR,KAAK,MAAM,GAAG,WAAW,CAAC,IAAI,KAAK,EAAE;AACnC,gBAAA,MAAM,CAAC,MAAM,WAAW,EAAE,SAAS,EAAE;YACvC;QACF;IACF,CAAC;AAED,IAAA,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,GAAG,KAAI;QAChD,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;AACF,CAAA;;;;"}
|
package/dist/test-pl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-pl.d.ts","sourceRoot":"","sources":["../src/test-pl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,QAAQ,EACR,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAMtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAMhE,eAAO,MAAM,MAAM;;sBAGZ,UAAU,QACT,mBAAmB,KACpB,OAAO,CAAC,qBAAqB,CAAC;;;
|
|
1
|
+
{"version":3,"file":"test-pl.d.ts","sourceRoot":"","sources":["../src/test-pl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,QAAQ,EACR,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAMtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAMhE,eAAO,MAAM,MAAM;;sBAGZ,UAAU,QACT,mBAAmB,KACpB,OAAO,CAAC,qBAAqB,CAAC;;;EA+E/B,CAAC"}
|
package/dist/test-pl.js
CHANGED
|
@@ -24,7 +24,14 @@ const plTest = test.extend({
|
|
|
24
24
|
let altRootId = NullResourceId;
|
|
25
25
|
const client = await TestHelpers.getTestClient(alternativeRoot);
|
|
26
26
|
altRootId = client.clientRoot;
|
|
27
|
-
|
|
27
|
+
try {
|
|
28
|
+
await use(client);
|
|
29
|
+
}
|
|
30
|
+
finally {
|
|
31
|
+
// Close the test client to avoid dangling gRPC channels
|
|
32
|
+
// that can cause segfaults during process exit
|
|
33
|
+
await client.close();
|
|
34
|
+
}
|
|
28
35
|
onTestFinished(async (context) => {
|
|
29
36
|
if (context.task.result?.state === 'pass') {
|
|
30
37
|
const rawClient = await TestHelpers.getTestClient();
|
|
@@ -44,20 +51,23 @@ const plTest = test.extend({
|
|
|
44
51
|
},
|
|
45
52
|
createTree: async ({ pl }, use) => {
|
|
46
53
|
const trees = new Map();
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
try {
|
|
55
|
+
await use((res, ops) => {
|
|
56
|
+
let treePromise = trees.get(res);
|
|
57
|
+
if (treePromise === undefined) {
|
|
58
|
+
treePromise = SynchronizedTreeState.init(pl, res, ops ?? {
|
|
59
|
+
pollingInterval: 200,
|
|
60
|
+
stopPollingDelay: 400,
|
|
61
|
+
});
|
|
62
|
+
trees.set(res, treePromise);
|
|
63
|
+
}
|
|
64
|
+
return treePromise;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
for (const [, treePromise] of trees) {
|
|
69
|
+
await (await treePromise).terminate();
|
|
55
70
|
}
|
|
56
|
-
return treePromise;
|
|
57
|
-
});
|
|
58
|
-
for (const [, treePromise] of trees) {
|
|
59
|
-
// TODO implement termination
|
|
60
|
-
await (await treePromise).terminate();
|
|
61
71
|
}
|
|
62
72
|
},
|
|
63
73
|
rootTree: async ({ pl, createTree: tree }, use) => {
|
package/dist/test-pl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-pl.js","sources":["../src/test-pl.ts"],"sourcesContent":["import type {\n OptionalResourceId,\n PlClient,\n ResourceId } from '@milaboratories/pl-middle-layer';\nimport {\n NullResourceId,\n resourceIdToString,\n TestHelpers,\n} from '@milaboratories/pl-middle-layer';\nimport type { SynchronizedTreeOps } from '@milaboratories/pl-tree';\nimport { SynchronizedTreeState } from '@milaboratories/pl-tree';\nimport { randomUUID } from 'node:crypto';\nimport * as fsp from 'node:fs/promises';\nimport path from 'node:path';\nimport { test } from 'vitest';\n\nexport const plTest = test.extend<{\n pl: PlClient;\n createTree: (\n res: ResourceId,\n ops?: SynchronizedTreeOps\n ) => Promise<SynchronizedTreeState>;\n rootTree: SynchronizedTreeState;\n tmpFolder: string;\n}>({\n tmpFolder: async ({ onTestFinished }, use) => {\n const workFolder = path.resolve(`work/${randomUUID()}`);\n await fsp.mkdir(workFolder, { recursive: true });\n await use(workFolder);\n onTestFinished(async (context) => {\n if (context.task.result?.state === 'pass') {\n await fsp.rm(workFolder, { recursive: true });\n } else {\n console.log(\n `TEST FAILED TMP FOLDER IS PRESERVED: ${workFolder}`,\n );\n }\n });\n },\n\n pl: async ({ onTestFinished }, use) => {\n const alternativeRoot = `test_${Date.now()}_${randomUUID()}`;\n let altRootId: OptionalResourceId = NullResourceId;\n const client = await TestHelpers.getTestClient(alternativeRoot);\n altRootId = client.clientRoot;\n await use(client);\n onTestFinished(async (context) => {\n if (context.task.result?.state === 'pass') {\n const rawClient = await TestHelpers.getTestClient();\n try {\n await rawClient.deleteAlternativeRoot(alternativeRoot);\n } finally {\n // Close the cleanup client to avoid dangling gRPC channels\n // that can cause segfaults during process exit\n await rawClient.close();\n }\n } else {\n console.log(\n `TEST FAILED SO ALTERNATIVE ROOT IS PRESERVED IN PL: ${alternativeRoot} (${resourceIdToString(\n altRootId,\n )})`,\n );\n }\n });\n },\n\n createTree: async ({ pl }, use) => {\n const trees = new Map<ResourceId, Promise<SynchronizedTreeState>>();\n await use((res, ops) => {\n
|
|
1
|
+
{"version":3,"file":"test-pl.js","sources":["../src/test-pl.ts"],"sourcesContent":["import type {\n OptionalResourceId,\n PlClient,\n ResourceId } from '@milaboratories/pl-middle-layer';\nimport {\n NullResourceId,\n resourceIdToString,\n TestHelpers,\n} from '@milaboratories/pl-middle-layer';\nimport type { SynchronizedTreeOps } from '@milaboratories/pl-tree';\nimport { SynchronizedTreeState } from '@milaboratories/pl-tree';\nimport { randomUUID } from 'node:crypto';\nimport * as fsp from 'node:fs/promises';\nimport path from 'node:path';\nimport { test } from 'vitest';\n\nexport const plTest = test.extend<{\n pl: PlClient;\n createTree: (\n res: ResourceId,\n ops?: SynchronizedTreeOps\n ) => Promise<SynchronizedTreeState>;\n rootTree: SynchronizedTreeState;\n tmpFolder: string;\n}>({\n tmpFolder: async ({ onTestFinished }, use) => {\n const workFolder = path.resolve(`work/${randomUUID()}`);\n await fsp.mkdir(workFolder, { recursive: true });\n await use(workFolder);\n onTestFinished(async (context) => {\n if (context.task.result?.state === 'pass') {\n await fsp.rm(workFolder, { recursive: true });\n } else {\n console.log(\n `TEST FAILED TMP FOLDER IS PRESERVED: ${workFolder}`,\n );\n }\n });\n },\n\n pl: async ({ onTestFinished }, use) => {\n const alternativeRoot = `test_${Date.now()}_${randomUUID()}`;\n let altRootId: OptionalResourceId = NullResourceId;\n const client = await TestHelpers.getTestClient(alternativeRoot);\n altRootId = client.clientRoot;\n try {\n await use(client);\n } finally {\n // Close the test client to avoid dangling gRPC channels\n // that can cause segfaults during process exit\n await client.close();\n }\n onTestFinished(async (context) => {\n if (context.task.result?.state === 'pass') {\n const rawClient = await TestHelpers.getTestClient();\n try {\n await rawClient.deleteAlternativeRoot(alternativeRoot);\n } finally {\n // Close the cleanup client to avoid dangling gRPC channels\n // that can cause segfaults during process exit\n await rawClient.close();\n }\n } else {\n console.log(\n `TEST FAILED SO ALTERNATIVE ROOT IS PRESERVED IN PL: ${alternativeRoot} (${resourceIdToString(\n altRootId,\n )})`,\n );\n }\n });\n },\n\n createTree: async ({ pl }, use) => {\n const trees = new Map<ResourceId, Promise<SynchronizedTreeState>>();\n try {\n await use((res, ops) => {\n let treePromise = trees.get(res);\n if (treePromise === undefined) {\n treePromise = SynchronizedTreeState.init(\n pl,\n res,\n ops ?? {\n pollingInterval: 200,\n stopPollingDelay: 400,\n },\n );\n trees.set(res, treePromise);\n }\n return treePromise;\n });\n } finally {\n for (const [, treePromise] of trees) {\n await (await treePromise).terminate();\n }\n }\n },\n\n rootTree: async ({ pl, createTree: tree }, use) => {\n await use(await tree(pl.clientRoot));\n },\n });\n"],"names":[],"mappings":";;;;;;;AAgBO,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAQ9B;IACG,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,GAAG,KAAI;QAC3C,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,CAAA,KAAA,EAAQ,UAAU,EAAE,CAAA,CAAE,CAAC;AACvD,QAAA,MAAM,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAChD,QAAA,MAAM,GAAG,CAAC,UAAU,CAAC;AACrB,QAAA,cAAc,CAAC,OAAO,OAAO,KAAI;YAC/B,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,KAAK,MAAM,EAAE;AACzC,gBAAA,MAAM,GAAG,CAAC,EAAE,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;YAC/C;iBAAO;AACL,gBAAA,OAAO,CAAC,GAAG,CACT,wCAAwC,UAAU,CAAA,CAAE,CACrD;YACH;AACF,QAAA,CAAC,CAAC;IACJ,CAAC;IAED,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,GAAG,KAAI;QACpC,MAAM,eAAe,GAAG,CAAA,KAAA,EAAQ,IAAI,CAA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AA,gBAAgB,EAAE,GAAG;AACtB,qBAAA,CACF;AACD,oBAAA,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC;gBAC7B;AACA,gBAAA,OAAO,WAAW;AACpB,YAAA,CAAC,CAAC;QACJ;gBAAU;YACR,KAAK,MAAM,GAAG,WAAW,CAAC,IAAI,KAAK,EAAE;AACnC,gBAAA,MAAM,CAAC,MAAM,WAAW,EAAE,SAAS,EAAE;YACvC;QACF;IACF,CAAC;AAED,IAAA,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,GAAG,KAAI;QAChD,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;AACF,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/test",
|
|
3
|
-
"version": "1.52.
|
|
3
|
+
"version": "1.52.5",
|
|
4
4
|
"description": "Typescript Block Test Helpers",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -20,19 +20,19 @@
|
|
|
20
20
|
"vitest": "^4.0.16",
|
|
21
21
|
"@vitest/coverage-istanbul": "^4.0.16",
|
|
22
22
|
"eslint": "^9.25.1",
|
|
23
|
-
"@milaboratories/pl-tree": "1.8.30",
|
|
24
|
-
"@milaboratories/pl-middle-layer": "1.46.3",
|
|
25
|
-
"@milaboratories/ts-helpers": "1.6.0",
|
|
26
23
|
"@platforma-sdk/model": "1.52.3",
|
|
27
|
-
"@milaboratories/pl-
|
|
28
|
-
"@milaboratories/
|
|
24
|
+
"@milaboratories/pl-middle-layer": "1.46.5",
|
|
25
|
+
"@milaboratories/pl-tree": "1.8.31",
|
|
26
|
+
"@milaboratories/ts-helpers": "1.7.0",
|
|
27
|
+
"@milaboratories/computable": "2.8.2",
|
|
28
|
+
"@milaboratories/pl-client": "2.16.23",
|
|
29
29
|
"@milaboratories/eslint-config": "1.0.5"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "~24.5.2",
|
|
33
33
|
"typescript": "~5.6.3",
|
|
34
|
-
"@milaboratories/
|
|
35
|
-
"@milaboratories/
|
|
34
|
+
"@milaboratories/ts-builder": "1.2.3",
|
|
35
|
+
"@milaboratories/build-configs": "1.3.0",
|
|
36
36
|
"@milaboratories/ts-configs": "1.2.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|