mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-15 20:30:46 +08:00
fix: use in-process Harness API for local plugin connections
This commit is contained in:
parent
f4ded46278
commit
f0b6b38b45
40 changed files with 1413 additions and 603 deletions
|
|
@ -20,7 +20,7 @@ function controller() {
|
|||
test('Host exports the DingTalk plugin identity and required services', () => {
|
||||
const plugin = createDingtalkHostPlugin({ controller: controller() });
|
||||
assert.equal(name, 'dsh-dingtalk-host');
|
||||
assert.deepEqual(inject, ['connection', 'credentials', 'webServer', 'typertGateway']);
|
||||
assert.deepEqual(inject, ['connection', 'credentials', 'apiProxy', 'typertGateway']);
|
||||
assert.equal(plugin.name, name);
|
||||
assert.deepEqual(plugin.inject, inject);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -41,9 +41,10 @@ test('production assembly keeps secrets in credentials and creates per-bot runti
|
|||
async close() { seen.supervisorClosed = true; },
|
||||
};
|
||||
const credentials = {};
|
||||
const apiProxy = {};
|
||||
const production = await createProductionController({
|
||||
credentials,
|
||||
webServer: { port: 3080 },
|
||||
apiProxy,
|
||||
logger: () => console,
|
||||
}, { dataDir: directory }, {
|
||||
ConfigStore,
|
||||
|
|
@ -56,7 +57,8 @@ test('production assembly keeps secrets in credentials and creates per-bot runti
|
|||
});
|
||||
|
||||
assert.equal(seen.controllerOptions.credentials, credentials);
|
||||
assert.equal(seen.harnessOptions.baseUrl.href, 'http://127.0.0.1:3080/');
|
||||
assert.equal(seen.harnessOptions.apiProxy, apiProxy);
|
||||
assert.equal(Object.hasOwn(seen.harnessOptions, 'baseUrl'), false);
|
||||
assert.equal(seen.harnessOptions.autostart, false);
|
||||
assert.equal(Object.hasOwn(seen.harnessOptions, 'agentPreset'), false);
|
||||
const runtime = await seen.controllerOptions.createRuntime({
|
||||
|
|
@ -82,7 +84,7 @@ test('production assembly keeps secrets in credentials and creates per-bot runti
|
|||
|
||||
const productionWithPreset = await createProductionController({
|
||||
credentials,
|
||||
webServer: { port: 3080 },
|
||||
apiProxy,
|
||||
logger: () => console,
|
||||
}, { dataDir: directory, agentPreset: 'router-standard' }, {
|
||||
ConfigStore,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue