chore: do not store empty step.attachments[] in trace

This commit is contained in:
Yury Semikhatsky 2025-01-31 15:10:09 -08:00
parent a1451c75f8
commit 5141297771
2 changed files with 3 additions and 1 deletions

View file

@ -256,7 +256,7 @@ export class TeleReporterEmitter implements ReporterV2 {
id: (step as any)[this._idSymbol],
duration: step.duration,
error: step.error,
attachments: step.attachments.map(a => result.attachments.indexOf(a)),
attachments: step.attachments.length ? step.attachments.map(a => result.attachments.indexOf(a)) : undefined,
annotations: step.annotations.length ? step.annotations : undefined,
};
}

View file

@ -278,6 +278,8 @@ export class TestTracing {
}
function serializeAttachments(attachments: Attachment[]): trace.AfterActionTraceEvent['attachments'] {
if (attachments.length === 0)
return undefined;
return attachments.filter(a => a.name !== 'trace').map(a => {
return {
name: a.name,