@@ -63,69 +63,3 @@ export function incrementalSchemaLoadingSuite(
6363 } ) ;
6464 } ) ;
6565}
66-
67- export function testIncrementalSchemaLoading ( type : string ) : void {
68- describe ( `Incremental schema loading @cubejs-backend/${ type } -driver` , ( ) => {
69- jest . setTimeout ( 60 * 5 * 1000 ) ;
70-
71- const fixtures = getFixtures ( type ) ;
72- let driver : BaseDriver & {
73- stream ?: (
74- query : string ,
75- values : string [ ] ,
76- options : { highWaterMark : number } ,
77- ) => Promise < any >
78- } ;
79- let env : Environment ;
80- let inputSchemas : QuerySchemasResult [ ] ;
81- let inputTables : QueryTablesResult [ ] ;
82-
83- const suffix = `driver_${ new Date ( ) . getTime ( ) . toString ( 32 ) } ` ;
84- const tables = Object
85- . keys ( fixtures . tables )
86- . map ( ( key : string ) => `${ fixtures . tables [ key ] } _${ suffix } ` ) ;
87-
88- function execute ( name : string , test : ( ) => Promise < void > ) {
89- if ( fixtures . skip && fixtures . skip . indexOf ( name ) >= 0 ) {
90- it . skip ( name , test ) ;
91- } else {
92- it ( name , test ) ;
93- }
94- }
95-
96- beforeAll ( async ( ) => {
97- env = await runEnvironment ( type , suffix ) ;
98- if ( env . data ) {
99- process . env . CUBEJS_DB_HOST = '127.0.0.1' ;
100- process . env . CUBEJS_DB_PORT = `${ env . data . port } ` ;
101- }
102- driver = ( await getDriver ( type ) ) . source ;
103- const queries = getCreateQueries ( type , suffix ) ;
104- console . log ( `Creating ${ queries . length } fixture tables` ) ;
105- try {
106- for ( const q of queries ) {
107- await driver . query ( q ) ;
108- }
109- console . log ( `Creating ${ queries . length } fixture tables completed` ) ;
110- } catch ( e : any ) {
111- console . log ( 'Error creating fixtures' , e . stack ) ;
112- throw e ;
113- }
114- } ) ;
115-
116- afterAll ( async ( ) => {
117- try {
118- console . log ( `Dropping ${ tables . length } fixture tables` ) ;
119- for ( const t of tables ) {
120- await driver . dropTable ( t ) ;
121- }
122- console . log ( `Dropping ${ tables . length } fixture tables completed` ) ;
123- } finally {
124- await driver . release ( ) ;
125- await env . stop ( ) ;
126- }
127- } ) ;
128-
129- incrementalSchemaLoadingSuite ( execute , ( ) => driver , tables ) ;
130- } ) ;
131- }
0 commit comments