Merge pull request #1993 from github/elena/extend-tests
Add remote queries and variant analyses to our serialization tests
This commit is contained in:
@@ -11,14 +11,26 @@ import { CancellationTokenSource, Uri } from "vscode";
|
|||||||
import { tmpDir } from "../../../src/helpers";
|
import { tmpDir } from "../../../src/helpers";
|
||||||
import { QueryResultType } from "../../../src/pure/legacy-messages";
|
import { QueryResultType } from "../../../src/pure/legacy-messages";
|
||||||
import { QueryInProgress } from "../../../src/legacy-query-server/run-queries";
|
import { QueryInProgress } from "../../../src/legacy-query-server/run-queries";
|
||||||
|
import { RemoteQueryHistoryItem } from "../../../src/remote-queries/remote-query-history-item";
|
||||||
|
import { VariantAnalysisHistoryItem } from "../../../src/remote-queries/variant-analysis-history-item";
|
||||||
|
import { QueryHistoryInfo } from "../../../src/query-history-info";
|
||||||
|
import { createMockRemoteQueryHistoryItem } from "../../factories/remote-queries/remote-query-history-item";
|
||||||
|
import { createMockVariantAnalysisHistoryItem } from "../../factories/remote-queries/variant-analysis-history-item";
|
||||||
|
|
||||||
describe("serialize and deserialize", () => {
|
describe("serialize and deserialize", () => {
|
||||||
let infoSuccessRaw: LocalQueryInfo;
|
let infoSuccessRaw: LocalQueryInfo;
|
||||||
let infoSuccessInterpreted: LocalQueryInfo;
|
let infoSuccessInterpreted: LocalQueryInfo;
|
||||||
let infoEarlyFailure: LocalQueryInfo;
|
let infoEarlyFailure: LocalQueryInfo;
|
||||||
let infoLateFailure: LocalQueryInfo;
|
let infoLateFailure: LocalQueryInfo;
|
||||||
let infoInprogress: LocalQueryInfo;
|
let infoInProgress: LocalQueryInfo;
|
||||||
let allHistory: LocalQueryInfo[];
|
|
||||||
|
let remoteQuery1: RemoteQueryHistoryItem;
|
||||||
|
let remoteQuery2: RemoteQueryHistoryItem;
|
||||||
|
|
||||||
|
let variantAnalysis1: VariantAnalysisHistoryItem;
|
||||||
|
let variantAnalysis2: VariantAnalysisHistoryItem;
|
||||||
|
|
||||||
|
let allHistory: QueryHistoryInfo[];
|
||||||
let queryPath: string;
|
let queryPath: string;
|
||||||
let cnt = 0;
|
let cnt = 0;
|
||||||
|
|
||||||
@@ -56,13 +68,24 @@ describe("serialize and deserialize", () => {
|
|||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
infoInprogress = createMockFullQueryInfo("e");
|
infoInProgress = createMockFullQueryInfo("e");
|
||||||
|
|
||||||
|
remoteQuery1 = createMockRemoteQueryHistoryItem({});
|
||||||
|
remoteQuery2 = createMockRemoteQueryHistoryItem({});
|
||||||
|
|
||||||
|
variantAnalysis1 = createMockVariantAnalysisHistoryItem({});
|
||||||
|
variantAnalysis2 = createMockVariantAnalysisHistoryItem({});
|
||||||
|
|
||||||
allHistory = [
|
allHistory = [
|
||||||
infoSuccessRaw,
|
infoSuccessRaw,
|
||||||
infoSuccessInterpreted,
|
infoSuccessInterpreted,
|
||||||
infoEarlyFailure,
|
infoEarlyFailure,
|
||||||
infoLateFailure,
|
infoLateFailure,
|
||||||
infoInprogress,
|
infoInProgress,
|
||||||
|
remoteQuery1,
|
||||||
|
remoteQuery2,
|
||||||
|
variantAnalysis1,
|
||||||
|
variantAnalysis2,
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -72,6 +95,10 @@ describe("serialize and deserialize", () => {
|
|||||||
infoSuccessRaw,
|
infoSuccessRaw,
|
||||||
infoSuccessInterpreted,
|
infoSuccessInterpreted,
|
||||||
infoLateFailure,
|
infoLateFailure,
|
||||||
|
remoteQuery1,
|
||||||
|
remoteQuery2,
|
||||||
|
variantAnalysis1,
|
||||||
|
variantAnalysis2,
|
||||||
];
|
];
|
||||||
|
|
||||||
const allHistoryPath = join(tmpDir.name, "workspace-query-history.json");
|
const allHistoryPath = join(tmpDir.name, "workspace-query-history.json");
|
||||||
@@ -98,7 +125,7 @@ describe("serialize and deserialize", () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
expectedHistory.forEach((info) => {
|
expectedHistory.forEach((info) => {
|
||||||
if (info.completedQuery) {
|
if (info.t == "local" && info.completedQuery) {
|
||||||
(info.completedQuery as any).dispose = undefined;
|
(info.completedQuery as any).dispose = undefined;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user