Remove semmle-bqrs dependency from test.
This commit is contained in:
@@ -2,8 +2,6 @@ import { expect } from 'chai';
|
|||||||
import * as fs from 'fs-extra';
|
import * as fs from 'fs-extra';
|
||||||
import 'mocha';
|
import 'mocha';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { open as bqrsOpen, ColumnValue } from 'semmle-bqrs';
|
|
||||||
import { FileReader } from 'semmle-io-node';
|
|
||||||
import * as tmp from 'tmp';
|
import * as tmp from 'tmp';
|
||||||
import * as url from 'url';
|
import * as url from 'url';
|
||||||
import { CancellationTokenSource } from 'vscode-jsonrpc';
|
import { CancellationTokenSource } from 'vscode-jsonrpc';
|
||||||
@@ -11,6 +9,7 @@ import * as messages from '../../src/messages';
|
|||||||
import * as qsClient from '../../src/queryserver-client';
|
import * as qsClient from '../../src/queryserver-client';
|
||||||
import * as cli from '../../src/cli';
|
import * as cli from '../../src/cli';
|
||||||
import { ProgressReporter, Logger } from '../../src/logging';
|
import { ProgressReporter, Logger } from '../../src/logging';
|
||||||
|
import { ColumnValue } from '../../src/bqrs-cli-types';
|
||||||
|
|
||||||
|
|
||||||
declare module 'url' {
|
declare module 'url' {
|
||||||
@@ -204,24 +203,14 @@ describe('using the query server', function() {
|
|||||||
|
|
||||||
const actualResultSets: ResultSets = {};
|
const actualResultSets: ResultSets = {};
|
||||||
it(`should be able to parse results of query ${queryName}`, async function() {
|
it(`should be able to parse results of query ${queryName}`, async function() {
|
||||||
let fileReader: FileReader | undefined;
|
await evaluationSucceeded.done();
|
||||||
try {
|
const info = await cliServer.bqrsInfo(RESULTS_PATH);
|
||||||
await evaluationSucceeded.done();
|
|
||||||
fileReader = await FileReader.open(RESULTS_PATH);
|
for (const resultSet of info["result-sets"]) {
|
||||||
const resultSetsReader = await bqrsOpen(fileReader);
|
const decoded = await cliServer.bqrsDecode(RESULTS_PATH, resultSet.name);
|
||||||
for (const reader of resultSetsReader.resultSets) {
|
actualResultSets[resultSet.name] = decoded.tuples;
|
||||||
const actualRows: ColumnValue[][] = [];
|
|
||||||
for await (const row of reader.readTuples()) {
|
|
||||||
actualRows.push(row);
|
|
||||||
}
|
|
||||||
actualResultSets[reader.schema.name] = actualRows;
|
|
||||||
}
|
|
||||||
parsedResults.resolve();
|
|
||||||
} finally {
|
|
||||||
if (fileReader) {
|
|
||||||
fileReader.dispose();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
parsedResults.resolve();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should have correct results for query ${queryName}`, async function() {
|
it(`should have correct results for query ${queryName}`, async function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user