Skip to content

Commit

Permalink
push afterSpecTotal instead of afterSpec property
Browse files Browse the repository at this point in the history
  • Loading branch information
cacieprins committed May 9, 2024
1 parent abe9bf6 commit 6fb1a51
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion packages/server/lib/cloud/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ export type ProtocolMetadata = ArtifactMetadata & {
size: number
offset: number
}
afterSpecDurations?: AfterSpecDurations
afterSpecDurations?: AfterSpecDurations & {
afterSpecTotal: number
}
}

export type UpdateInstanceArtifactsPayload = {
Expand Down
4 changes: 3 additions & 1 deletion packages/server/lib/cloud/artifacts/artifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export interface ArtifactUploadResult {
allErrors?: Error[]
uploadDuration?: number
originalError?: Error
afterSpecDurations?: AfterSpecDurations
afterSpecDurations?: AfterSpecDurations & {
afterSpecTotal: number
}
specAccess?: {
offset: number
size: number
Expand Down
4 changes: 2 additions & 2 deletions packages/server/lib/cloud/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class ProtocolManager implements ProtocolManagerShape {
private _runnableId: string | undefined
private _captureHash: string | undefined
private _afterSpecDurations: AfterSpecDurations & {
afterSpec: number
afterSpecTotal: number
} | undefined

get protocolEnabled (): boolean {
Expand Down Expand Up @@ -181,7 +181,7 @@ export class ProtocolManager implements ProtocolManagerShape {
const durations = await this.invokeAsync('afterSpec', { isEssential: true })

this._afterSpecDurations = durations ? {
afterSpec: (performance.now() + performance.timeOrigin) - startTime,
afterSpecTotal: (performance.now() + performance.timeOrigin) - startTime,
...durations,
} : undefined

Expand Down
2 changes: 1 addition & 1 deletion system-tests/test/record_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2364,7 +2364,7 @@ describe('e2e record', () => {
},
})

expect(artifactReport?.protocol?.afterSpecDurations?.afterSpec).to.be.a('number')
expect(artifactReport?.protocol?.afterSpecDurations?.afterSpecTotal).to.be.a('number')
})
})
})
Expand Down

0 comments on commit 6fb1a51

Please sign in to comment.