Skip to content

Commit 4ce14b1

Browse files
committed
Don't throw on failure to install C# extension for tests
We skip those tests in ADO anyway.
1 parent 2dba318 commit 4ce14b1

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

test/features/DebugSession.test.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,13 @@ describe("DebugSessionFeature", () => {
414414

415415
const config = await debugSessionFeature.resolveDebugConfigurationWithSubstitutedVariables(undefined, attachConfig);
416416

417-
assert.deepStrictEqual(config!.dotnetAttachConfig, foundDotnetConfig);
417+
// This config will only be present if the C# extension is installed.
418+
if (extensions.getExtension("ms-dotnettools.csharp")) {
419+
assert.ok(config);
420+
assert.deepStrictEqual(config.dotnetAttachConfig, foundDotnetConfig);
421+
} else {
422+
assert.ok(!config);
423+
}
418424
});
419425
});
420426

test/runTests.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,10 @@ function InstallExtension(vscodeExePath: string, extensionIdOrVSIXPath: string):
105105
});
106106

107107
if (installResult.status !== 0) {
108-
console.error(installResult.stderr);
109-
throw new Error(`Failed to install extension: ${installResult.stderr}`);
108+
console.error(`Failed to install extension: ${installResult.stderr}`);
109+
console.log("Binary Module Tests will fail if not skipped!");
110110
}
111+
111112
return installResult.stdout;
112113
}
113114

test/runTestsInner.ts

-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ function runTestsInner(testsRoot: string): Promise<void> {
3535
}
3636

3737
const mocha = new Mocha(config);
38-
// if (process.env.TF_BUILD) {
39-
// console.log("Detected Azure DevOps, disabling color output as ANSI escapes do not make Azure Devops happy.");
40-
// config.color = false;
41-
// }
4238

4339
// Test if files is empty
4440
const files = globSync(config.spec, { cwd: rootDir });

0 commit comments

Comments
 (0)