Add extra integration test for packaging

Also, update the options and inputs documentation.
This commit is contained in:
Andrew Eisenberg 2021-06-24 14:50:34 -07:00
parent 6e577cfca3
commit 4087f37d90
11 changed files with 83 additions and 21 deletions

10
lib/config-utils.js generated
View file

@ -425,7 +425,7 @@ async function getDefaultConfig(languagesInput, queriesInput, packsInput, dbLoca
if (queriesInput) {
await addQueriesFromWorkflow(codeQL, queriesInput, languages, queries, tempDir, checkoutPath, apiDetails, logger);
}
const packs = (_a = parsePacksInput(packsInput, languages), (_a !== null && _a !== void 0 ? _a : {}));
const packs = (_a = parsePacksFromInput(packsInput, languages), (_a !== null && _a !== void 0 ? _a : {}));
return {
languages,
queries,
@ -584,13 +584,13 @@ function parsePacksFromConfig(packsByLanguage, languages, configFile) {
return packs;
}
exports.parsePacksFromConfig = parsePacksFromConfig;
function parsePacksInput(packsInput, languages) {
function parsePacksFromInput(packsInput, languages) {
var _a;
if (!((_a = packsInput) === null || _a === void 0 ? void 0 : _a.trim())) {
return undefined;
}
if (languages.length > 1) {
throw new Error("Cannot specify a 'packs' input in a multi-language analysis. Use a codeql-config.yml file instead and specify packs by library.");
throw new Error("Cannot specify a 'packs' input in a multi-language analysis. Use a codeql-config.yml file instead and specify packs by language.");
}
else if (languages.length === 0) {
throw new Error("No languages specified. Cannot process the packs input.");
@ -599,7 +599,7 @@ function parsePacksInput(packsInput, languages) {
if (packsInput.startsWith("+")) {
packsInput = packsInput.substring(1).trim();
if (!packsInput) {
throw new Error("Remove the '+' from the packs input.");
throw new Error("A '+' was used in the 'packs' input to specify that you wished to add some packs to your CodeQL analysis. However, no packs were specified. Please either remove the '+' or specify some packs.");
}
}
return {
@ -632,7 +632,7 @@ function toPackWithVersion(packStr, configFile) {
}
// exported for testing
function parsePacks(rawPacksFromConfig, rawPacksInput, languages, configFile) {
const packsFromInput = parsePacksInput(rawPacksInput, languages);
const packsFromInput = parsePacksFromInput(rawPacksInput, languages);
const packsFomConfig = parsePacksFromConfig(rawPacksFromConfig, languages, configFile);
if (!packsFromInput) {
return packsFomConfig;