mirror of
https://github.com/github/codeql-action.git
synced 2026-01-06 06:30:10 +08:00
Use version information to construct payload
This commit is contained in:
@@ -20,7 +20,7 @@ const sampleApiDetails = {
|
||||
url: "https://github.example.com",
|
||||
};
|
||||
|
||||
const ghesVersion = { type: "dotcom" } as util.GHESVersion;
|
||||
const gitHubVersion = { type: "dotcom" } as util.GitHubVersion;
|
||||
|
||||
// Returns the filepath of the newly-created file
|
||||
function createConfigFile(inputFileContents: string, tmpDir: string): string {
|
||||
@@ -83,7 +83,7 @@ test("load empty config", async (t) => {
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
logger
|
||||
);
|
||||
@@ -98,7 +98,7 @@ test("load empty config", async (t) => {
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
logger
|
||||
)
|
||||
@@ -135,7 +135,7 @@ test("loading config saves config", async (t) => {
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
logger
|
||||
);
|
||||
@@ -161,7 +161,7 @@ test("load input outside of workspace", async (t) => {
|
||||
tmpDir,
|
||||
getCachedCodeQL(),
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -194,7 +194,7 @@ test("load non-local input with invalid repo syntax", async (t) => {
|
||||
tmpDir,
|
||||
getCachedCodeQL(),
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -228,7 +228,7 @@ test("load non-existent input", async (t) => {
|
||||
tmpDir,
|
||||
getCachedCodeQL(),
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -298,7 +298,7 @@ test("load non-empty input", async (t) => {
|
||||
tempDir: tmpDir,
|
||||
toolCacheDir: tmpDir,
|
||||
codeQLCmd: codeQL.getPath(),
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
};
|
||||
|
||||
const languages = "javascript";
|
||||
@@ -313,7 +313,7 @@ test("load non-empty input", async (t) => {
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -374,7 +374,7 @@ test("Default queries are used", async (t) => {
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -443,7 +443,7 @@ test("Queries can be specified in config file", async (t) => {
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -506,7 +506,7 @@ test("Queries from config file can be overridden in workflow file", async (t) =>
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -567,7 +567,7 @@ test("Queries in workflow file can be used in tandem with the 'disable default q
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -618,7 +618,7 @@ test("Multiple queries can be specified in workflow file, no config file require
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -687,7 +687,7 @@ test("Queries in workflow file can be added to the set of queries without overri
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -749,7 +749,7 @@ test("Invalid queries in workflow file handled correctly", async (t) => {
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -811,7 +811,7 @@ test("API client used when reading remote config", async (t) => {
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -835,7 +835,7 @@ test("Remote config handles the case where a directory is provided", async (t) =
|
||||
tmpDir,
|
||||
getCachedCodeQL(),
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -867,7 +867,7 @@ test("Invalid format of remote config handled correctly", async (t) => {
|
||||
tmpDir,
|
||||
getCachedCodeQL(),
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -895,7 +895,7 @@ test("No detected languages", async (t) => {
|
||||
tmpDir,
|
||||
getCachedCodeQL(),
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -920,7 +920,7 @@ test("Unknown languages", async (t) => {
|
||||
tmpDir,
|
||||
getCachedCodeQL(),
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
@@ -966,7 +966,7 @@ function doInvalidInputTest(
|
||||
tmpDir,
|
||||
codeQL,
|
||||
tmpDir,
|
||||
ghesVersion,
|
||||
gitHubVersion,
|
||||
sampleApiDetails,
|
||||
getRunnerLogger(true)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user