Remove supporting code for CodeQL 2.13.0 through 2.13.4

This commit is contained in:
Henry Mercer 2024-08-05 18:33:27 +01:00
parent a1404425d9
commit 48c11ed2ba
16 changed files with 72 additions and 122 deletions

31
lib/codeql.test.js generated
View file

@ -141,19 +141,25 @@ function mockApiDetails(apiDetails) {
});
const EXPLICITLY_REQUESTED_BUNDLE_TEST_CASES = [
{
cliVersion: "2.10.0",
expectedToolcacheVersion: "2.10.0-20200610",
cliVersion: "2.17.6",
tagName: "codeql-bundle-2.17.6",
expectedToolcacheVersion: "2.17.6",
shouldCallReleasesApi: false,
},
{
cliVersion: "2.10.0-pre",
expectedToolcacheVersion: "0.0.0-20200610",
cliVersion: "2.17.6-pre",
tagName: "codeql-bundle-20240805",
expectedToolcacheVersion: "0.0.0-20240805",
shouldCallReleasesApi: true,
},
{
cliVersion: "2.10.0+202006100101",
expectedToolcacheVersion: "0.0.0-20200610",
cliVersion: "2.17.6+202006100101",
tagName: "codeql-bundle-20240805",
expectedToolcacheVersion: "0.0.0-20240805",
shouldCallReleasesApi: true,
},
];
for (const { cliVersion, expectedToolcacheVersion, } of EXPLICITLY_REQUESTED_BUNDLE_TEST_CASES) {
for (const { cliVersion, tagName, expectedToolcacheVersion, shouldCallReleasesApi, } of EXPLICITLY_REQUESTED_BUNDLE_TEST_CASES) {
(0, ava_1.default)(`caches an explicitly requested bundle containing CLI ${cliVersion} as ${expectedToolcacheVersion}`, async (t) => {
await util.withTmpDir(async (tmpDir) => {
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
@ -161,13 +167,18 @@ for (const { cliVersion, expectedToolcacheVersion, } of EXPLICITLY_REQUESTED_BUN
sinon.stub(actionsUtil, "isRunningLocalAction").returns(true);
const releaseApiMock = mockReleaseApi({
assetNames: [`cli-version-${cliVersion}.txt`],
tagName: "codeql-bundle-20200610",
tagName,
});
const url = (0, testing_utils_1.mockBundleDownloadApi)({
tagName: "codeql-bundle-20200610",
tagName,
});
const result = await codeql.setupCodeQL(url, testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, tmpDir, util.GitHubVariant.DOTCOM, testing_utils_1.SAMPLE_DEFAULT_CLI_VERSION, (0, logging_1.getRunnerLogger)(true), false);
t.assert(releaseApiMock.isDone(), "Releases API should have been called");
if (shouldCallReleasesApi) {
t.assert(releaseApiMock.isDone(), "Releases API should have been called");
}
else {
t.false(releaseApiMock.isDone(), "Releases API should not have been called");
}
t.assert(toolcache.find("CodeQL", expectedToolcacheVersion));
t.deepEqual(result.toolsVersion, cliVersion);
t.is(result.toolsSource, setup_codeql_1.ToolsSource.Download);