Remove local environment running

This is a functionality that never worked perfectly and hasn't been
used for a while.

This allows developers to run the action on their local machine, but
the run was always flaky and never 100% mirrored what was happening on
the actions runner.
This commit is contained in:
Andrew Eisenberg 2021-06-01 15:04:15 -07:00
parent 3708898bf2
commit 2c2ebdc5c5
19 changed files with 21 additions and 262 deletions

View file

@ -9,7 +9,6 @@ import sinon from "sinon";
import * as api from "./api-client";
import { getRunnerLogger, Logger } from "./logging";
import { setupTests } from "./testing-utils";
import { initializeEnvironment, Mode } from "./util";
import * as util from "./util";
setupTests(test);
@ -77,28 +76,6 @@ test("getThreadsFlag() throws if the threads input is not an integer", (t) => {
t.throws(() => util.getThreadsFlag("hello!", getRunnerLogger(true)));
});
test("isLocalRun() runs correctly", (t) => {
initializeEnvironment(Mode.actions, "1.2.3");
process.env.CODEQL_LOCAL_RUN = "";
t.assert(!util.isLocalRun());
process.env.CODEQL_LOCAL_RUN = "false";
t.assert(!util.isLocalRun());
process.env.CODEQL_LOCAL_RUN = "0";
t.assert(!util.isLocalRun());
process.env.CODEQL_LOCAL_RUN = "true";
t.assert(util.isLocalRun());
process.env.CODEQL_LOCAL_RUN = "hucairz";
t.assert(util.isLocalRun());
initializeEnvironment(Mode.runner, "1.2.3");
t.assert(!util.isLocalRun());
});
test("getExtraOptionsEnvParam() succeeds on valid JSON with invalid options (for now)", (t) => {
const origExtraOptions = process.env.CODEQL_ACTION_EXTRA_OPTIONS;