mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Address Copilot's review comments
This commit is contained in:
@@ -15,7 +15,6 @@ import { parseLanguage } from "./start-proxy";
|
|||||||
import * as statusReport from "./status-report";
|
import * as statusReport from "./status-report";
|
||||||
import {
|
import {
|
||||||
checkExpectedLogMessages,
|
checkExpectedLogMessages,
|
||||||
createFeatures,
|
|
||||||
getRecordingLogger,
|
getRecordingLogger,
|
||||||
makeTestToken,
|
makeTestToken,
|
||||||
RecordingLogger,
|
RecordingLogger,
|
||||||
@@ -392,19 +391,22 @@ function mockOfflineFeatures(tempDir: string, logger: Logger) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test("getDownloadUrl returns fallback when `getReleaseByVersion` rejects", async (t) => {
|
test("getDownloadUrl returns fallback when `getReleaseByVersion` rejects", async (t) => {
|
||||||
|
const logger = new RecordingLogger();
|
||||||
mockGetReleaseByTag();
|
mockGetReleaseByTag();
|
||||||
|
|
||||||
const features = createFeatures([]);
|
await withTmpDir(async (tempDir) => {
|
||||||
const info = await startProxyExports.getDownloadUrl(
|
const features = mockOfflineFeatures(tempDir, logger);
|
||||||
getRunnerLogger(true),
|
const info = await startProxyExports.getDownloadUrl(
|
||||||
features,
|
getRunnerLogger(true),
|
||||||
);
|
features,
|
||||||
|
);
|
||||||
|
|
||||||
t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION);
|
t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION);
|
||||||
t.is(
|
t.is(
|
||||||
info.url,
|
info.url,
|
||||||
startProxyExports.getFallbackUrl(startProxyExports.getProxyPackage()),
|
startProxyExports.getFallbackUrl(startProxyExports.getProxyPackage()),
|
||||||
);
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test("getDownloadUrl returns fallback when there's no matching release asset", async (t) => {
|
test("getDownloadUrl returns fallback when there's no matching release asset", async (t) => {
|
||||||
|
|||||||
@@ -410,6 +410,7 @@ async function getReleaseByVersion(version: string) {
|
|||||||
* already in the toolcache, and its version.
|
* already in the toolcache, and its version.
|
||||||
*
|
*
|
||||||
* @param logger The logger to use.
|
* @param logger The logger to use.
|
||||||
|
* @param features Information about enabled features.
|
||||||
* @returns Returns the download URL and version of the proxy package we plan to use.
|
* @returns Returns the download URL and version of the proxy package we plan to use.
|
||||||
*/
|
*/
|
||||||
export async function getDownloadUrl(
|
export async function getDownloadUrl(
|
||||||
|
|||||||
Reference in New Issue
Block a user