- Add Activepieces fork with SmoothSchedule custom piece - Create integrations app with Activepieces service layer - Add embed token endpoint for iframe integration - Create Automations page with embedded workflow builder - Add sidebar visibility fix for embed mode - Add list inactive customers endpoint to Public API - Include SmoothSchedule triggers: event created/updated/cancelled - Include SmoothSchedule actions: create/update/cancel events, list resources/services/customers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
60 lines
2.2 KiB
TypeScript
60 lines
2.2 KiB
TypeScript
import { FlowRunStatus } from '@activepieces/shared'
|
|
import { FlowExecutorContext } from '../../src/lib/handler/context/flow-execution-context'
|
|
import { flowExecutor } from '../../src/lib/handler/flow-executor'
|
|
import { buildPieceAction, generateMockEngineConstants } from './test-helper'
|
|
|
|
const failedHttpAction = buildPieceAction({
|
|
name: 'send_http',
|
|
pieceName: '@activepieces/piece-http',
|
|
actionName: 'send_request',
|
|
input: {
|
|
'url': 'https://cloud.activepieces.com/api/v1/asd',
|
|
'method': 'GET',
|
|
'headers': {},
|
|
'body_type': 'none',
|
|
'body': {},
|
|
'queryParams': {},
|
|
},
|
|
})
|
|
|
|
const successHttpAction = buildPieceAction({
|
|
name: 'send_http',
|
|
pieceName: '@activepieces/piece-http',
|
|
actionName: 'send_request',
|
|
input: {
|
|
'url': 'https://cloud.activepieces.com/api/v1/pieces',
|
|
'method': 'GET',
|
|
'headers': {},
|
|
'body_type': 'none',
|
|
'body': {},
|
|
'queryParams': {},
|
|
},
|
|
})
|
|
|
|
|
|
describe('flow retry', () => {
|
|
const context = FlowExecutorContext.empty()
|
|
it('should retry entire flow', async () => {
|
|
const failedResult = await flowExecutor.execute({
|
|
action: failedHttpAction, executionState: context, constants: generateMockEngineConstants(),
|
|
})
|
|
const retryEntireFlow = await flowExecutor.execute({
|
|
action: successHttpAction, executionState: context, constants: generateMockEngineConstants(),
|
|
})
|
|
expect(failedResult.verdict.status).toBe(FlowRunStatus.FAILED)
|
|
expect(retryEntireFlow.verdict.status).toBe(FlowRunStatus.RUNNING)
|
|
}, 10000)
|
|
|
|
it('should retry flow from failed step', async () => {
|
|
const failedResult = await flowExecutor.execute({
|
|
action: failedHttpAction, executionState: context, constants: generateMockEngineConstants(),
|
|
})
|
|
|
|
const retryFromFailed = await flowExecutor.execute({
|
|
action: successHttpAction, executionState: context, constants: generateMockEngineConstants({}),
|
|
})
|
|
expect(failedResult.verdict.status).toBe(FlowRunStatus.FAILED)
|
|
expect(retryFromFailed.verdict.status).toBe(FlowRunStatus.RUNNING)
|
|
}, 10000)
|
|
})
|