Fix GHAE CodeQL setup test
This commit is contained in:
parent
9203e314a3
commit
9f8ddbdfd7
6 changed files with 41 additions and 10 deletions
|
|
@ -27,15 +27,13 @@ setupTests(test);
|
|||
const sampleApiDetails = {
|
||||
auth: "token",
|
||||
url: "https://github.com",
|
||||
apiURL: undefined,
|
||||
registriesAuthTokens: undefined,
|
||||
apiURL: "https://api.github.com",
|
||||
};
|
||||
|
||||
const sampleGHAEApiDetails = {
|
||||
auth: "token",
|
||||
url: "https://example.githubenterprise.com",
|
||||
apiURL: undefined,
|
||||
registriesAuthTokens: undefined,
|
||||
apiURL: "https://example.githubenterprise.com/api/v3",
|
||||
};
|
||||
|
||||
let stubConfig: Config;
|
||||
|
|
@ -362,6 +360,21 @@ test("download codeql bundle from github ae endpoint", async (t) => {
|
|||
path.join(__dirname, `/../src/testdata/codeql-bundle-pinned.tar.gz`)
|
||||
);
|
||||
|
||||
sinon
|
||||
.stub(actionsUtil, "getRequiredInput")
|
||||
.withArgs("token")
|
||||
.returns(sampleGHAEApiDetails.auth);
|
||||
const requiredEnvParamStub = sinon.stub(util, "getRequiredEnvParam");
|
||||
requiredEnvParamStub
|
||||
.withArgs("GITHUB_SERVER_URL")
|
||||
.returns(sampleGHAEApiDetails.url);
|
||||
requiredEnvParamStub
|
||||
.withArgs("GITHUB_API_URL")
|
||||
.returns(sampleGHAEApiDetails.apiURL);
|
||||
|
||||
sinon.stub(actionsUtil, "isRunningLocalAction").returns(false);
|
||||
process.env["GITHUB_ACTION_REPOSITORY"] = "github/codeql-action";
|
||||
|
||||
await codeql.setupCodeQL(
|
||||
undefined,
|
||||
sampleGHAEApiDetails,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue