Skip to content

Commit ba5862a

Browse files
authored
Merge pull request #4702 from JoeRobich/fix-project-selector
Fix integration tests
2 parents 216e348 + 2f9b9bb commit ba5862a

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/omnisharp/launcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
195195
if ((hasCsProjFiles && !hasSlnFile) || (hasProjectJson && !hasProjectJsonAtRoot)) {
196196
projectRootTargets.push({
197197
label: path.basename(folderPath),
198-
description: '',
198+
description: 'All contained projects',
199199
target: folderPath,
200200
directory: folderPath,
201201
kind: LaunchTargetKind.Folder

src/omnisharp/server.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,15 +551,21 @@ export class OmniSharpServer {
551551
}
552552

553553
// If there's more than one launch target, we start the server if one of the targets
554-
// matches the preferred path. Otherwise, we fire the "MultipleLaunchTargets" event,
555-
// which is handled in status.ts to display the launch target selector.
554+
// matches the preferred path.
556555
if (preferredPath) {
557556
const preferredLaunchTarget = launchTargets.find((a) => a.target === preferredPath);
558557
if (preferredLaunchTarget) {
559558
return this.restart(preferredLaunchTarget);
560559
}
561560
}
562561

562+
// When running integration tests, open the first launch target.
563+
if (process.env.RUNNING_INTEGRATION_TESTS === "true") {
564+
return this.restart(launchTargets[0]);
565+
}
566+
567+
// Otherwise, we fire the "MultipleLaunchTargets" event,
568+
// which is handled in status.ts to display the launch target selector.
563569
this._fireEvent(Events.MultipleLaunchTargets, launchTargets);
564570
return showProjectSelector(this, launchTargets);
565571
});

test/integrationTests/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import * as path from 'path';
77
import * as testRunner from '../testRunner';
88

99
export async function run() {
10+
process.env.RUNNING_INTEGRATION_TESTS = "true";
11+
1012
return testRunner.run(
1113
path.resolve(__dirname, '.'),
1214
{

0 commit comments

Comments
 (0)