Skip to content

Commit

Permalink
fix(tracing): store relative video path in the trace (#4710)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgozman authored Dec 14, 2020
1 parent e91eee8 commit ab63063
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/trace/tracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,12 @@ class ContextTracer implements SnapshotterDelegate, ActionListener {
private _eventListeners: RegisteredListener[];
private _disposed = false;
private _pageToId = new Map<Page, string>();
private _traceFile: string;

constructor(context: BrowserContext, traceStorageDir: string, traceFile: string) {
this._context = context;
this._contextId = 'context@' + createGuid();
this._traceFile = traceFile;
this._traceStoragePromise = mkdirIfNeeded(path.join(traceStorageDir, 'sha1')).then(() => traceStorageDir);
this._appendEventChain = mkdirIfNeeded(traceFile).then(() => traceFile);
this._writeArtifactChain = Promise.resolve();
Expand Down Expand Up @@ -162,7 +164,7 @@ class ContextTracer implements SnapshotterDelegate, ActionListener {
type: 'page-video',
contextId: this._contextId,
pageId,
fileName: path.basename(video._path),
fileName: path.relative(path.dirname(this._traceFile), video._path),
};
this._appendTraceEvent(event);
});
Expand Down

0 comments on commit ab63063

Please sign in to comment.