@finos/legend-graph 22.2.2 → 22.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/graph/metamodel/pure/test/result/RunTestsTestableInput.d.ts +2 -2
- package/lib/graph/metamodel/pure/test/result/TestResult.d.ts +9 -4
- package/lib/graph/metamodel/pure/test/result/TestResult.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/test/result/TestResult.js +13 -4
- package/lib/graph/metamodel/pure/test/result/TestResult.js.map +1 -1
- package/lib/graph/metamodel/pure/test/result/{AtomicTestId.d.ts → UniqueTestId.d.ts} +2 -2
- package/lib/graph/metamodel/pure/test/result/UniqueTestId.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/test/result/{AtomicTestId.js → UniqueTestId.js} +2 -2
- package/lib/graph/metamodel/pure/test/result/{AtomicTestId.js.map → UniqueTestId.js.map} +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js +10 -8
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/test/V1_RunTestsInput.d.ts +2 -2
- package/lib/graphManager/protocol/pure/v1/engine/test/V1_RunTestsInput.js +2 -2
- package/lib/graphManager/protocol/pure/v1/model/test/{V1_AtomicTestId.d.ts → V1_UniqueTestId.d.ts} +2 -2
- package/lib/graphManager/protocol/pure/v1/model/test/V1_UniqueTestId.d.ts.map +1 -0
- package/lib/graphManager/protocol/pure/v1/model/test/{V1_AtomicTestId.js → V1_UniqueTestId.js} +2 -2
- package/lib/graphManager/protocol/pure/v1/model/test/V1_UniqueTestId.js.map +1 -0
- package/lib/graphManager/protocol/pure/v1/model/test/result/V1_TestResult.d.ts +5 -5
- package/lib/graphManager/protocol/pure/v1/model/test/result/V1_TestResult.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/model/test/result/V1_TestResult.js +3 -3
- package/lib/graphManager/protocol/pure/v1/model/test/result/V1_TestResult.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestResultBuilderHelper.d.ts +3 -4
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestResultBuilderHelper.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestResultBuilderHelper.js +24 -32
- package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestResultBuilderHelper.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.d.ts +4 -5
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.js +15 -18
- package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.js.map +1 -1
- package/lib/index.d.ts +1 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -3
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/src/graph/metamodel/pure/test/result/RunTestsTestableInput.ts +2 -2
- package/src/graph/metamodel/pure/test/result/TestResult.ts +15 -4
- package/src/graph/metamodel/pure/test/result/{AtomicTestId.ts → UniqueTestId.ts} +1 -1
- package/src/graphManager/protocol/pure/v1/V1_PureGraphManager.ts +15 -8
- package/src/graphManager/protocol/pure/v1/engine/test/V1_RunTestsInput.ts +4 -4
- package/src/graphManager/protocol/pure/v1/model/test/{V1_AtomicTestId.ts → V1_UniqueTestId.ts} +1 -1
- package/src/graphManager/protocol/pure/v1/model/test/result/V1_TestResult.ts +5 -4
- package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestResultBuilderHelper.ts +38 -44
- package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.ts +15 -19
- package/src/index.ts +1 -3
- package/tsconfig.json +2 -4
- package/lib/graph/metamodel/pure/test/TestBatch.d.ts +0 -24
- package/lib/graph/metamodel/pure/test/TestBatch.d.ts.map +0 -1
- package/lib/graph/metamodel/pure/test/TestBatch.js +0 -21
- package/lib/graph/metamodel/pure/test/TestBatch.js.map +0 -1
- package/lib/graph/metamodel/pure/test/result/AtomicTestId.d.ts.map +0 -1
- package/lib/graphManager/protocol/pure/v1/model/test/V1_AtomicTestId.d.ts.map +0 -1
- package/lib/graphManager/protocol/pure/v1/model/test/V1_AtomicTestId.js.map +0 -1
- package/lib/graphManager/protocol/pure/v1/model/test/V1_TestBatch.d.ts +0 -24
- package/lib/graphManager/protocol/pure/v1/model/test/V1_TestBatch.d.ts.map +0 -1
- package/lib/graphManager/protocol/pure/v1/model/test/V1_TestBatch.js +0 -21
- package/lib/graphManager/protocol/pure/v1/model/test/V1_TestBatch.js.map +0 -1
- package/src/graph/metamodel/pure/test/TestBatch.ts +0 -26
- package/src/graphManager/protocol/pure/v1/model/test/V1_TestBatch.ts +0 -26
|
@@ -219,13 +219,14 @@ import {
|
|
|
219
219
|
V1_RunTestsInput,
|
|
220
220
|
V1_RunTestsTestableInput,
|
|
221
221
|
} from './engine/test/V1_RunTestsInput.js';
|
|
222
|
-
import {
|
|
222
|
+
import { V1_UniqueTestId } from './model/test/V1_UniqueTestId.js';
|
|
223
223
|
import type { RunTestsTestableInput } from '../../../../graph/metamodel/pure/test/result/RunTestsTestableInput.js';
|
|
224
224
|
import { V1_buildTestsResult } from './engine/test/V1_RunTestsResult.js';
|
|
225
225
|
import {
|
|
226
226
|
type TestResult,
|
|
227
|
-
TestFailed,
|
|
228
227
|
TestError,
|
|
228
|
+
TestExecuted,
|
|
229
|
+
TestExecutionStatus,
|
|
229
230
|
} from '../../../../graph/metamodel/pure/test/result/TestResult.js';
|
|
230
231
|
import {
|
|
231
232
|
type Service,
|
|
@@ -1751,7 +1752,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1751
1752
|
const runTestableInput = new V1_RunTestsTestableInput();
|
|
1752
1753
|
runTestableInput.testable = testable;
|
|
1753
1754
|
runTestableInput.unitTestIds = input.unitTestIds.map((unit) => {
|
|
1754
|
-
const unitAtomicTest = new
|
|
1755
|
+
const unitAtomicTest = new V1_UniqueTestId();
|
|
1755
1756
|
unitAtomicTest.testSuiteId = unit.parentSuite?.id;
|
|
1756
1757
|
unitAtomicTest.atomicTestId = unit.atomicTest.id;
|
|
1757
1758
|
return unitAtomicTest;
|
|
@@ -1786,7 +1787,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1786
1787
|
const runTestsInput = new V1_RunTestsInput();
|
|
1787
1788
|
runTestsInput.model = this.getFullGraphModelData(graph);
|
|
1788
1789
|
const runTestableInput = new V1_RunTestsTestableInput();
|
|
1789
|
-
const unitAtomicTest = new
|
|
1790
|
+
const unitAtomicTest = new V1_UniqueTestId();
|
|
1790
1791
|
runTestableInput.testable = guaranteeNonNullable(
|
|
1791
1792
|
getNullableIDFromTestable(
|
|
1792
1793
|
testable,
|
|
@@ -1813,7 +1814,10 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1813
1814
|
);
|
|
1814
1815
|
const result = results[0];
|
|
1815
1816
|
let status: AssertFail | undefined = undefined;
|
|
1816
|
-
if (
|
|
1817
|
+
if (
|
|
1818
|
+
result instanceof TestExecuted &&
|
|
1819
|
+
result.testExecutionStatus === TestExecutionStatus.FAIL
|
|
1820
|
+
) {
|
|
1817
1821
|
status = result.assertStatuses.find(
|
|
1818
1822
|
(aStatus) =>
|
|
1819
1823
|
aStatus.assertion === baseAssertion &&
|
|
@@ -1822,7 +1826,10 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1822
1826
|
} else if (result instanceof MultiExecutionServiceTestResult) {
|
|
1823
1827
|
status = Array.from(result.keyIndexedTestResults.values())
|
|
1824
1828
|
.map((testResult) => {
|
|
1825
|
-
if (
|
|
1829
|
+
if (
|
|
1830
|
+
testResult instanceof TestExecuted &&
|
|
1831
|
+
testResult.testExecutionStatus === TestExecutionStatus.FAIL
|
|
1832
|
+
) {
|
|
1826
1833
|
return testResult.assertStatuses.find(
|
|
1827
1834
|
(aStatus) =>
|
|
1828
1835
|
aStatus.assertion === baseAssertion &&
|
|
@@ -2519,7 +2526,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2519
2526
|
|
|
2520
2527
|
// ---------------------------------------- Analysis ----------------------------------------
|
|
2521
2528
|
|
|
2522
|
-
|
|
2529
|
+
buildPureModelContextDataFromPureModel = (
|
|
2523
2530
|
graph: PureModel,
|
|
2524
2531
|
): V1_PureModelContextData => {
|
|
2525
2532
|
const graphData = this.getFullGraphModelData(graph);
|
|
@@ -2557,7 +2564,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2557
2564
|
const input = new V1_MappingModelCoverageAnalysisInput();
|
|
2558
2565
|
input.clientVersion = V1_PureGraphManager.TARGET_PROTOCOL_VERSION;
|
|
2559
2566
|
input.mapping = mapping.path;
|
|
2560
|
-
input.model = this.
|
|
2567
|
+
input.model = this.buildPureModelContextDataFromPureModel(graph);
|
|
2561
2568
|
return V1_buildModelCoverageAnalysisResult(
|
|
2562
2569
|
await this.engine.analyzeMappingModelCoverage(input),
|
|
2563
2570
|
);
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
import { SerializationFactory, usingModelSchema } from '@finos/legend-shared';
|
|
18
18
|
import { createModelSchema, object, primitive, list } from 'serializr';
|
|
19
19
|
import { V1_PureModelContextData } from '../../model/context/V1_PureModelContextData.js';
|
|
20
|
-
import type {
|
|
21
|
-
import {
|
|
20
|
+
import type { V1_UniqueTestId } from '../../model/test/V1_UniqueTestId.js';
|
|
21
|
+
import { V1_uniqueTestIdModelSchema } from '../../transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.js';
|
|
22
22
|
|
|
23
23
|
export class V1_RunTestsTestableInput {
|
|
24
24
|
testable!: string;
|
|
25
|
-
unitTestIds:
|
|
25
|
+
unitTestIds: V1_UniqueTestId[] = [];
|
|
26
26
|
|
|
27
27
|
static readonly serialization = new SerializationFactory(
|
|
28
28
|
createModelSchema(V1_RunTestsTestableInput, {
|
|
29
29
|
testable: primitive(),
|
|
30
|
-
unitTestIds: list(usingModelSchema(
|
|
30
|
+
unitTestIds: list(usingModelSchema(V1_uniqueTestIdModelSchema)),
|
|
31
31
|
}),
|
|
32
32
|
);
|
|
33
33
|
}
|
|
@@ -14,19 +14,20 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import type { TestExecutionStatus } from '../../../../../../../graph/metamodel/pure/test/result/TestResult.js';
|
|
17
18
|
import type { V1_AssertionStatus } from '../assertion/status/V1_AssertionStatus.js';
|
|
18
|
-
import type { V1_AtomicTestId } from '../V1_AtomicTestId.js';
|
|
19
19
|
|
|
20
20
|
export abstract class V1_TestResult {
|
|
21
21
|
testable!: string;
|
|
22
|
-
atomicTestId!:
|
|
22
|
+
atomicTestId!: string;
|
|
23
|
+
testSuiteId?: string | undefined;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export class V1_TestError extends V1_TestResult {
|
|
26
27
|
error!: string;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
export class
|
|
30
|
-
|
|
30
|
+
export class V1_TestExecuted extends V1_TestResult {
|
|
31
|
+
testExecutionStatus!: TestExecutionStatus;
|
|
31
32
|
assertStatuses: V1_AssertionStatus[] = [];
|
|
32
33
|
}
|
|
@@ -25,12 +25,10 @@ import { AssertFail } from '../../../../../../../../graph/metamodel/pure/test/as
|
|
|
25
25
|
import type { AssertionStatus } from '../../../../../../../../graph/metamodel/pure/test/assertion/status/AssertionStatus.js';
|
|
26
26
|
import { AssertPass } from '../../../../../../../../graph/metamodel/pure/test/assertion/status/AssertPass.js';
|
|
27
27
|
import { EqualToJsonAssertFail } from '../../../../../../../../graph/metamodel/pure/test/assertion/status/EqualToJsonAssertFail.js';
|
|
28
|
-
import { AtomicTestId } from '../../../../../../../../graph/metamodel/pure/test/result/AtomicTestId.js';
|
|
29
28
|
import {
|
|
30
29
|
type TestResult,
|
|
31
30
|
TestError,
|
|
32
|
-
|
|
33
|
-
TestPassed,
|
|
31
|
+
TestExecuted,
|
|
34
32
|
} from '../../../../../../../../graph/metamodel/pure/test/result/TestResult.js';
|
|
35
33
|
import {
|
|
36
34
|
AtomicTest,
|
|
@@ -44,33 +42,35 @@ import { V1_AssertPass } from '../../../../model/test/assertion/status/V1_Assert
|
|
|
44
42
|
import { V1_EqualToJsonAssertFail } from '../../../../model/test/assertion/status/V1_EqualToJsonAssertFail.js';
|
|
45
43
|
import {
|
|
46
44
|
type V1_TestResult,
|
|
47
|
-
|
|
48
|
-
V1_TestPassed,
|
|
45
|
+
V1_TestExecuted,
|
|
49
46
|
V1_TestError,
|
|
50
47
|
} from '../../../../model/test/result/V1_TestResult.js';
|
|
51
|
-
import type { V1_AtomicTestId } from '../../../../model/test/V1_AtomicTestId.js';
|
|
52
48
|
import type { PureProtocolProcessorPlugin } from '../../../../../PureProtocolProcessorPlugin.js';
|
|
53
49
|
import type { Testable_PureProtocolProcessorPlugin_Extension } from '../../../../../Testable_PureProtocolProcessorPlugin_Extension.js';
|
|
54
50
|
|
|
55
|
-
const
|
|
56
|
-
element: V1_AtomicTestId,
|
|
51
|
+
const buildTestSuite = (
|
|
57
52
|
testable: Testable,
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
testSuiteId?: string | undefined,
|
|
54
|
+
): TestSuite | undefined =>
|
|
55
|
+
testable.tests
|
|
60
56
|
.filter(filterByType(TestSuite))
|
|
61
|
-
.find((t) => t.id ===
|
|
62
|
-
|
|
57
|
+
.find((t) => t.id === testSuiteId);
|
|
58
|
+
|
|
59
|
+
const buildAtomicTest = (
|
|
60
|
+
testable: Testable,
|
|
61
|
+
atomicTestId: string,
|
|
62
|
+
testSuite?: TestSuite,
|
|
63
|
+
): AtomicTest => {
|
|
63
64
|
if (testSuite) {
|
|
64
|
-
|
|
65
|
-
testSuite.tests.find((aT) => aT.id ===
|
|
65
|
+
return guaranteeNonNullable(
|
|
66
|
+
testSuite.tests.find((aT) => aT.id === atomicTestId),
|
|
66
67
|
);
|
|
67
68
|
} else {
|
|
68
|
-
|
|
69
|
-
testable.tests.find((e) => e.id ===
|
|
69
|
+
return guaranteeType(
|
|
70
|
+
testable.tests.find((e) => e.id === atomicTestId),
|
|
70
71
|
AtomicTest,
|
|
71
72
|
);
|
|
72
73
|
}
|
|
73
|
-
return new AtomicTestId(testSuite, atomicTest);
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
const buildAssertFail = (
|
|
@@ -180,38 +180,33 @@ const buildAssertionStatus = (
|
|
|
180
180
|
}
|
|
181
181
|
throw new UnsupportedOperationError(`Can't build assertion status`, value);
|
|
182
182
|
};
|
|
183
|
+
|
|
183
184
|
export const V1_buildTestError = (
|
|
184
185
|
element: V1_TestError,
|
|
185
186
|
testable: Testable,
|
|
186
187
|
): TestError => {
|
|
187
|
-
const
|
|
188
|
+
const testSuite = buildTestSuite(testable, element.testSuiteId);
|
|
189
|
+
const atomicTest = buildAtomicTest(testable, element.atomicTestId, testSuite);
|
|
190
|
+
const testError = new TestError(testSuite, atomicTest);
|
|
188
191
|
testError.testable = testable;
|
|
189
|
-
testError.atomicTestId = buildAtomicTestId(element.atomicTestId, testable);
|
|
190
192
|
testError.error = element.error;
|
|
191
193
|
return testError;
|
|
192
194
|
};
|
|
193
|
-
|
|
194
|
-
|
|
195
|
+
|
|
196
|
+
export const V1_buildTestExecuted = (
|
|
197
|
+
element: V1_TestExecuted,
|
|
195
198
|
testable: Testable,
|
|
196
199
|
plugins: PureProtocolProcessorPlugin[],
|
|
197
|
-
):
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
): TestExecuted => {
|
|
201
|
+
const testSuite = buildTestSuite(testable, element.testSuiteId);
|
|
202
|
+
const atomicTest = buildAtomicTest(testable, element.atomicTestId, testSuite);
|
|
203
|
+
const testExecuted = new TestExecuted(testSuite, atomicTest);
|
|
204
|
+
testExecuted.testable = testable;
|
|
205
|
+
testExecuted.assertStatuses = element.assertStatuses.map((e) =>
|
|
206
|
+
buildAssertionStatus(e, atomicTest, plugins),
|
|
203
207
|
);
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
export const V1_buildTestPassed = (
|
|
208
|
-
element: V1_TestPassed,
|
|
209
|
-
testable: Testable,
|
|
210
|
-
): TestPassed => {
|
|
211
|
-
const testPassed = new TestPassed();
|
|
212
|
-
testPassed.testable = testable;
|
|
213
|
-
testPassed.atomicTestId = buildAtomicTestId(element.atomicTestId, testable);
|
|
214
|
-
return testPassed;
|
|
208
|
+
testExecuted.testExecutionStatus = element.testExecutionStatus;
|
|
209
|
+
return testExecuted;
|
|
215
210
|
};
|
|
216
211
|
|
|
217
212
|
export const V1_buildMultiExecutionServiceTestResult = (
|
|
@@ -219,9 +214,10 @@ export const V1_buildMultiExecutionServiceTestResult = (
|
|
|
219
214
|
testable: Testable,
|
|
220
215
|
plugins: PureProtocolProcessorPlugin[],
|
|
221
216
|
): MultiExecutionServiceTestResult => {
|
|
222
|
-
const
|
|
217
|
+
const testSuite = buildTestSuite(testable, element.testSuiteId);
|
|
218
|
+
const atomicTest = buildAtomicTest(testable, element.atomicTestId, testSuite);
|
|
219
|
+
const multi = new MultiExecutionServiceTestResult(testSuite, atomicTest);
|
|
223
220
|
multi.testable = testable;
|
|
224
|
-
multi.atomicTestId = buildAtomicTestId(element.atomicTestId, testable);
|
|
225
221
|
multi.keyIndexedTestResults = new Map<string, TestResult>();
|
|
226
222
|
Array.from(element.keyIndexedTestResults.entries()).forEach((result) => {
|
|
227
223
|
multi.keyIndexedTestResults.set(
|
|
@@ -237,10 +233,8 @@ export function V1_buildTestResult(
|
|
|
237
233
|
testable: Testable,
|
|
238
234
|
plugins: PureProtocolProcessorPlugin[],
|
|
239
235
|
): TestResult {
|
|
240
|
-
if (element instanceof
|
|
241
|
-
return
|
|
242
|
-
} else if (element instanceof V1_TestFailed) {
|
|
243
|
-
return V1_buildTestFailed(element, testable, plugins);
|
|
236
|
+
if (element instanceof V1_TestExecuted) {
|
|
237
|
+
return V1_buildTestExecuted(element, testable, plugins);
|
|
244
238
|
} else if (element instanceof V1_TestError) {
|
|
245
239
|
return V1_buildTestError(element, testable);
|
|
246
240
|
} else if (element instanceof V1_MultiExecutionServiceTestResult) {
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
custom,
|
|
27
27
|
deserialize,
|
|
28
28
|
list,
|
|
29
|
+
optional,
|
|
29
30
|
primitive,
|
|
30
31
|
serialize,
|
|
31
32
|
SKIP,
|
|
@@ -49,12 +50,11 @@ import type { V1_TestAssertion } from '../../../model/test/assertion/V1_TestAsse
|
|
|
49
50
|
import {
|
|
50
51
|
type V1_TestResult,
|
|
51
52
|
V1_TestError,
|
|
52
|
-
|
|
53
|
-
V1_TestPassed,
|
|
53
|
+
V1_TestExecuted,
|
|
54
54
|
} from '../../../model/test/result/V1_TestResult.js';
|
|
55
55
|
import type { V1_AtomicTest } from '../../../model/test/V1_AtomicTest.js';
|
|
56
|
-
import { V1_AtomicTestId } from '../../../model/test/V1_AtomicTestId.js';
|
|
57
56
|
import type { V1_TestSuite } from '../../../model/test/V1_TestSuite.js';
|
|
57
|
+
import { V1_UniqueTestId } from '../../../model/test/V1_UniqueTestId.js';
|
|
58
58
|
import { V1_externalFormatDataModelSchema } from './V1_DataElementSerializationHelper.js';
|
|
59
59
|
import {
|
|
60
60
|
V1_mappingTestModelSchema,
|
|
@@ -79,8 +79,7 @@ export enum V1_TestAssertionType {
|
|
|
79
79
|
|
|
80
80
|
enum V1_TestResultType {
|
|
81
81
|
TEST_ERROR = 'testError',
|
|
82
|
-
|
|
83
|
-
TEST_FAILED = 'testFailed',
|
|
82
|
+
TEST_EXECUTED = 'testExecuted',
|
|
84
83
|
MULTI_EXECUTION_TEST_RESULT = 'multiExecutionTestResult',
|
|
85
84
|
// Remove once https://github.com/finos/legend-engine/pull/808 is released
|
|
86
85
|
TEMPROARY_MULTI_EXECUTION_TEST_RESULT = 'MultiExecutionServiceTestResult',
|
|
@@ -91,7 +90,7 @@ export enum V1_TestSuiteType {
|
|
|
91
90
|
MAPPING_TEST_SUITE = 'mappingTestSuite',
|
|
92
91
|
}
|
|
93
92
|
|
|
94
|
-
export const
|
|
93
|
+
export const V1_uniqueTestIdModelSchema = createModelSchema(V1_UniqueTestId, {
|
|
95
94
|
atomicTestId: primitive(),
|
|
96
95
|
testSuiteId: primitive(),
|
|
97
96
|
});
|
|
@@ -172,26 +171,29 @@ const V1_equalToTDSModelSchema = createModelSchema(V1_EqualToTDS, {
|
|
|
172
171
|
});
|
|
173
172
|
|
|
174
173
|
export const V1_testErrorModelSchema = createModelSchema(V1_TestError, {
|
|
175
|
-
atomicTestId:
|
|
174
|
+
atomicTestId: primitive(),
|
|
176
175
|
error: primitive(),
|
|
177
176
|
testable: primitive(),
|
|
177
|
+
testSuiteId: primitive(),
|
|
178
178
|
});
|
|
179
179
|
|
|
180
|
-
export const
|
|
180
|
+
export const V1_testExecutedModelSchema = createModelSchema(V1_TestExecuted, {
|
|
181
181
|
assertStatuses: list(
|
|
182
182
|
custom(
|
|
183
183
|
(val) => V1_serializeAssertionStatus(val),
|
|
184
184
|
(val) => V1_deserializeAssertionStatus(val),
|
|
185
185
|
),
|
|
186
186
|
),
|
|
187
|
-
atomicTestId:
|
|
187
|
+
atomicTestId: primitive(),
|
|
188
188
|
testable: primitive(),
|
|
189
|
+
testExecutionStatus: primitive(),
|
|
190
|
+
testSuiteId: optional(primitive()),
|
|
189
191
|
});
|
|
190
192
|
|
|
191
193
|
export const V1_MultiExecutionServiceTestResultModelSchema = createModelSchema(
|
|
192
194
|
V1_MultiExecutionServiceTestResult,
|
|
193
195
|
{
|
|
194
|
-
atomicTestId:
|
|
196
|
+
atomicTestId: primitive(),
|
|
195
197
|
keyIndexedTestResults: custom(
|
|
196
198
|
() => SKIP,
|
|
197
199
|
(val) =>
|
|
@@ -200,24 +202,18 @@ export const V1_MultiExecutionServiceTestResultModelSchema = createModelSchema(
|
|
|
200
202
|
),
|
|
201
203
|
),
|
|
202
204
|
testable: primitive(),
|
|
205
|
+
testSuiteId: primitive(),
|
|
203
206
|
},
|
|
204
207
|
);
|
|
205
208
|
|
|
206
|
-
export const V1_testPassedModelSchema = createModelSchema(V1_TestPassed, {
|
|
207
|
-
atomicTestId: usingModelSchema(V1_atomicTestIdModelSchema),
|
|
208
|
-
testable: primitive(),
|
|
209
|
-
});
|
|
210
|
-
|
|
211
209
|
export function V1_deserializeTestResult(
|
|
212
210
|
json: PlainObject<V1_TestResult>,
|
|
213
211
|
): V1_TestResult {
|
|
214
212
|
switch (json._type) {
|
|
215
213
|
case V1_TestResultType.TEST_ERROR:
|
|
216
214
|
return deserialize(V1_testErrorModelSchema, json);
|
|
217
|
-
case V1_TestResultType.
|
|
218
|
-
return deserialize(
|
|
219
|
-
case V1_TestResultType.TEST_PASSED:
|
|
220
|
-
return deserialize(V1_testPassedModelSchema, json);
|
|
215
|
+
case V1_TestResultType.TEST_EXECUTED:
|
|
216
|
+
return deserialize(V1_testExecutedModelSchema, json);
|
|
221
217
|
case V1_TestResultType.MULTI_EXECUTION_TEST_RESULT:
|
|
222
218
|
case V1_TestResultType.TEMPROARY_MULTI_EXECUTION_TEST_RESULT:
|
|
223
219
|
return deserialize(V1_MultiExecutionServiceTestResultModelSchema, json);
|
package/src/index.ts
CHANGED
|
@@ -310,13 +310,11 @@ export * from './graph/metamodel/pure/test/assertion/status/AssertPass.js';
|
|
|
310
310
|
export * from './graph/metamodel/pure/test/assertion/status/EqualToJsonAssertFail.js';
|
|
311
311
|
export * from './graph/metamodel/pure/test/assertion/TestAssertion.js';
|
|
312
312
|
export * from './graph/metamodel/pure/test/Test.js';
|
|
313
|
-
export * from './graph/metamodel/pure/test/TestBatch.js';
|
|
314
313
|
export * from './graph/metamodel/pure/test/assertion/EqualTo.js';
|
|
315
314
|
export * from './graph/metamodel/pure/test/assertion/EqualToJson.js';
|
|
316
315
|
export * from './graph/metamodel/pure/test/assertion/EqualToTDS.js';
|
|
317
|
-
export * from './graph/metamodel/pure/test/result/
|
|
316
|
+
export * from './graph/metamodel/pure/test/result/UniqueTestId.js';
|
|
318
317
|
export * from './graphManager/protocol/pure/v1/model/test/V1_AtomicTest.js';
|
|
319
|
-
export * from './graphManager/protocol/pure/v1/model/test/V1_TestBatch.js';
|
|
320
318
|
export * from './graphManager/protocol/pure/v1/model/test/assertion/V1_EqualToJson.js';
|
|
321
319
|
export * from './graphManager/protocol/pure/v1/model/test/assertion/V1_TestAssertion.js';
|
|
322
320
|
export * from './graphManager/protocol/pure/v1/model/test/assertion/status/V1_AssertionStatus.js';
|
package/tsconfig.json
CHANGED
|
@@ -240,7 +240,6 @@
|
|
|
240
240
|
"./src/graph/metamodel/pure/rawValueSpecification/RawValueSpecification.ts",
|
|
241
241
|
"./src/graph/metamodel/pure/rawValueSpecification/RawVariableExpression.ts",
|
|
242
242
|
"./src/graph/metamodel/pure/test/Test.ts",
|
|
243
|
-
"./src/graph/metamodel/pure/test/TestBatch.ts",
|
|
244
243
|
"./src/graph/metamodel/pure/test/Testable.ts",
|
|
245
244
|
"./src/graph/metamodel/pure/test/assertion/EqualTo.ts",
|
|
246
245
|
"./src/graph/metamodel/pure/test/assertion/EqualToJson.ts",
|
|
@@ -250,9 +249,9 @@
|
|
|
250
249
|
"./src/graph/metamodel/pure/test/assertion/status/AssertPass.ts",
|
|
251
250
|
"./src/graph/metamodel/pure/test/assertion/status/AssertionStatus.ts",
|
|
252
251
|
"./src/graph/metamodel/pure/test/assertion/status/EqualToJsonAssertFail.ts",
|
|
253
|
-
"./src/graph/metamodel/pure/test/result/AtomicTestId.ts",
|
|
254
252
|
"./src/graph/metamodel/pure/test/result/RunTestsTestableInput.ts",
|
|
255
253
|
"./src/graph/metamodel/pure/test/result/TestResult.ts",
|
|
254
|
+
"./src/graph/metamodel/pure/test/result/UniqueTestId.ts",
|
|
256
255
|
"./src/graph/metamodel/pure/valueSpecification/Expression.ts",
|
|
257
256
|
"./src/graph/metamodel/pure/valueSpecification/GraphFetchTree.ts",
|
|
258
257
|
"./src/graph/metamodel/pure/valueSpecification/INTERNAL__PropagatedValue.ts",
|
|
@@ -515,10 +514,9 @@
|
|
|
515
514
|
"./src/graphManager/protocol/pure/v1/model/rawValueSpecification/V1_RawValueSpecification.ts",
|
|
516
515
|
"./src/graphManager/protocol/pure/v1/model/rawValueSpecification/V1_RawVariable.ts",
|
|
517
516
|
"./src/graphManager/protocol/pure/v1/model/test/V1_AtomicTest.ts",
|
|
518
|
-
"./src/graphManager/protocol/pure/v1/model/test/V1_AtomicTestId.ts",
|
|
519
517
|
"./src/graphManager/protocol/pure/v1/model/test/V1_Test.ts",
|
|
520
|
-
"./src/graphManager/protocol/pure/v1/model/test/V1_TestBatch.ts",
|
|
521
518
|
"./src/graphManager/protocol/pure/v1/model/test/V1_TestSuite.ts",
|
|
519
|
+
"./src/graphManager/protocol/pure/v1/model/test/V1_UniqueTestId.ts",
|
|
522
520
|
"./src/graphManager/protocol/pure/v1/model/test/assertion/V1_EqualTo.ts",
|
|
523
521
|
"./src/graphManager/protocol/pure/v1/model/test/assertion/V1_EqualToJson.ts",
|
|
524
522
|
"./src/graphManager/protocol/pure/v1/model/test/assertion/V1_EqualToTDS.ts",
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import type { Hashable } from '@finos/legend-shared';
|
|
17
|
-
import type { TestAssertion } from './assertion/TestAssertion.js';
|
|
18
|
-
export declare abstract class TestBatch implements Hashable {
|
|
19
|
-
id: string;
|
|
20
|
-
batchId: string;
|
|
21
|
-
assertions: TestAssertion[];
|
|
22
|
-
abstract get hashCode(): string;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=TestBatch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestBatch.d.ts","sourceRoot":"","sources":["../../../../../src/graph/metamodel/pure/test/TestBatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,8BAAsB,SAAU,YAAW,QAAQ;IACjD,EAAE,EAAG,MAAM,CAAC;IACZ,OAAO,EAAG,MAAM,CAAC;IACjB,UAAU,EAAE,aAAa,EAAE,CAAM;IAEjC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC;CACjC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export class TestBatch {
|
|
17
|
-
id;
|
|
18
|
-
batchId;
|
|
19
|
-
assertions = [];
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=TestBatch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestBatch.js","sourceRoot":"","sources":["../../../../../src/graph/metamodel/pure/test/TestBatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,MAAM,OAAgB,SAAS;IAC7B,EAAE,CAAU;IACZ,OAAO,CAAU;IACjB,UAAU,GAAoB,EAAE,CAAC;CAGlC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicTestId.d.ts","sourceRoot":"","sources":["../../../../../../src/graph/metamodel/pure/test/result/AtomicTestId.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAExD,qBAAa,YAAY;IACvB,WAAW,EAAE,SAAS,GAAG,SAAS,CAAC;IACnC,UAAU,EAAE,UAAU,CAAC;gBAEX,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE,YAAY,EAAE,UAAU;CAIvE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"V1_AtomicTestId.d.ts","sourceRoot":"","sources":["../../../../../../../src/graphManager/protocol/pure/v1/model/test/V1_AtomicTestId.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,qBAAa,eAAe;IAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,YAAY,EAAG,MAAM,CAAC;CACvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"V1_AtomicTestId.js","sourceRoot":"","sources":["../../../../../../../src/graphManager/protocol/pure/v1/model/test/V1_AtomicTestId.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,OAAO,eAAe;IAC1B,WAAW,CAAqB;IAChC,YAAY,CAAU;CACvB"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import type { Hashable } from '@finos/legend-shared';
|
|
17
|
-
import type { V1_TestAssertion } from './assertion/V1_TestAssertion.js';
|
|
18
|
-
export declare abstract class V1_TestBatch implements Hashable {
|
|
19
|
-
id: string;
|
|
20
|
-
batchId: string;
|
|
21
|
-
assertions: V1_TestAssertion[];
|
|
22
|
-
abstract get hashCode(): string;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=V1_TestBatch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"V1_TestBatch.d.ts","sourceRoot":"","sources":["../../../../../../../src/graphManager/protocol/pure/v1/model/test/V1_TestBatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,8BAAsB,YAAa,YAAW,QAAQ;IACpD,EAAE,EAAG,MAAM,CAAC;IACZ,OAAO,EAAG,MAAM,CAAC;IACjB,UAAU,EAAE,gBAAgB,EAAE,CAAM;IAEpC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC;CACjC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export class V1_TestBatch {
|
|
17
|
-
id;
|
|
18
|
-
batchId;
|
|
19
|
-
assertions = [];
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=V1_TestBatch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"V1_TestBatch.js","sourceRoot":"","sources":["../../../../../../../src/graphManager/protocol/pure/v1/model/test/V1_TestBatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,MAAM,OAAgB,YAAY;IAChC,EAAE,CAAU;IACZ,OAAO,CAAU;IACjB,UAAU,GAAuB,EAAE,CAAC;CAGrC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import type { Hashable } from '@finos/legend-shared';
|
|
18
|
-
import type { TestAssertion } from './assertion/TestAssertion.js';
|
|
19
|
-
|
|
20
|
-
export abstract class TestBatch implements Hashable {
|
|
21
|
-
id!: string;
|
|
22
|
-
batchId!: string;
|
|
23
|
-
assertions: TestAssertion[] = [];
|
|
24
|
-
|
|
25
|
-
abstract get hashCode(): string;
|
|
26
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import type { Hashable } from '@finos/legend-shared';
|
|
18
|
-
import type { V1_TestAssertion } from './assertion/V1_TestAssertion.js';
|
|
19
|
-
|
|
20
|
-
export abstract class V1_TestBatch implements Hashable {
|
|
21
|
-
id!: string;
|
|
22
|
-
batchId!: string;
|
|
23
|
-
assertions: V1_TestAssertion[] = [];
|
|
24
|
-
|
|
25
|
-
abstract get hashCode(): string;
|
|
26
|
-
}
|