Ensure that tools_download_duration_ms is int (#1513)

This commit is contained in:
Angela P Wen 2023-01-27 01:03:57 -08:00 committed by GitHub
parent b2e16761f3
commit 4664f39699
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 16 deletions

View file

@ -208,7 +208,7 @@ test("downloads and caches explicitly requested bundles that aren't in the toolc
t.assert(toolcache.find("CodeQL", `0.0.0-${version}`));
t.is(result.toolsVersion, `0.0.0-${version}`);
t.is(result.toolsSource, ToolsSource.Download);
t.is(typeof result.toolsDownloadDurationMs, "number");
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
}
t.is(toolcache.findAllVersions("CodeQL").length, 2);
@ -241,7 +241,7 @@ test("downloads an explicitly requested bundle even if a different version is ca
t.assert(toolcache.find("CodeQL", "0.0.0-20200610"));
t.deepEqual(result.toolsVersion, "0.0.0-20200610");
t.is(result.toolsSource, ToolsSource.Download);
t.not(result.toolsDownloadDurationMs, undefined);
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
});
});
@ -293,7 +293,7 @@ for (const {
t.assert(toolcache.find("CodeQL", expectedToolcacheVersion));
t.deepEqual(result.toolsVersion, cliVersion);
t.is(result.toolsSource, ToolsSource.Download);
t.not(result.toolsDownloadDurationMs, undefined);
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
});
});
}
@ -428,7 +428,7 @@ for (const variant of [util.GitHubVariant.GHAE, util.GitHubVariant.GHES]) {
);
t.deepEqual(result.toolsVersion, defaults.cliVersion);
t.is(result.toolsSource, ToolsSource.Download);
t.is(typeof result.toolsDownloadDurationMs, "number");
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
const cachedVersions = toolcache.findAllVersions("CodeQL");
t.is(cachedVersions.length, 2);
@ -461,7 +461,7 @@ test('downloads bundle if "latest" tools specified but not cached', async (t) =>
);
t.deepEqual(result.toolsVersion, defaults.cliVersion);
t.is(result.toolsSource, ToolsSource.Download);
t.is(typeof result.toolsDownloadDurationMs, "number");
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
const cachedVersions = toolcache.findAllVersions("CodeQL");
t.is(cachedVersions.length, 2);
@ -527,7 +527,7 @@ test("download codeql bundle from github ae endpoint", async (t) => {
);
t.is(result.toolsSource, ToolsSource.Download);
t.is(typeof result.toolsDownloadDurationMs, "number");
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
const cachedVersions = toolcache.findAllVersions("CodeQL");
t.is(cachedVersions.length, 1);