Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/test/simulation/workbench/stores/runnerTestStatus.ts
13399 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import * as mobx from 'mobx';
7
import { TestRun } from './testRun';
8
9
10
export class RunnerTestStatus {
11
12
@mobx.observable
13
public readonly runs: TestRun[];
14
15
@mobx.observable
16
public isNowRunning: number;
17
18
@mobx.observable
19
public isCancelled: boolean;
20
21
@mobx.observable
22
public isSkipped: boolean;
23
24
constructor(
25
public readonly name: string,
26
public readonly expectedRuns: number,
27
runs: TestRun[],
28
isNowRunning: number = 0,
29
isCancelled: boolean = false,
30
isSkipped: boolean = false
31
) {
32
this.runs = runs;
33
this.isNowRunning = isNowRunning;
34
this.isCancelled = isCancelled;
35
this.isSkipped = isSkipped;
36
mobx.makeObservable(this);
37
}
38
39
public addRun(run: TestRun) {
40
this.runs.push(run);
41
this.runs.sort((a, b) => {
42
return (a.runNumber ?? 0) - (b.runNumber ?? 0);
43
});
44
}
45
}
46
47