Path: blob/main/extensions/copilot/test/simulation/workbench/stores/resolvedSimulationRun.ts
13399 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import * as mobx from 'mobx';6import { ObservablePromise } from '../utils/utils';7import { SimulationRunsProvider } from './simulationBaseline';8import { SimulationRunner, TestRuns } from './simulationRunner';910/**11* Provides the current selected baseline (resolved with test runs info)12*/1314export class ResolvedSimulationRun {1516@mobx.computed17public get runs(): ObservablePromise<TestRuns[]> {18const outputFolderName = this.simulationRunsProvider.selectedBaselineRun?.name ?? '';19if (!outputFolderName) {20return ObservablePromise.resolve([]);21}22return new ObservablePromise(SimulationRunner.readFromPreviousRun(outputFolderName), []);23}2425constructor(26private readonly simulationRunsProvider: SimulationRunsProvider27) {28mobx.makeObservable(this);29}30}313233