mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
parent
0d334d982e
commit
1c342e3ad6
2 changed files with 9 additions and 4 deletions
|
@ -202,11 +202,12 @@ describe('lsp_indexer unit tests', function(this: any) {
|
|||
|
||||
// There are 22 files which are written in supported languages in the repo. 1 file + 1 symbol + 1 reference = 3 objects to
|
||||
// index for each file. Total doc indexed for these files should be 3 * 22 = 66.
|
||||
// The rest 158 files will only be indexed for document. So the total number of index
|
||||
// requests will be 66 + 158 = 224.
|
||||
// The rest 158 files will only be indexed for document.
|
||||
// There are also 10 binary files to be excluded.
|
||||
// So the total number of index requests will be 66 + 158 - 10 = 214.
|
||||
assert.ok(bulkSpy.calledOnce);
|
||||
assert.strictEqual(lspSendRequestSpy.callCount, 22);
|
||||
assert.strictEqual(bulkSpy.getCall(0).args[0].body.length, 224 * 2);
|
||||
assert.strictEqual(bulkSpy.getCall(0).args[0].body.length, 214 * 2);
|
||||
// @ts-ignore
|
||||
}).timeout(20000);
|
||||
|
||||
|
|
|
@ -194,7 +194,11 @@ export class GitOperations {
|
|||
async function* walk(t: Tree): AsyncIterableIterator<FileTree> {
|
||||
for (const e of t.entries()) {
|
||||
if (e.isFile() && e.filemode() !== TreeEntry.FILEMODE.LINK) {
|
||||
yield entry2Tree(e);
|
||||
const blob = await e.getBlob();
|
||||
// Ignore binary files
|
||||
if (!blob.isBinary()) {
|
||||
yield entry2Tree(e);
|
||||
}
|
||||
} else if (e.isDirectory()) {
|
||||
const subFolder = await e.getTree();
|
||||
await (yield* walk(subFolder));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue