diff --git a/src/Microsoft.DotNet.Helix/JobSender.Tests/Payloads/AdHocPayloadTests.cs b/src/Microsoft.DotNet.Helix/JobSender.Tests/Payloads/AdHocPayloadTests.cs index c45fa8b1bc1..2b6dd76479e 100644 --- a/src/Microsoft.DotNet.Helix/JobSender.Tests/Payloads/AdHocPayloadTests.cs +++ b/src/Microsoft.DotNet.Helix/JobSender.Tests/Payloads/AdHocPayloadTests.cs @@ -11,14 +11,16 @@ public class AdHocPayloadTests public void MultipleFilesWithSameNameAreRefused() { var exception = Assert.Throws(() => 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(() => 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] diff --git a/src/Microsoft.DotNet.Helix/Sdk/CreateXUnitWorkItems.cs b/src/Microsoft.DotNet.Helix/Sdk/CreateXUnitWorkItems.cs index 060499363cb..4754e2361dc 100644 --- a/src/Microsoft.DotNet.Helix/Sdk/CreateXUnitWorkItems.cs +++ b/src/Microsoft.DotNet.Helix/Sdk/CreateXUnitWorkItems.cs @@ -117,7 +117,7 @@ private async Task 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}"; diff --git a/src/Microsoft.DotNet.Helix/Sdk/tools/Microsoft.DotNet.Helix.Sdk.props b/src/Microsoft.DotNet.Helix/Sdk/tools/Microsoft.DotNet.Helix.Sdk.props index 13ab7424e5c..46a5001a2ad 100644 --- a/src/Microsoft.DotNet.Helix/Sdk/tools/Microsoft.DotNet.Helix.Sdk.props +++ b/src/Microsoft.DotNet.Helix/Sdk/tools/Microsoft.DotNet.Helix.Sdk.props @@ -1,6 +1,7 @@ + $(MSBuildThisFileDirectory)netcoreapp2.1/Microsoft.DotNet.Helix.Sdk.dll diff --git a/src/Microsoft.DotNet.Helix/Sdk/tools/dotnet-cli/DotNetCli.props b/src/Microsoft.DotNet.Helix/Sdk/tools/dotnet-cli/DotNetCli.props index 9c5ac4a6e46..f7b85f6c365 100644 --- a/src/Microsoft.DotNet.Helix/Sdk/tools/dotnet-cli/DotNetCli.props +++ b/src/Microsoft.DotNet.Helix/Sdk/tools/dotnet-cli/DotNetCli.props @@ -2,8 +2,10 @@ false runtime - 2.1.5 - 2.1.403 + $(BundledNETCoreAppPackageVersion) + $(NETCoreSdkVersion) + 3.1.5 + 3.1.301 Current <_HelixMonoQueueTargets>$(_HelixMonoQueueTargets);$(MSBuildThisFileDirectory)DotNetCli.targets diff --git a/src/Microsoft.DotNet.RemoteExecutor/src/RemoteExecutor.cs b/src/Microsoft.DotNet.RemoteExecutor/src/RemoteExecutor.cs index 7a6d009bb1e..231c7afe7c1 100644 --- a/src/Microsoft.DotNet.RemoteExecutor/src/RemoteExecutor.cs +++ b/src/Microsoft.DotNet.RemoteExecutor/src/RemoteExecutor.cs @@ -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; } diff --git a/src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeOptions.cs b/src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeOptions.cs index 8002dd2b139..c1ece6250c4 100644 --- a/src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeOptions.cs +++ b/src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeOptions.cs @@ -58,5 +58,10 @@ public bool RunAsSudo _runAsSudo = value; } } + + /// + /// Specifies the roll-forward policy for dotnet cli to use. Only applies when running .NET Core + /// + public string RollForward { get; set; } } } diff --git a/src/Microsoft.DotNet.RemoteExecutor/tests/RemoteExecutorTests.cs b/src/Microsoft.DotNet.RemoteExecutor/tests/RemoteExecutorTests.cs index 1059e584f95..7e3488edab1 100644 --- a/src/Microsoft.DotNet.RemoteExecutor/tests/RemoteExecutorTests.cs +++ b/src/Microsoft.DotNet.RemoteExecutor/tests/RemoteExecutorTests.cs @@ -21,7 +21,7 @@ public void AsyncAction_ThrowException() { Assert.True(false); await Task.Delay(1); - }).Dispose() + }, new RemoteInvokeOptions { RollForward = "Major" }).Dispose() ); } @@ -31,7 +31,7 @@ public void AsyncAction() RemoteExecutor.Invoke(async () => { await Task.Delay(1); - }).Dispose(); + }, new RemoteInvokeOptions { RollForward = "Major" }).Dispose(); } [Fact] @@ -43,7 +43,7 @@ public void AsyncFunc_ThrowException() Assert.True(false); await Task.Delay(1); return 1; - }).Dispose() + }, new RemoteInvokeOptions { RollForward = "Major" }).Dispose() ); } @@ -55,7 +55,7 @@ public void AsyncFunc_InvalidReturnCode() { await Task.Delay(1); return 1; - }).Dispose() + }, new RemoteInvokeOptions { RollForward = "Major" }).Dispose() ); } @@ -66,7 +66,7 @@ public void AsyncFunc_NoThrow_ValidReturnCode() { await Task.Delay(1); return RemoteExecutor.SuccessExitCode; - }).Dispose(); + }, new RemoteInvokeOptions { RollForward = "Major" }).Dispose(); } } } diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 00000000000..1fb32941bf2 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1,2 @@ +*.zip +*.payload