test: remove barrier files to improve unit testing performance (#249)
* test: remove barrier files to improve unit testing performance * chore: change check-types command
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { HiveSQL, HiveSqlSplitListener, HiveSqlParserListener } from '../../filters';
|
||||
import HiveSQL, { HiveSqlSplitListener } from 'src/parser/hive';
|
||||
import { HiveSqlParserListener } from 'src/lib';
|
||||
|
||||
const validSQL1 = `INSERT INTO country_page_view
|
||||
VALUES ('Chinese', 'mumiao', 18),
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { HiveSQL } from '../../filters';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
|
||||
describe('HiveSQL Lexer tests', () => {
|
||||
const parser = new HiveSQL();
|
||||
|
@ -1,5 +1,7 @@
|
||||
import { ParseTreeListener } from 'antlr4ts/tree';
|
||||
import { HiveSQL, HiveSqlParserListener, HiveSqlParserRuleContext } from '../../filters';
|
||||
import { ParseTreeListener } from 'antlr4ts/tree/ParseTreeListener';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { ProgramContext } from 'src/lib/hive/HiveSqlParser';
|
||||
import { HiveSqlParserListener } from 'src/lib/hive/HiveSqlParserListener';
|
||||
|
||||
describe('HiveSQL Listener Tests', () => {
|
||||
const parser = new HiveSQL();
|
||||
@ -16,10 +18,7 @@ describe('HiveSQL Listener Tests', () => {
|
||||
}
|
||||
const listenTableName = new MyListener();
|
||||
|
||||
await parser.listen(
|
||||
listenTableName as ParseTreeListener,
|
||||
parseTree as HiveSqlParserRuleContext.ProgramContext
|
||||
);
|
||||
await parser.listen(listenTableName as ParseTreeListener, parseTree as ProgramContext);
|
||||
expect(result).toBe(expectTableName.toUpperCase());
|
||||
});
|
||||
test('Listener enterCreateTable', async () => {
|
||||
@ -33,10 +32,7 @@ describe('HiveSQL Listener Tests', () => {
|
||||
}
|
||||
const listenTableName = new MyListener();
|
||||
|
||||
await parser.listen(
|
||||
listenTableName as ParseTreeListener,
|
||||
parseTree as HiveSqlParserRuleContext.ProgramContext
|
||||
);
|
||||
await parser.listen(listenTableName as ParseTreeListener, parseTree as ProgramContext);
|
||||
expect(result).toBe('DROPTABLETABLE_NAME');
|
||||
});
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { CaretPosition, SyntaxContextType, HiveSQL } from '../../../filters';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { CaretPosition, SyntaxContextType } from 'src/parser/common/basic-parser-types';
|
||||
|
||||
const syntaxSql = fs.readFileSync(
|
||||
path.join(__dirname, 'fixtures', 'multipleStatement.sql'),
|
||||
|
@ -1,7 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { CaretPosition, SyntaxContextType, HiveSQL } from '../../../filters';
|
||||
import { commentOtherLine } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { CaretPosition, SyntaxContextType } from 'src/parser/common/basic-parser-types';
|
||||
import { commentOtherLine } from 'test/helper';
|
||||
|
||||
const syntaxSql = fs.readFileSync(
|
||||
path.join(__dirname, 'fixtures', 'syntaxSuggestion.sql'),
|
||||
|
@ -1,7 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { CaretPosition, HiveSQL } from '../../../filters';
|
||||
import { commentOtherLine } from '../../../helper';
|
||||
import { commentOtherLine } from 'test/helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { CaretPosition } from 'src/parser/common/basic-parser-types';
|
||||
|
||||
const tokenSql = fs.readFileSync(path.join(__dirname, 'fixtures', 'tokenSuggestion.sql'), 'utf-8');
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const features = {
|
||||
exports: readSQL(__dirname, 'export.sql'),
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const features = {
|
||||
imports: readSQL(__dirname, 'import.sql'),
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { HiveSQL } from '../../filters';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
|
||||
const randomText = `dhsdansdnkla ndjnsla ndnalks`;
|
||||
const unCompleteSQL = `CREATE TABLE`;
|
||||
|
@ -1,9 +1,8 @@
|
||||
import {
|
||||
HiveSQL,
|
||||
HiveSqlParserVisitor,
|
||||
AbstractParseTreeVisitor,
|
||||
HiveSqlParserRuleContext,
|
||||
} from '../../filters';
|
||||
import { AbstractParseTreeVisitor } from 'antlr4ts/tree/AbstractParseTreeVisitor';
|
||||
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { HiveSqlParserVisitor } from 'src/lib/hive/HiveSqlParserVisitor';
|
||||
import { ProgramContext } from 'src/lib/hive/HiveSqlParser';
|
||||
|
||||
describe('HiveSQL Visitor Tests', () => {
|
||||
const expectTableName = 'dm_gis.dlv_addr_tc_count';
|
||||
@ -27,7 +26,7 @@ describe('HiveSQL Visitor Tests', () => {
|
||||
}
|
||||
|
||||
const visitor = new MyVisitor();
|
||||
visitor.visit(parseTree as HiveSqlParserRuleContext.ProgramContext);
|
||||
visitor.visit(parseTree as ProgramContext);
|
||||
|
||||
expect(result).toBe(expectTableName);
|
||||
});
|
||||
|
Reference in New Issue
Block a user