Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ public class AdHocPayloadTests
public void MultipleFilesWithSameNameAreRefused()
{
var exception = Assert.Throws<ArgumentException>(() => new AdhocPayload(new[] { "a/b.txt", "a/c.txt", "d/b.txt" }));
Assert.Equal($"Names of files to upload have to be distinct. The following name repeats at least once: b.txt{Environment.NewLine}Parameter name: files", exception.Message);
Assert.StartsWith("Names of files to upload have to be distinct. The following name repeats at least once: b.txt", exception.Message);
Assert.Equal("files", exception.ParamName);
}

[Fact]
public void MultipleFilesWithNamesSameUpToCaseAreStillRefused()
{
var exception = Assert.Throws<ArgumentException>(() => new AdhocPayload(new[] { "a/B.txt", "a/c.txt", "d/b.txt" }));
Assert.Equal($"Names of files to upload have to be distinct. The following name repeats at least once: b.txt{Environment.NewLine}Parameter name: files", exception.Message);
Assert.StartsWith("Names of files to upload have to be distinct. The following name repeats at least once: b.txt", exception.Message);
Assert.Equal("files", exception.ParamName);
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.DotNet.Helix/Sdk/CreateXUnitWorkItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private async Task<ITaskItem> PrepareWorkItem(ITaskItem xunitProject)

Log.LogMessage($"Adding runtimeconfig and depsfile parameters for assembly {assemblyBaseName}.");
driver +=
$"--runtimeconfig {assemblyBaseName}.runtimeconfig.json --depsfile {assemblyBaseName}.deps.json ";
$"--roll-forward Major --runtimeconfig {assemblyBaseName}.runtimeconfig.json --depsfile {assemblyBaseName}.deps.json ";
}

string command = $"{driver}{xUnitRunner} {assemblyName}{(XUnitArguments != null ? " " + XUnitArguments : "")} -xml testResults.xml {arguments}";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<Import Project="$(MSBuildToolsPath)\Microsoft.NETCoreSdk.BundledVersions.props" Condition="Exists('$(MSBuildToolsPath)\Microsoft.NETCoreSdk.BundledVersions.props')" />

<PropertyGroup Condition="'$(MicrosoftDotNetHelixSdkTasksAssembly)' == ''">
<MicrosoftDotNetHelixSdkTasksAssembly Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)netcoreapp2.1/Microsoft.DotNet.Helix.Sdk.dll</MicrosoftDotNetHelixSdkTasksAssembly>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
<PropertyGroup>
<IncludeDotNetCli Condition=" '$(IncludeDotNetCli)' != 'true' ">false</IncludeDotNetCli>
<DotNetCliPackageType Condition=" '$(DotNetCliPackageType)' == '' ">runtime</DotNetCliPackageType>
<DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' AND '$(DotNetCliPackageType)' == 'runtime' ">2.1.5</DotNetCliVersion>
<DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' AND '$(DotNetCliPackageType)' == 'sdk' ">2.1.403</DotNetCliVersion>
<DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' AND '$(DotNetCliPackageType)' == 'runtime' ">$(BundledNETCoreAppPackageVersion)</DotNetCliVersion>
<DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' AND '$(DotNetCliPackageType)' == 'sdk' ">$(NETCoreSdkVersion)</DotNetCliVersion>
<DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' AND '$(DotNetCliPackageType)' == 'runtime' ">3.1.5</DotNetCliVersion>
<DotNetCliVersion Condition=" '$(DotNetCliVersion)' == '' AND '$(DotNetCliPackageType)' == 'sdk' ">3.1.301</DotNetCliVersion>
<DotNetCliChannel Condition=" '$(DotNetCliChannel)' == '' ">Current</DotNetCliChannel>
<_HelixMonoQueueTargets>$(_HelixMonoQueueTargets);$(MSBuildThisFileDirectory)DotNetCli.targets</_HelixMonoQueueTargets>
</PropertyGroup>
Expand Down
5 changes: 5 additions & 0 deletions src/Microsoft.DotNet.RemoteExecutor/src/RemoteExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,11 @@ private static string GetConsoleAppArgs(RemoteInvokeOptions options, out IEnumer
args += $" --depsfile \"{DepsJsonPath}\"";
}

if (!string.IsNullOrEmpty(options.RollForward))
{
args += $" --roll-forward {options.RollForward}";
}

args += $" \"{Path}\"";
return args;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,10 @@ public bool RunAsSudo
_runAsSudo = value;
}
}

/// <summary>
/// Specifies the roll-forward policy for dotnet cli to use. Only applies when running .NET Core
/// </summary>
public string RollForward { get; set; }
}
}
10 changes: 5 additions & 5 deletions src/Microsoft.DotNet.RemoteExecutor/tests/RemoteExecutorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void AsyncAction_ThrowException()
{
Assert.True(false);
await Task.Delay(1);
}).Dispose()
}, new RemoteInvokeOptions { RollForward = "Major" }).Dispose()
);
}

Expand All @@ -31,7 +31,7 @@ public void AsyncAction()
RemoteExecutor.Invoke(async () =>
{
await Task.Delay(1);
}).Dispose();
}, new RemoteInvokeOptions { RollForward = "Major" }).Dispose();
}

[Fact]
Expand All @@ -43,7 +43,7 @@ public void AsyncFunc_ThrowException()
Assert.True(false);
await Task.Delay(1);
return 1;
}).Dispose()
}, new RemoteInvokeOptions { RollForward = "Major" }).Dispose()
);
}

Expand All @@ -55,7 +55,7 @@ public void AsyncFunc_InvalidReturnCode()
{
await Task.Delay(1);
return 1;
}).Dispose()
}, new RemoteInvokeOptions { RollForward = "Major" }).Dispose()
);
}

Expand All @@ -66,7 +66,7 @@ public void AsyncFunc_NoThrow_ValidReturnCode()
{
await Task.Delay(1);
return RemoteExecutor.SuccessExitCode;
}).Dispose();
}, new RemoteInvokeOptions { RollForward = "Major" }).Dispose();
}
}
}
2 changes: 2 additions & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.zip
*.payload