@finos/legend-application-pure-ide
Version:
Legend Pure IDE application core
90 lines • 3.59 kB
TypeScript
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { TreeData, TreeNodeData } from '@finos/legend-art';
import { type GeneratorFn, ActionState } from '@finos/legend-shared';
import type { TestExecutionResult, TestInfo } from '../server/models/Execution.js';
import { type TestResult, PCTAdapter, TestFailureResult } from '../server/models/Test.js';
import type { PureIDEStore } from './PureIDEStore.js';
export interface TestTreeNode extends TreeNodeData {
data: TestInfo;
isLoading: boolean;
}
export declare enum TestSuiteStatus {
PASSED = "PASSED",
FAILED = "FAILED",
NONE = "NONE"
}
export declare enum TestResultType {
PASSED = "PASSED",
FAILED = "FAILED",
ERROR = "ERROR",
RUNNING = "RUNNING"
}
export declare const getTestResultById: (id: string, testResultInfo: TestResultInfo) => TestResultType;
export declare const getTestTreeNodeStatus: (node: TestTreeNode, testResultInfo: TestResultInfo) => TestResultType;
export declare class TestResultInfo {
private readonly _START_TIME;
total: number;
time: number;
passedTests: Set<string>;
failedTests: Map<string, TestFailureResult>;
testsWithError: Map<string, TestFailureResult>;
notRunTests: Set<string>;
results: Map<string, TestResult>;
constructor(allTestIds: Set<string>);
get passed(): number;
get error(): number;
get failed(): number;
get passedTestIds(): string[];
get failedTestIds(): string[];
get testWithErrorIds(): string[];
get notRunTestIds(): string[];
get numberOfTestsRun(): number;
get runPercentage(): number;
get suiteStatus(): TestSuiteStatus;
setTime(val: number): void;
addResult(result: TestResult, testId: string): void;
}
export declare class TestRunnerState {
readonly ideStore: PureIDEStore;
readonly testExecutionResult: TestExecutionResult;
readonly checkTestRunnerState: ActionState;
testResultInfo?: TestResultInfo | undefined;
allTests: Map<string, TestInfo>;
selectedTestId?: string | undefined;
readonly treeBuildingState: ActionState;
treeData?: TreeData<TestTreeNode> | undefined;
viewAsList: boolean;
readonly initState: ActionState;
adapters: PCTAdapter[];
constructor(ideStore: PureIDEStore, testExecutionResult: TestExecutionResult);
getTreeData(): TreeData<TestTreeNode>;
setViewAsList(val: boolean): void;
setSelectedTestId(val: string | undefined): void;
setTestResultInfo(val: TestResultInfo | undefined): void;
setTreeData(data: TreeData<TestTreeNode>): void;
refreshTree(): void;
initialize(): GeneratorFn<void>;
buildTestTreeData(): GeneratorFn<void>;
collapseTree(): void;
expandTree(): void;
buildTreeDataByLayer(tests: TestInfo[]): Promise<void>;
pollTestRunnerResult(): GeneratorFn<void>;
pullTestRunnerResult(testResultInfo: TestResultInfo): Promise<void>;
rerunTestSuite(): GeneratorFn<void>;
cancelTestRun(): GeneratorFn<void>;
}
//# sourceMappingURL=TestRunnerState.d.ts.map