From 4968ad8a90125ec3c03e8cc7598ab121dc6ea738 Mon Sep 17 00:00:00 2001 From: Jason Reed Date: Wed, 11 Mar 2020 09:04:59 -0400 Subject: [PATCH] Only create nonempty test suites Fixes #269. --- extensions/ql-vscode/src/test-adapter.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/extensions/ql-vscode/src/test-adapter.ts b/extensions/ql-vscode/src/test-adapter.ts index 932b53fef..a341f1131 100644 --- a/extensions/ql-vscode/src/test-adapter.ts +++ b/extensions/ql-vscode/src/test-adapter.ts @@ -168,15 +168,20 @@ export class QLTestAdapter extends DisposableObject implements TestAdapter { this._tests.fire({ type: 'started' }); const testDirectories = this.qlTestDiscovery.testDirectories; + const children = testDirectories.map( + testDirectory => QLTestAdapter.createTestSuiteInfo(testDirectory, testDirectory.name) + ); const testSuite: TestSuiteInfo = { type: 'suite', label: 'CodeQL', id: '.', - children: testDirectories.map( - testDirectory => QLTestAdapter.createTestSuiteInfo(testDirectory, testDirectory.name)) + children }; - this._tests.fire({ type: 'finished', suite: testSuite }); + this._tests.fire({ + type: 'finished', + suite: children.length > 0 ? testSuite : undefined + }); } public async run(tests: string[]): Promise {