From e9327d8d77f228ba58ad622763d14d6c7de87932 Mon Sep 17 00:00:00 2001 From: An Phi Date: Tue, 7 Jan 2025 01:20:50 -0500 Subject: [PATCH] datacube: cleanups post #3737 --- ...aCubeQueryFilterSnapshotBuilder.data-cube-test.ts | 12 ++++-------- .../DataCubeQuerySnapshotBuilder.data-cube-test.ts | 5 +++-- ...st__DataCubeEngine.ts => TEST__DataCubeEngine.ts} | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) rename packages/legend-data-cube/src/stores/core/__tests__/{Test__DataCubeEngine.ts => TEST__DataCubeEngine.ts} (97%) diff --git a/packages/legend-data-cube/src/stores/core/__tests__/DataCubeQueryFilterSnapshotBuilder.data-cube-test.ts b/packages/legend-data-cube/src/stores/core/__tests__/DataCubeQueryFilterSnapshotBuilder.data-cube-test.ts index b29dd9cf1f..167627700d 100644 --- a/packages/legend-data-cube/src/stores/core/__tests__/DataCubeQueryFilterSnapshotBuilder.data-cube-test.ts +++ b/packages/legend-data-cube/src/stores/core/__tests__/DataCubeQueryFilterSnapshotBuilder.data-cube-test.ts @@ -33,7 +33,7 @@ import { _var, } from '../DataCubeQueryBuilderUtils.js'; import { DataCubeFunction } from '../DataCubeQueryEngine.js'; -import { Test__DataCubeEngine } from './Test__DataCubeEngine.js'; +import { TEST__DataCubeEngine } from './TEST__DataCubeEngine.js'; import { DataCubeQuery } from '../model/DataCubeQuery.js'; import { INTERNAL__DataCubeSource } from '../model/DataCubeSource.js'; @@ -80,6 +80,7 @@ describe(unitTest('Analyze and build filter snapshot'), () => { testName: FilterSnapshotAnalysisTestCase[0], lambda: FilterSnapshotAnalysisTestCase[1], ) => { + const engine = new TEST__DataCubeEngine(); const partialQuery = V1_deserializeValueSpecification( await ENGINE_TEST_SUPPORT__grammarToJSON_valueSpecification(lambda), [], @@ -92,17 +93,12 @@ describe(unitTest('Analyze and build filter snapshot'), () => { partialQuery, source, baseQuery, - new Test__DataCubeEngine().filterOperations, + engine.filterOperations, ); const query = _function(DataCubeFunction.FILTER, [ _lambda( [_var()], - [ - _filter( - snapshot.data.filter!, - new Test__DataCubeEngine().filterOperations, - ), - ], + [_filter(snapshot.data.filter!, engine.filterOperations)], ), ]); const queryString = await ENGINE_TEST_SUPPORT__JSONToGrammar_model( diff --git a/packages/legend-data-cube/src/stores/core/__tests__/DataCubeQuerySnapshotBuilder.data-cube-test.ts b/packages/legend-data-cube/src/stores/core/__tests__/DataCubeQuerySnapshotBuilder.data-cube-test.ts index 7c9e83529e..85587a00ad 100644 --- a/packages/legend-data-cube/src/stores/core/__tests__/DataCubeQuerySnapshotBuilder.data-cube-test.ts +++ b/packages/legend-data-cube/src/stores/core/__tests__/DataCubeQuerySnapshotBuilder.data-cube-test.ts @@ -27,7 +27,7 @@ import { type DataCubeQuerySnapshotBuilderTestCase, } from './DatacubeQuerySnapshotBuilderTestUtils.js'; import { DataCubeConfiguration } from '../model/DataCubeConfiguration.js'; -import { Test__DataCubeEngine } from './Test__DataCubeEngine.js'; +import { TEST__DataCubeEngine } from './TEST__DataCubeEngine.js'; const cases: DataCubeQuerySnapshotBuilderTestCase[] = [ _testCase({ @@ -155,6 +155,7 @@ describe(unitTest('Analyze and build base snapshot'), () => { configuration: DataCubeQuerySnapshotBuilderTestCase[3], error: DataCubeQuerySnapshotBuilderTestCase[4], ) => { + const engine = new TEST__DataCubeEngine(); const partialQuery = _deserializeValueSpecification( await ENGINE_TEST_SUPPORT__grammarToJSON_valueSpecification(code), ); @@ -169,7 +170,7 @@ describe(unitTest('Analyze and build base snapshot'), () => { partialQuery, source, baseQuery, - new Test__DataCubeEngine().filterOperations, + engine.filterOperations, ); expect(error).toBeUndefined(); } catch (err) { diff --git a/packages/legend-data-cube/src/stores/core/__tests__/Test__DataCubeEngine.ts b/packages/legend-data-cube/src/stores/core/__tests__/TEST__DataCubeEngine.ts similarity index 97% rename from packages/legend-data-cube/src/stores/core/__tests__/Test__DataCubeEngine.ts rename to packages/legend-data-cube/src/stores/core/__tests__/TEST__DataCubeEngine.ts index 15fba31e35..213c18a929 100644 --- a/packages/legend-data-cube/src/stores/core/__tests__/Test__DataCubeEngine.ts +++ b/packages/legend-data-cube/src/stores/core/__tests__/TEST__DataCubeEngine.ts @@ -29,7 +29,7 @@ import { } from '../DataCubeEngine.js'; import type { DataCubeSource } from '../model/DataCubeSource.js'; -export class Test__DataCubeEngine extends DataCubeEngine { +export class TEST__DataCubeEngine extends DataCubeEngine { // TODO: implement the engine endpoints for testing override processQuerySource(value: PlainObject): Promise {