mirror of
https://github.com/github/codeql-action.git
synced 2026-01-01 04:00:24 +08:00
Bump verbosity of database finalize in debug mode
This commit is contained in:
@@ -263,6 +263,7 @@ async function finalizeDatabaseCreation(
|
||||
util.getCodeQLDatabasePath(config, language),
|
||||
threadsFlag,
|
||||
memoryFlag,
|
||||
config.debugMode,
|
||||
);
|
||||
logger.endGroup();
|
||||
}
|
||||
|
||||
@@ -873,7 +873,7 @@ test("database finalize recognises JavaScript no code found error on CodeQL 2.11
|
||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
||||
|
||||
await t.throwsAsync(
|
||||
async () => await codeqlObject.finalizeDatabase("", "", ""),
|
||||
async () => await codeqlObject.finalizeDatabase("", "", "", false),
|
||||
{
|
||||
instanceOf: util.ConfigurationError,
|
||||
message: new RegExp(
|
||||
@@ -892,7 +892,7 @@ test("database finalize overrides no code found error on CodeQL 2.11.6", async (
|
||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
||||
|
||||
await t.throwsAsync(
|
||||
async () => await codeqlObject.finalizeDatabase("", "", ""),
|
||||
async () => await codeqlObject.finalizeDatabase("", "", "", false),
|
||||
{
|
||||
instanceOf: util.ConfigurationError,
|
||||
message: new RegExp(
|
||||
@@ -915,7 +915,12 @@ test("database finalize does not override no code found error on CodeQL 2.12.4",
|
||||
|
||||
await t.throwsAsync(
|
||||
async () =>
|
||||
await codeqlObject.finalizeDatabase("db", "--threads=2", "--ram=2048"),
|
||||
await codeqlObject.finalizeDatabase(
|
||||
"db",
|
||||
"--threads=2",
|
||||
"--ram=2048",
|
||||
false,
|
||||
),
|
||||
{
|
||||
message:
|
||||
'Encountered a fatal error while running "codeql-for-testing database finalize --finalize-dataset --threads=2 --ram=2048 db". ' +
|
||||
@@ -940,7 +945,12 @@ test("runTool summarizes several fatal errors", async (t) => {
|
||||
|
||||
await t.throwsAsync(
|
||||
async () =>
|
||||
await codeqlObject.finalizeDatabase("db", "--threads=2", "--ram=2048"),
|
||||
await codeqlObject.finalizeDatabase(
|
||||
"db",
|
||||
"--threads=2",
|
||||
"--ram=2048",
|
||||
false,
|
||||
),
|
||||
{
|
||||
instanceOf: util.ConfigurationError,
|
||||
message: new RegExp(
|
||||
@@ -967,7 +977,12 @@ test("runTool outputs last line of stderr if fatal error could not be found", as
|
||||
|
||||
await t.throwsAsync(
|
||||
async () =>
|
||||
await codeqlObject.finalizeDatabase("db", "--threads=2", "--ram=2048"),
|
||||
await codeqlObject.finalizeDatabase(
|
||||
"db",
|
||||
"--threads=2",
|
||||
"--ram=2048",
|
||||
false,
|
||||
),
|
||||
{
|
||||
instanceOf: util.ConfigurationError,
|
||||
message: new RegExp(
|
||||
|
||||
@@ -100,6 +100,7 @@ export interface CodeQL {
|
||||
databasePath: string,
|
||||
threadsFlag: string,
|
||||
memoryFlag: string,
|
||||
enableDebugLogging: boolean,
|
||||
): Promise<void>;
|
||||
/**
|
||||
* Run 'codeql resolve languages'.
|
||||
@@ -715,6 +716,7 @@ export async function getCodeQLForCmd(
|
||||
databasePath: string,
|
||||
threadsFlag: string,
|
||||
memoryFlag: string,
|
||||
enableDebugLogging: boolean,
|
||||
) {
|
||||
const args = [
|
||||
"database",
|
||||
@@ -722,6 +724,9 @@ export async function getCodeQLForCmd(
|
||||
"--finalize-dataset",
|
||||
threadsFlag,
|
||||
memoryFlag,
|
||||
...(enableDebugLogging
|
||||
? [`--verbosity=${EXTRACTION_DEBUG_MODE_VERBOSITY}`]
|
||||
: []),
|
||||
...getExtraOptionsFromEnv(["database", "finalize"]),
|
||||
databasePath,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user