follow-ups

This commit is contained in:
Max Schmitt 2024-09-09 20:37:01 +02:00
parent 5af55e7936
commit 25ff24f492
2 changed files with 9 additions and 2 deletions

View file

@ -31,7 +31,8 @@ export const TraceView: React.FC<{
rootDir?: string, rootDir?: string,
onOpenExternally?: (location: SourceLocation) => void, onOpenExternally?: (location: SourceLocation) => void,
revealSource?: boolean, revealSource?: boolean,
}> = ({ item, rootDir, onOpenExternally, revealSource }) => { pathSeparator: string,
}> = ({ item, rootDir, onOpenExternally, revealSource, pathSeparator }) => {
const [model, setModel] = React.useState<{ model: MultiTraceModel, isLive: boolean } | undefined>(); const [model, setModel] = React.useState<{ model: MultiTraceModel, isLive: boolean } | undefined>();
const [counter, setCounter] = React.useState(0); const [counter, setCounter] = React.useState(0);
const pollTimer = React.useRef<NodeJS.Timeout | null>(null); const pollTimer = React.useRef<NodeJS.Timeout | null>(null);
@ -69,7 +70,12 @@ export const TraceView: React.FC<{
return; return;
} }
const traceLocation = `${outputDir}/${artifactsFolderName(result!.workerIndex)}/traces/${item.testCase?.id}.json`; const traceLocation = [
outputDir,
artifactsFolderName(result!.workerIndex),
'traces',
`${item.testCase?.id}.json`
].join(pathSeparator);
// Start polling running test. // Start polling running test.
pollTimer.current = setTimeout(async () => { pollTimer.current = setTimeout(async () => {
try { try {

View file

@ -434,6 +434,7 @@ export const UIModeView: React.FC<{}> = ({
</div> </div>
<div className={clsx('vbox', isShowingOutput && 'hidden')}> <div className={clsx('vbox', isShowingOutput && 'hidden')}>
<TraceView <TraceView
pathSeparator={queryParams.pathSeparator}
item={selectedItem} item={selectedItem}
rootDir={testModel?.config?.rootDir} rootDir={testModel?.config?.rootDir}
revealSource={revealSource} revealSource={revealSource}