fixed Location
Signed-off-by: René <snooz@posteo.de>
This commit is contained in:
parent
edd4379078
commit
58c51f1be2
|
|
@ -51,7 +51,7 @@ export class Tracing extends ChannelOwner<channels.TracingChannel> implements ap
|
|||
await this._startCollectingStacks(traceName);
|
||||
}
|
||||
|
||||
async group(name: string, options: { location?: string } = {}) {
|
||||
async group(name: string, options: { location?: { file: string, line?: number, column?: number } } = {}) {
|
||||
await this._channel.tracingGroup({ name, options });
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,12 +26,13 @@ scheme.StackFrame = tObject({
|
|||
column: tNumber,
|
||||
function: tOptional(tString),
|
||||
});
|
||||
scheme.Metadata = tObject({
|
||||
location: tOptional(tObject({
|
||||
scheme.Location = tObject({
|
||||
file: tString,
|
||||
line: tOptional(tNumber),
|
||||
column: tOptional(tNumber),
|
||||
})),
|
||||
});
|
||||
scheme.Metadata = tObject({
|
||||
location: tOptional(tType('Location')),
|
||||
apiName: tOptional(tString),
|
||||
internal: tOptional(tBoolean),
|
||||
stepId: tOptional(tString),
|
||||
|
|
@ -2281,7 +2282,7 @@ scheme.DialogAcceptResult = tOptional(tObject({}));
|
|||
scheme.DialogDismissParams = tOptional(tObject({}));
|
||||
scheme.DialogDismissResult = tOptional(tObject({}));
|
||||
scheme.TracingGroupOptions = tObject({
|
||||
location: tString,
|
||||
location: tOptional(tType('Location')),
|
||||
});
|
||||
scheme.TracingInitializer = tOptional(tObject({}));
|
||||
scheme.TracingTracingStartParams = tObject({
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import fs from 'fs';
|
|||
import os from 'os';
|
||||
import path from 'path';
|
||||
import type { NameValue } from '../../../common/types';
|
||||
import type { TracingTracingStopChunkParams } from '@protocol/channels';
|
||||
import type { TracingTracingStopChunkParams, StackFrame } from '@protocol/channels';
|
||||
import { commandsWithTracingSnapshots } from '../../../protocol/debug';
|
||||
import { assert, createGuid, monotonicTime, SerializedFS, removeFolders, eventsHelper, type RegisteredListener } from '../../../utils';
|
||||
import { Artifact } from '../../artifact';
|
||||
|
|
@ -196,9 +196,12 @@ export class Tracing extends SdkObject implements InstrumentationListener, Snaps
|
|||
return { traceName: this._state.traceName };
|
||||
}
|
||||
|
||||
async group(name: string, options: { location?: string } = {}): Promise<void> {
|
||||
const location = options.location?.split(':', 2);
|
||||
const file = location?.[0], line = location?.[1];
|
||||
async group(name: string, options: { location?: { file: string, line?: number, column?: number } } = {}): Promise<void> {
|
||||
const stackFrame: StackFrame = {
|
||||
file: options.location?.file || '',
|
||||
line: options.location?.line || 0,
|
||||
column: options.location?.column || 0,
|
||||
};
|
||||
const event: trace.BeforeActionTraceEvent = {
|
||||
type: 'before',
|
||||
callId: `group-${this._groupId++}`,
|
||||
|
|
@ -207,7 +210,7 @@ export class Tracing extends SdkObject implements InstrumentationListener, Snaps
|
|||
class: 'Tracing',
|
||||
method: 'group',
|
||||
params: { },
|
||||
stack: [{ file: file || '', line: line ? parseInt(line, 10) : 0, column: 0 }],
|
||||
stack: [stackFrame],
|
||||
};
|
||||
this._groupStack.push(event.callId);
|
||||
this._appendTraceEvent(event);
|
||||
|
|
|
|||
|
|
@ -144,12 +144,14 @@ export type StackFrame = {
|
|||
function?: string,
|
||||
};
|
||||
|
||||
export type Metadata = {
|
||||
location?: {
|
||||
export type Location = {
|
||||
file: string,
|
||||
line?: number,
|
||||
column?: number,
|
||||
},
|
||||
};
|
||||
|
||||
export type Metadata = {
|
||||
location?: Location,
|
||||
apiName?: string,
|
||||
internal?: boolean,
|
||||
stepId?: string,
|
||||
|
|
@ -4078,7 +4080,7 @@ export interface DialogEvents {
|
|||
}
|
||||
|
||||
export type TracingGroupOptions = {
|
||||
location: string,
|
||||
location?: Location,
|
||||
};
|
||||
|
||||
// ----------- Tracing -----------
|
||||
|
|
|
|||
|
|
@ -20,17 +20,19 @@ StackFrame:
|
|||
column: number
|
||||
function: string?
|
||||
|
||||
Location:
|
||||
type: object
|
||||
properties:
|
||||
file: string
|
||||
line: number?
|
||||
column: number?
|
||||
|
||||
# This object can be send with any rpc call in the "metadata" field.
|
||||
|
||||
Metadata:
|
||||
type: object
|
||||
properties:
|
||||
location:
|
||||
type: object?
|
||||
properties:
|
||||
file: string
|
||||
line: number?
|
||||
column: number?
|
||||
location: Location?
|
||||
apiName: string?
|
||||
internal: boolean?
|
||||
# Test runner step id.
|
||||
|
|
@ -3180,7 +3182,7 @@ Dialog:
|
|||
TracingGroupOptions:
|
||||
type: object
|
||||
properties:
|
||||
location: string
|
||||
location: Location?
|
||||
|
||||
Tracing:
|
||||
type: interface
|
||||
|
|
|
|||
Loading…
Reference in a new issue