Clarify how to run CLI tests locally

Also, remove an errant `only`, which was preventing some tests from
running.
This commit is contained in:
Andrew Eisenberg 2021-01-20 09:14:01 -08:00
Родитель 9c72e81264
Коммит 044bc30d96
3 изменённых файлов: 10 добавлений и 3 удалений

3
.vscode/launch.json поставляемый
Просмотреть файл

@ -89,6 +89,9 @@
"--extensionDevelopmentPath=${workspaceRoot}/extensions/ql-vscode",
"--extensionTestsPath=${workspaceRoot}/extensions/ql-vscode/out/vscode-tests/cli-integration/index",
"${workspaceRoot}/extensions/ql-vscode/src/vscode-tests/cli-integration/data",
// Add a path to a checked out instance of the codeql repository so the libraries are
// available in the workspace for the tests.
// "${workspaceRoot}/../codeql"
],
"stopOnEntry": false,
"sourceMaps": true,

Просмотреть файл

@ -40,7 +40,7 @@ describe('Use cli', function() {
]);
});
it.only('should resolve query packs', async function() {
it('should resolve query packs', async function() {
skipIfNoCodeQL(this);
const qlpacks = await cli.resolveQlpacks(getOnDiskWorkspaceFolders());
// should have a bunch of qlpacks. just check that a few known ones exist

Просмотреть файл

@ -72,7 +72,7 @@ export async function ensureCli(useCli: boolean) {
console.log('Total content size', Math.round(contentLength / _1MB), 'MB');
const archiveFile = fs.createWriteStream(downloadedFilePath);
const body = assetStream.body;
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
let numBytesDownloaded = 0;
let lastMessage = 0;
body.on('data', (data) => {
@ -117,7 +117,11 @@ function hasCodeQL() {
export function skipIfNoCodeQL(context: Mocha.Context) {
if (!hasCodeQL()) {
console.log('The CodeQL libraries are not available as a folder in this workspace. To fix: checkout the github/codeql repository and set the TEST_CODEQL_PATH environment variable to the checked out directory.');
console.log([
'The CodeQL libraries are not available as a folder in this workspace.',
'To fix in CI: checkout the github/codeql repository and set the \'TEST_CODEQL_PATH\' environment variable to the checked out directory.',
'To fix when running from vs code, see the comment in the launch.json file in the \'Launch Integration Tests - With CLI\' section.'
].join('\n\n'));
context.skip();
}
}