Add logging for CodeQL CLI Version and add tests to the logger for it.
This commit is contained in:
parent
cbe408dfc9
commit
cff15d7117
6 changed files with 32 additions and 3 deletions
11
lib/setup-codeql.test.js
generated
11
lib/setup-codeql.test.js
generated
|
|
@ -90,8 +90,19 @@ ava_1.default.beforeEach(() => {
|
|||
await (0, util_1.withTmpDir)(async (tmpDir) => {
|
||||
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
|
||||
const source = await setupCodeql.getCodeQLSource("linked", testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, util_1.GitHubVariant.DOTCOM, logger);
|
||||
// Assert first that we got the right version of the CodeQL CLI,
|
||||
// and that we're sourcing it using the correct method for that.
|
||||
t.is(source.toolsVersion, testing_utils_1.LINKED_CLI_VERSION.cliVersion);
|
||||
t.is(source.sourceType, "download");
|
||||
// Ensure that we're adequately notifying the user of the version we're using.
|
||||
const expected_message = {
|
||||
type: "info",
|
||||
message: `Using CodeQL CLI version: ${testing_utils_1.LINKED_CLI_VERSION.cliVersion} from download.`,
|
||||
};
|
||||
loggedMessages.forEach((msg) => {
|
||||
console.log(msg.message);
|
||||
});
|
||||
t.assert(loggedMessages.includes(expected_message));
|
||||
});
|
||||
});
|
||||
(0, ava_1.default)("getCodeQLSource correctly returns bundled CLI version when tools == latest", async (t) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue