Skip to content

Commit a24b380

Browse files
authored
Unskip build task integration tests (#81128)
Closes #80991.
1 parent 98862be commit a24b380

File tree

5 files changed

+35
-18
lines changed

5 files changed

+35
-18
lines changed

eng/build-utils.ps1

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,3 +269,21 @@ function Unsubst-TempDir() {
269269
$env:TMP=$originalTemp
270270
}
271271
}
272+
273+
function EnablePreviewSdks() {
274+
$vsInfo = LocateVisualStudio
275+
if ($vsInfo -eq $null) {
276+
# Preview SDKs are allowed when no Visual Studio instance is installed
277+
Write-Host "No Visual Studio installation found; skipping enabling preview SDKs"
278+
return
279+
}
280+
281+
$vsId = $vsInfo.instanceId
282+
$vsMajorVersion = $vsInfo.installationVersion.Split('.')[0]
283+
284+
$instanceDir = Join-Path ${env:USERPROFILE} "AppData\Local\Microsoft\VisualStudio\$vsMajorVersion.0_$vsId"
285+
Create-Directory $instanceDir
286+
$sdkFile = Join-Path $instanceDir "sdk.txt"
287+
Write-Host "Enabling preview SDKs by writing to $sdkFile"
288+
'UsePreviews=True' | Set-Content $sdkFile
289+
}

eng/build.ps1

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -541,22 +541,6 @@ function TestUsingRunTests() {
541541
}
542542
}
543543

544-
function EnablePreviewSdks() {
545-
$vsInfo = LocateVisualStudio
546-
if ($vsInfo -eq $null) {
547-
# Preview SDKs are allowed when no Visual Studio instance is installed
548-
return
549-
}
550-
551-
$vsId = $vsInfo.instanceId
552-
$vsMajorVersion = $vsInfo.installationVersion.Split('.')[0]
553-
554-
$instanceDir = Join-Path ${env:USERPROFILE} "AppData\Local\Microsoft\VisualStudio\$vsMajorVersion.0_$vsId"
555-
Create-Directory $instanceDir
556-
$sdkFile = Join-Path $instanceDir "sdk.txt"
557-
'UsePreviews=True' | Set-Content $sdkFile
558-
}
559-
560544
# Deploy our core VSIX libraries to Visual Studio via the Roslyn VSIX tool. This is an alternative to
561545
# deploying at build time.
562546
function Deploy-VsixViaTool() {

eng/enable-preview-sdks.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Set-StrictMode -version 2.0
2+
$ErrorActionPreference="Stop"
3+
4+
. (Join-Path $PSScriptRoot "build-utils.ps1")
5+
6+
EnablePreviewSdks

src/Compilers/Core/MSBuildTaskTests/TestUtilities/IntegrationTestBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ protected static ProcessResult RunCommandLineCompiler(
123123
/// <param name="overrideToolExe">
124124
/// Setting ToolExe to "csc.exe" should use the built-in compiler regardless of apphost being used or not.
125125
/// </param>
126-
[Theory(Skip = "https://github.com/dotnet/roslyn/issues/80991"), CombinatorialData]
126+
[Theory, CombinatorialData]
127127
[WorkItem("https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2615118")]
128128
public void SdkBuild_Csc(bool useSharedCompilation, bool overrideToolExe, bool useAppHost)
129129
{
@@ -195,7 +195,7 @@ class Program { static void Main() { System.Console.WriteLine("Hello from file")
195195
/// <param name="overrideToolExe">
196196
/// Setting ToolExe to "vbc.exe" should use the built-in compiler regardless of apphost being used or not.
197197
/// </param>
198-
[Theory(Skip = "https://github.com/dotnet/roslyn/issues/80991"), CombinatorialData]
198+
[Theory, CombinatorialData]
199199
[WorkItem("https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2615118")]
200200
public void SdkBuild_Vbc(bool useSharedCompilation, bool overrideToolExe, bool useAppHost)
201201
{

src/Tools/Source/RunTests/HelixTestRunner.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,13 @@ static void AppendHelixWorkItemProject(
215215
Path.Combine(workItemPayloadDir, rspFileName),
216216
GetRspFileContent(assemblyRelativeFilePaths, helixWorkItem.TestMethodNames, platform));
217217

218+
Directory.CreateSymbolicLink(
219+
path: Path.Combine(workItemPayloadDir, "eng"),
220+
pathToTarget: Path.Combine(artifactsDir, "..", "eng"));
221+
File.CreateSymbolicLink(
222+
path: Path.Combine(workItemPayloadDir, "global.json"),
223+
pathToTarget: Path.Combine(artifactsDir, "..", "global.json"));
224+
218225
var (commandFileName, commandContent) = GetHelixCommandContent(assemblyRelativeFilePaths, rspFileName, testOS);
219226
File.WriteAllText(Path.Combine(workItemPayloadDir, commandFileName), commandContent);
220227

@@ -283,6 +290,8 @@ static void AppendHelixWorkItemProject(
283290

284291
command.AppendLine(isUnix ? "env | sort" : "set");
285292

293+
command.AppendLine("powershell -ExecutionPolicy ByPass -NoProfile -File ./eng/enable-preview-sdks.ps1");
294+
286295
// Rehydrate assemblies that we need to run as part of this work item.
287296
foreach (var assemblyRelativeFilePath in assemblyRelativeFilePaths)
288297
{

0 commit comments

Comments
 (0)