feat(ql3): establish 3.0 incubation baseline

This commit is contained in:
whyour
2026-08-12 00:25:26 +08:00
parent 4bf92dcfeb
commit c699c32461
2817 changed files with 779642 additions and 653 deletions
@@ -0,0 +1,38 @@
const assert = require('node:assert/strict');
const { test } = require('node:test');
const {
CLUSTER_PLUGIN_PACKAGE_DISPATCH_BATCH_LIMIT,
createClusterPluginPackageApprovedActionDispatcher,
} = require('@qinglong/cluster-admin/plugin-package-approved-action');
test('composes one bounded caller-driven cluster Package dispatcher', async () => {
const pool = {
async query() {
throw new Error('construction must not touch PostgreSQL');
},
async connect() {
throw new Error('construction must not open PostgreSQL');
},
};
const dispatcher = createClusterPluginPackageApprovedActionDispatcher({
pool,
owner: 'cluster_package_dispatcher_1',
clock: () => 100,
createId: () => 'dispatcher-id-1',
});
let observedLimit = null;
dispatcher.repository.listDueExecutions = async (query) => {
observedLimit = query.limit;
return { executions: [], truncated: false };
};
const summary = await dispatcher.dispatchBatch();
assert.equal(summary.scanned, 0);
assert.equal(summary.truncated, false);
assert.equal(observedLimit, CLUSTER_PLUGIN_PACKAGE_DISPATCH_BATCH_LIMIT);
assert.equal(
require('@qinglong/cluster-admin')
.createClusterPluginPackageApprovedActionDispatcher,
undefined,
);
});