This commit is contained in:
Oleg Maslov
2026-09-02 10:14:22 +02:00
parent 0c3e2ead3b
commit b20b138fe4
771 changed files with 161561 additions and 9027 deletions

View File

@@ -253,6 +253,21 @@ describe('Template Validation', () => {
expect(errors.some(e => e.field === 'steps')).toBe(true);
});
it('rejects templates that exceed the bounded worker count', () => {
const errors = validateTemplate(makeTemplate({
steps: Array.from({ length: 500 }, (_, index) => ({
name: `step-${index}`,
role: 'analyst',
task: 'Inspect the implementation',
})),
}));
expect(errors).toContainEqual({
field: 'steps',
message: 'Workflow worker limit exceeded: 500 > 32',
});
});
it('rejects invalid aggregation', () => {
const errors = validateTemplate(makeTemplate({ aggregation: 'invalid' as unknown as WorkflowTemplate['aggregation'] }));
expect(errors.some(e => e.field === 'aggregation')).toBe(true);