fix: retain capture evidence and control failed task recovery
This commit is contained in:
1 parent
c19be938fc
commit
5bae83922c
17 files changed
+333
-35
No files matched your search
@@ -4,7 +4,7 @@ const {main}=require('../src/server.cjs'),{FileArea}=require('../src/storage-fil
|
||||
const {activateReferenceMapping}=require('./fixtures/activate-field-mapping.cjs');
|
||||
async function port(){const server=net.createServer();await new Promise(r=>server.listen(0,'127.0.0.1',r));const result=server.address().port;await new Promise(r=>server.close(r));return result;}
|
||||
|
||||
test('the canonical native app exposes one authenticated execution chain with real PDF archive and visible candidates',{timeout:120000},async t=>{
|
||||
test('the canonical native app archives matched orders and excludes unmatched nodes from the order center',{timeout:120000},async t=>{
|
||||
const temporary=await fs.mkdtemp(path.join(os.tmpdir(),'native-category-http-'));let app;
|
||||
t.after(async()=>{app?.dashboard.closeAllConnections();app?.server.closeAllConnections();await app?.stop();await fs.rm(temporary,{recursive:true,force:true});});
|
||||
const bridgePort=await port();let dashboardPort=await port();while(dashboardPort===bridgePort)dashboardPort=await port();
|
||||
@@ -39,5 +39,5 @@ test('the canonical native app exposes one authenticated execution chain with re
|
||||
const before=await fs.readdir(path.join(archiveRoot,'orders'));await call('/api/order-execution/scan',{connectionId:connection.id,idempotencyKey:'native-second-scan'},operator);assert.equal(app.orderRules.all('orders').length,1);assert.deepEqual(await fs.readdir(path.join(archiveRoot,'orders')),before);
|
||||
const list=(await call('/api/order-rules/orders',undefined,operator)).data;assert.equal(list.items[0].id,order.id);const details=(await call('/api/order-rules/orders/'+order.id,undefined,operator)).data;assert.equal(details.files.length,1);assert.equal(details.event.taskId,row.taskId);
|
||||
row.taskId='900201';row.nodeName='小湃BOM创建';await call('/api/order-execution/scan',{connectionId:connection.id,idempotencyKey:'candidate-scan'},operator);
|
||||
const candidates=(await call('/api/order-rules/orders?status=candidate',undefined,operator)).data;assert.equal(candidates.total,1);assert.equal(candidates.items[0].status,'candidate');assert.equal(smtpCalls,0);assert.equal(app.orderRules.all('batches').length,0);
|
||||
const candidates=(await call('/api/order-rules/orders?status=candidate',undefined,operator)).data;assert.equal(candidates.total,0);assert.deepEqual(candidates.items,[]);assert.equal(app.orderRules.all('orders').length,1);assert.equal(smtpCalls,0);assert.equal(app.orderRules.all('batches').length,0);
|
||||
});
|
||||
Reference in new issue
Block a user