@finos/legend-application-studio
Version:
Legend Studio application core
111 lines • 5.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 { AssertionStatus, type Testable, type TestResult, type TestAssertion, TestSuite, AtomicTest, TestError, AssertFail } from '@finos/legend-graph';
import { type GeneratorFn, ActionState } from '@finos/legend-shared';
import type { EditorSDLCState } from '../../EditorSDLCState.js';
import type { EditorStore } from '../../EditorStore.js';
import type { TestableMetadataGetter } from '../../../LegendStudioApplicationPlugin.js';
export interface TestableMetadata {
id: string;
name: string;
testable: Testable;
}
export declare const getTestableMetadata: (testable: Testable, editorStore: EditorStore, extraTestableMetadataGetters: TestableMetadataGetter[]) => TestableMetadata;
export declare abstract class TestableExplorerTreeNodeData implements TreeNodeData {
isSelected?: boolean | undefined;
isOpen?: boolean | undefined;
id: string;
label: string;
childrenIds?: string[] | undefined;
constructor(id: string, label: string);
}
export declare class TestableTreeNodeData extends TestableExplorerTreeNodeData {
testableMetadata: TestableMetadata;
isRunning: boolean;
constructor(testable: TestableMetadata);
}
export declare abstract class TestTreeNodeData extends TestableExplorerTreeNodeData {
isRunning: boolean;
constructor(id: string, label: string);
}
export declare class AtomicTestTreeNodeData extends TestTreeNodeData {
atomicTest: AtomicTest;
constructor(id: string, atomicTest: AtomicTest);
}
export declare class TestSuiteTreeNodeData extends TestTreeNodeData {
testSuite: TestSuite;
constructor(id: string, testSuite: TestSuite);
}
export declare class AssertionTestTreeNodeData extends TestableExplorerTreeNodeData {
assertion: TestAssertion;
constructor(id: string, assertion: TestAssertion);
}
export declare const getAtomicTest_TestResult: (atomicTest: AtomicTest, results: Map<AtomicTest, TestResult>) => TestResult | undefined;
export declare const getAssertionStatus: (assertion: TestAssertion, results: Map<AtomicTest, TestResult>) => AssertionStatus | Map<string, AssertionStatus> | undefined;
export declare enum TESTABLE_RESULT {
DID_NOT_RUN = "DID_NOT_RUN",
ERROR = "ERROR",
FAILED = "FAILED",
PASSED = "PASSED",
IN_PROGRESS = "IN_PROGRESS",
NO_TESTS = "NO_TESTS"
}
export declare const getTestableResultFromTestResult: (testResult: TestResult | undefined) => TESTABLE_RESULT;
export declare const getTestableResultFromAssertionStatus: (assertionStatus: AssertionStatus | Map<string, AssertionStatus> | undefined) => TESTABLE_RESULT;
export declare const getTestableResultFromTestResults: (testResults: (TestResult | undefined)[] | undefined) => TESTABLE_RESULT;
export declare const getNodeTestableResult: (node: TestableExplorerTreeNodeData, globalRun: boolean, results: Map<AtomicTest, TestResult>) => TESTABLE_RESULT;
export declare class TestableState {
readonly uuid: string;
globalTestRunnerState: GlobalTestRunnerState;
editorStore: EditorStore;
testableMetadata: TestableMetadata;
treeData: TreeData<TestableExplorerTreeNodeData>;
results: Map<AtomicTest, TestResult>;
isRunningTests: ActionState;
constructor(editorStore: EditorStore, globalTestRunnerState: GlobalTestRunnerState, testable: Testable);
run(node: TestableExplorerTreeNodeData): GeneratorFn<void>;
handleTestableResult(testResult: TestResult, openAssertions?: boolean): void;
buildTreeData(testable: TestableMetadata): TreeData<TestableExplorerTreeNodeData>;
setTreeData(data: TreeData<TestableExplorerTreeNodeData>): void;
onTreeNodeSelect(node: TestableExplorerTreeNodeData, treeData: TreeData<TestableExplorerTreeNodeData>): void;
}
export declare class GlobalTestRunnerState {
readonly editorStore: EditorStore;
readonly sdlcState: EditorSDLCState;
readonly extraTestableMetadataGetters: TestableMetadataGetter[];
isRunningTests: ActionState;
testableStates: TestableState[] | undefined;
showDependencyPanel: boolean;
isRunningDependencyTests: ActionState;
dependencyTestableStates: TestableState[] | undefined;
failureViewing: AssertFail | TestError | undefined;
constructor(editorStore: EditorStore, sdlcState: EditorSDLCState);
get ownTestableStates(): TestableState[];
get allDependencyTestablesStates(): TestableState[];
get allTestableStates(): TestableState[];
get isDispatchingOwnProjectAction(): boolean;
get isDispatchingDependencyAction(): boolean;
initOwnTestables(force?: boolean): void;
visitTestable(testable: Testable): void;
setFailureViewing(val: AssertFail | TestError | undefined): void;
runAllTests(): GeneratorFn<void>;
handleResults(testResults: TestResult[]): void;
setShowDependencyPanel(val: boolean): void;
initDependency(): void;
runDependenciesTests(): GeneratorFn<void>;
}
//# sourceMappingURL=GlobalTestRunnerState.d.ts.map