Merge branch 'main' into split_builtin_custom_queries
This commit is contained in:
commit
1dc1029baf
5616 changed files with 494117 additions and 64439 deletions
23
lib/analyze.test.js
generated
23
lib/analyze.test.js
generated
|
|
@ -21,13 +21,14 @@ const util = __importStar(require("./util"));
|
|||
testing_utils_1.setupTests(ava_1.default);
|
||||
// Checks that the duration fields are populated for the correct language
|
||||
// and correct case of builtin or custom.
|
||||
ava_1.default('status report fields', async (t) => {
|
||||
ava_1.default("status report fields", async (t) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
codeql_1.setCodeQL({
|
||||
databaseAnalyze: async () => undefined
|
||||
databaseAnalyze: async () => undefined,
|
||||
});
|
||||
const memoryFlag = '';
|
||||
const threadsFlag = '';
|
||||
const memoryFlag = "";
|
||||
const addSnippetsFlag = "";
|
||||
const threadsFlag = "";
|
||||
for (const language of Object.values(languages_1.Language)) {
|
||||
const config = {
|
||||
languages: [language],
|
||||
|
|
@ -37,21 +38,23 @@ ava_1.default('status report fields', async (t) => {
|
|||
originalUserInput: {},
|
||||
tempDir: tmpDir,
|
||||
toolCacheDir: tmpDir,
|
||||
codeQLCmd: '',
|
||||
codeQLCmd: "",
|
||||
};
|
||||
fs.mkdirSync(util.getCodeQLDatabasePath(config.tempDir, language), { recursive: true });
|
||||
fs.mkdirSync(util.getCodeQLDatabasePath(config.tempDir, language), {
|
||||
recursive: true,
|
||||
});
|
||||
config.queries[language] = {
|
||||
builtin: ['foo.ql'],
|
||||
builtin: ["foo.ql"],
|
||||
custom: [],
|
||||
};
|
||||
const builtinStatusReport = await analyze_1.runQueries(tmpDir, memoryFlag, threadsFlag, config, logging_1.getRunnerLogger(true));
|
||||
const builtinStatusReport = await analyze_1.runQueries(tmpDir, memoryFlag, addSnippetsFlag, threadsFlag, config, logging_1.getRunnerLogger(true));
|
||||
t.deepEqual(Object.keys(builtinStatusReport).length, 1);
|
||||
t.true(`analyze_builtin_queries_${language}_duration_ms` in builtinStatusReport);
|
||||
config.queries[language] = {
|
||||
builtin: [],
|
||||
custom: ['foo.ql'],
|
||||
custom: ["foo.ql"],
|
||||
};
|
||||
const customStatusReport = await analyze_1.runQueries(tmpDir, memoryFlag, threadsFlag, config, logging_1.getRunnerLogger(true));
|
||||
const customStatusReport = await analyze_1.runQueries(tmpDir, memoryFlag, addSnippetsFlag, threadsFlag, config, logging_1.getRunnerLogger(true));
|
||||
t.deepEqual(Object.keys(customStatusReport).length, 1);
|
||||
t.true(`analyze_custom_queries_${language}_duration_ms` in customStatusReport);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue