mirror of
https://github.com/github/codeql-action.git
synced 2026-01-06 14:40:10 +08:00
Rename VersionOutput to VersionInfo
This commit is contained in:
@@ -27,7 +27,7 @@ import {
|
||||
SAMPLE_DOTCOM_API_DETAILS,
|
||||
SAMPLE_DEFAULT_CLI_VERSION,
|
||||
mockBundleDownloadApi,
|
||||
makeVersionOutput,
|
||||
makeVersionInfo,
|
||||
} from "./testing-utils";
|
||||
import * as util from "./util";
|
||||
import { initializeEnvironment } from "./util";
|
||||
@@ -564,9 +564,7 @@ test("databaseInitCluster() without injected codescanning config", async (t) =>
|
||||
await util.withTmpDir(async (tempDir) => {
|
||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||
sinon
|
||||
.stub(codeqlObject, "getVersion")
|
||||
.resolves(makeVersionOutput("2.10.5"));
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("2.10.5"));
|
||||
// safeWhich throws because of the test CodeQL object.
|
||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
||||
|
||||
@@ -611,7 +609,7 @@ const injectedConfigMacro = test.macro({
|
||||
sinon
|
||||
.stub(codeqlObject, "getVersion")
|
||||
.resolves(
|
||||
makeVersionOutput(
|
||||
makeVersionInfo(
|
||||
featureConfig[Feature.CliConfigFileEnabled].minimumVersion ||
|
||||
"1.0.0",
|
||||
),
|
||||
@@ -837,7 +835,7 @@ test("does not pass a code scanning config or qlconfig file to the CLI when CLI
|
||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||
// stubbed version doesn't matter. It just needs to be valid semver.
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionOutput("0.0.0"));
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("0.0.0"));
|
||||
|
||||
await codeqlObject.databaseInitCluster(
|
||||
{ ...stubConfig, tempDir },
|
||||
@@ -869,7 +867,7 @@ test("passes a code scanning config AND qlconfig to the CLI when CLI config pass
|
||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||
sinon
|
||||
.stub(codeqlObject, "getVersion")
|
||||
.resolves(makeVersionOutput(codeql.CODEQL_VERSION_INIT_WITH_QLCONFIG));
|
||||
.resolves(makeVersionInfo(codeql.CODEQL_VERSION_INIT_WITH_QLCONFIG));
|
||||
|
||||
await codeqlObject.databaseInitCluster(
|
||||
{ ...stubConfig, tempDir },
|
||||
@@ -899,9 +897,7 @@ test("passes a code scanning config BUT NOT a qlconfig to the CLI when CLI confi
|
||||
await util.withTmpDir(async (tempDir) => {
|
||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||
sinon
|
||||
.stub(codeqlObject, "getVersion")
|
||||
.resolves(makeVersionOutput("2.12.2"));
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("2.12.2"));
|
||||
|
||||
await codeqlObject.databaseInitCluster(
|
||||
{ ...stubConfig, tempDir },
|
||||
@@ -936,7 +932,7 @@ test("does not pass a qlconfig to the CLI when it is undefined", async (t: Execu
|
||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||
sinon
|
||||
.stub(codeqlObject, "getVersion")
|
||||
.resolves(makeVersionOutput(codeql.CODEQL_VERSION_INIT_WITH_QLCONFIG));
|
||||
.resolves(makeVersionInfo(codeql.CODEQL_VERSION_INIT_WITH_QLCONFIG));
|
||||
|
||||
await codeqlObject.databaseInitCluster(
|
||||
{ ...stubConfig, tempDir },
|
||||
@@ -958,7 +954,7 @@ test("does not pass a qlconfig to the CLI when it is undefined", async (t: Execu
|
||||
test("databaseInterpretResults() sets --sarif-add-baseline-file-info for 2.11.3", async (t) => {
|
||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionOutput("2.11.3"));
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("2.11.3"));
|
||||
// safeWhich throws because of the test CodeQL object.
|
||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
||||
await codeqlObject.databaseInterpretResults(
|
||||
@@ -984,7 +980,7 @@ test("databaseInterpretResults() sets --sarif-add-baseline-file-info for 2.11.3"
|
||||
test("databaseInterpretResults() does not set --sarif-add-baseline-file-info for 2.11.2", async (t) => {
|
||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionOutput("2.11.2"));
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("2.11.2"));
|
||||
// safeWhich throws because of the test CodeQL object.
|
||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
||||
await codeqlObject.databaseInterpretResults(
|
||||
@@ -1047,7 +1043,7 @@ for (const {
|
||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||
sinon
|
||||
.stub(codeqlObject, "getVersion")
|
||||
.resolves(makeVersionOutput(codeqlVersion));
|
||||
.resolves(makeVersionInfo(codeqlVersion));
|
||||
// safeWhich throws because of the test CodeQL object.
|
||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
||||
await codeqlObject.databaseInterpretResults(
|
||||
@@ -1090,7 +1086,7 @@ test("database finalize recognises JavaScript no code found error on CodeQL 2.11
|
||||
2020-09-07T17:39:53.9251124Z [2020-09-07 17:39:53] [ERROR] Spawned process exited abnormally (code 255; tried to run: [/opt/hostedtoolcache/CodeQL/0.0.0-20200630/x64/codeql/javascript/tools/autobuild.sh])`,
|
||||
);
|
||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionOutput("2.11.6"));
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("2.11.6"));
|
||||
// safeWhich throws because of the test CodeQL object.
|
||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
||||
|
||||
@@ -1107,7 +1103,7 @@ test("database finalize recognises JavaScript no code found error on CodeQL 2.11
|
||||
test("database finalize overrides no code found error on CodeQL 2.11.6", async (t) => {
|
||||
stubToolRunnerConstructor(32);
|
||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionOutput("2.11.6"));
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("2.11.6"));
|
||||
// safeWhich throws because of the test CodeQL object.
|
||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
||||
|
||||
@@ -1127,7 +1123,7 @@ test("database finalize does not override no code found error on CodeQL 2.12.4",
|
||||
"https://gh.io/troubleshooting-code-scanning/no-source-code-seen-during-build.";
|
||||
stubToolRunnerConstructor(32, cliMessage);
|
||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionOutput("2.12.4"));
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("2.12.4"));
|
||||
// safeWhich throws because of the test CodeQL object.
|
||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
||||
|
||||
@@ -1152,7 +1148,7 @@ test("runTool summarizes several fatal errors", async (t) => {
|
||||
`${heapError}\n${datasetImportError}.`;
|
||||
stubToolRunnerConstructor(32, cliStderr);
|
||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionOutput("2.12.4"));
|
||||
sinon.stub(codeqlObject, "getVersion").resolves(makeVersionInfo("2.12.4"));
|
||||
// safeWhich throws because of the test CodeQL object.
|
||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user