Files
smoothschedule/activepieces-fork/packages/engine/test/handler/flow-rerun.test.ts
poduck 3aa7199503 Add Activepieces integration for workflow automation
- 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>
2025-12-18 22:59:37 -05:00

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)
})