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,
onOpenExternally?: (location: SourceLocation) => void,
revealSource?: boolean,
}> = ({ item, rootDir, onOpenExternally, revealSource }) => {
pathSeparator: string,
}> = ({ item, rootDir, onOpenExternally, revealSource, pathSeparator }) => {
const [model, setModel] = React.useState<{ model: MultiTraceModel, isLive: boolean } | undefined>();
const [counter, setCounter] = React.useState(0);
const pollTimer = React.useRef<NodeJS.Timeout | null>(null);
@ -69,7 +70,12 @@ export const TraceView: React.FC<{
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.
pollTimer.current = setTimeout(async () => {
try {

View file

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