From 801a02ec891bb7aac65addc49eb6eeaeb942cf3e Mon Sep 17 00:00:00 2001 From: Tingluo Huang Date: Tue, 30 Nov 2021 22:00:15 -0500 Subject: [PATCH] Bump runtime to dotnet 6 (#1471) * bump runtime to dotnet 6 --- src/Runner.Common/Runner.Common.csproj | 3 +-- src/Runner.Listener/CommandSettings.cs | 3 ++- .../Configuration/NativeWindowsServiceHelper.cs | 2 ++ src/Runner.Listener/Configuration/Validators.cs | 4 ++++ .../Configuration/WindowsServiceControlManager.cs | 2 ++ src/Runner.Listener/Runner.Listener.csproj | 5 ++--- src/Runner.PluginHost/Runner.PluginHost.csproj | 5 ++--- src/Runner.Plugins/Artifact/FileContainerServer.cs | 4 ++-- src/Runner.Plugins/Runner.Plugins.csproj | 3 +-- src/Runner.Sdk/Runner.Sdk.csproj | 3 +-- src/Runner.Worker/ContainerOperationProvider.cs | 4 ++++ src/Runner.Worker/Runner.Worker.csproj | 5 ++--- .../Authentication/HttpRequestMessageWrapper.cs | 8 -------- src/Sdk/Common/Common/Authentication/IHttpRequest.cs | 5 ----- .../Diagnostics/HttpRequestMessageExtensions.cs | 2 +- src/Sdk/Common/Common/VssHttpMessageHandler.cs | 4 ++-- .../Common/Common/VssHttpMessageHandlerTraceInfo.cs | 6 +++--- src/Sdk/Common/Common/VssHttpRequestSettings.cs | 5 +++-- src/Sdk/Common/Common/VssHttpRetryMessageHandler.cs | 10 +++++----- src/Sdk/Sdk.csproj | 3 +-- src/Sdk/WebApi/WebApi/VssHttpClientBase.cs | 12 +++++++----- src/Sdk/WebApi/WebApi/VssHttpUriUtility.cs | 2 +- src/Sdk/WebApi/WebApi/VssRequestTimerTrace.cs | 10 ++++------ src/Test/L0/Listener/CommandSettingsL0.cs | 3 ++- .../Configuration/NativeWindowsServiceHelperL0.cs | 2 ++ src/Test/Test.csproj | 4 ++-- src/dev.sh | 2 +- src/global.json | 2 +- 28 files changed, 60 insertions(+), 63 deletions(-) diff --git a/src/Runner.Common/Runner.Common.csproj b/src/Runner.Common/Runner.Common.csproj index ec0e7bec6..bf55ea845 100644 --- a/src/Runner.Common/Runner.Common.csproj +++ b/src/Runner.Common/Runner.Common.csproj @@ -1,13 +1,12 @@  - netcoreapp3.1 + net6.0 Library win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64 true NU1701;NU1603 $(Version) - true diff --git a/src/Runner.Listener/CommandSettings.cs b/src/Runner.Listener/CommandSettings.cs index da0d301fb..050114560 100644 --- a/src/Runner.Listener/CommandSettings.cs +++ b/src/Runner.Listener/CommandSettings.cs @@ -243,6 +243,7 @@ namespace GitHub.Runner.Listener validator: Validators.ServerUrlValidator); } +#if OS_WINDOWS public string GetWindowsLogonAccount(string defaultValue, string descriptionMsg) { return GetArgOrPrompt( @@ -260,7 +261,7 @@ namespace GitHub.Runner.Listener defaultValue: string.Empty, validator: Validators.NonEmptyValidator); } - +#endif public string GetWork() { return GetArgOrPrompt( diff --git a/src/Runner.Listener/Configuration/NativeWindowsServiceHelper.cs b/src/Runner.Listener/Configuration/NativeWindowsServiceHelper.cs index 40c000acc..f5de8abf6 100644 --- a/src/Runner.Listener/Configuration/NativeWindowsServiceHelper.cs +++ b/src/Runner.Listener/Configuration/NativeWindowsServiceHelper.cs @@ -1,4 +1,5 @@ #if OS_WINDOWS +#pragma warning disable CA1416 using System; using System.Collections; using System.Collections.Generic; @@ -1327,4 +1328,5 @@ namespace GitHub.Runner.Listener.Configuration public IntPtr hProfile; } } +#pragma warning restore CA1416 #endif diff --git a/src/Runner.Listener/Configuration/Validators.cs b/src/Runner.Listener/Configuration/Validators.cs index 79d968221..3dc0b2a07 100644 --- a/src/Runner.Listener/Configuration/Validators.cs +++ b/src/Runner.Listener/Configuration/Validators.cs @@ -67,6 +67,8 @@ namespace GitHub.Runner.Listener.Configuration return !string.IsNullOrEmpty(value); } +#if OS_WINDOWS +#pragma warning disable CA1416 public static bool NTAccountValidator(string arg) { if (string.IsNullOrEmpty(arg) || String.IsNullOrEmpty(arg.TrimStart('.', '\\'))) @@ -87,5 +89,7 @@ namespace GitHub.Runner.Listener.Configuration return true; } +#pragma warning restore CA1416 +#endif } } diff --git a/src/Runner.Listener/Configuration/WindowsServiceControlManager.cs b/src/Runner.Listener/Configuration/WindowsServiceControlManager.cs index e4e28a97c..d67985e24 100644 --- a/src/Runner.Listener/Configuration/WindowsServiceControlManager.cs +++ b/src/Runner.Listener/Configuration/WindowsServiceControlManager.cs @@ -1,4 +1,5 @@ #if OS_WINDOWS +#pragma warning disable CA1416 using System; using System.IO; using System.Linq; @@ -169,4 +170,5 @@ namespace GitHub.Runner.Listener.Configuration } } } +#pragma warning restore CA1416 #endif diff --git a/src/Runner.Listener/Runner.Listener.csproj b/src/Runner.Listener/Runner.Listener.csproj index 09c77b8cc..e4266ad8d 100644 --- a/src/Runner.Listener/Runner.Listener.csproj +++ b/src/Runner.Listener/Runner.Listener.csproj @@ -1,14 +1,13 @@  - netcoreapp3.1 + net6.0 Exe win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64 true NU1701;NU1603 $(Version) - true - true + true diff --git a/src/Runner.PluginHost/Runner.PluginHost.csproj b/src/Runner.PluginHost/Runner.PluginHost.csproj index e856d34b0..e6625dc3e 100644 --- a/src/Runner.PluginHost/Runner.PluginHost.csproj +++ b/src/Runner.PluginHost/Runner.PluginHost.csproj @@ -1,14 +1,13 @@  - netcoreapp3.1 + net6.0 Exe win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64 true NU1701;NU1603 $(Version) - true - true + true diff --git a/src/Runner.Plugins/Artifact/FileContainerServer.cs b/src/Runner.Plugins/Artifact/FileContainerServer.cs index 2d838bfeb..208b9e4c2 100644 --- a/src/Runner.Plugins/Artifact/FileContainerServer.cs +++ b/src/Runner.Plugins/Artifact/FileContainerServer.cs @@ -444,7 +444,7 @@ namespace GitHub.Runner.Plugins.Artifact { // We should never context.Error($"Error '{ex.Message}' when downloading file '{fileToDownload}'. (Downloader {downloaderId})"); - throw ex; + throw; } } @@ -528,7 +528,7 @@ namespace GitHub.Runner.Plugins.Artifact catch (Exception ex) { context.Output($"File error '{ex.Message}' when uploading file '{fileToUpload}'."); - throw ex; + throw; } } diff --git a/src/Runner.Plugins/Runner.Plugins.csproj b/src/Runner.Plugins/Runner.Plugins.csproj index 648ca718c..daa86f026 100644 --- a/src/Runner.Plugins/Runner.Plugins.csproj +++ b/src/Runner.Plugins/Runner.Plugins.csproj @@ -1,13 +1,12 @@  - netcoreapp3.1 + net6.0 Library win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64 true NU1701;NU1603 $(Version) - true diff --git a/src/Runner.Sdk/Runner.Sdk.csproj b/src/Runner.Sdk/Runner.Sdk.csproj index ee4fa0b85..e0294afc6 100644 --- a/src/Runner.Sdk/Runner.Sdk.csproj +++ b/src/Runner.Sdk/Runner.Sdk.csproj @@ -1,13 +1,12 @@  - netcoreapp3.1 + net6.0 Library win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64 true NU1701;NU1603 $(Version) - true diff --git a/src/Runner.Worker/ContainerOperationProvider.cs b/src/Runner.Worker/ContainerOperationProvider.cs index 1a57c393e..b3f10c115 100644 --- a/src/Runner.Worker/ContainerOperationProvider.cs +++ b/src/Runner.Worker/ContainerOperationProvider.cs @@ -55,12 +55,14 @@ namespace GitHub.Runner.Worker // Our container feature requires to map working directory from host to the container. // If we are already inside a container, we will not able to find out the real working direcotry path on the host. #if OS_WINDOWS +#pragma warning disable CA1416 // service CExecSvc is Container Execution Agent. ServiceController[] scServices = ServiceController.GetServices(); if (scServices.Any(x => String.Equals(x.ServiceName, "cexecsvc", StringComparison.OrdinalIgnoreCase) && x.Status == ServiceControllerStatus.Running)) { throw new NotSupportedException("Container feature is not supported when runner is already running inside container."); } +#pragma warning restore CA1416 #else var initProcessCgroup = File.ReadLines("/proc/1/cgroup"); if (initProcessCgroup.Any(x => x.IndexOf(":/docker/", StringComparison.OrdinalIgnoreCase) >= 0)) @@ -70,6 +72,7 @@ namespace GitHub.Runner.Worker #endif #if OS_WINDOWS +#pragma warning disable CA1416 // Check OS version (Windows server 1803 is required) object windowsInstallationType = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "InstallationType", defaultValue: null); ArgUtil.NotNull(windowsInstallationType, nameof(windowsInstallationType)); @@ -88,6 +91,7 @@ namespace GitHub.Runner.Worker { throw new ArgumentOutOfRangeException(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ReleaseId"); } +#pragma warning restore CA1416 #endif // Check docker client/server version diff --git a/src/Runner.Worker/Runner.Worker.csproj b/src/Runner.Worker/Runner.Worker.csproj index 8f7ff699c..adc7c02fd 100644 --- a/src/Runner.Worker/Runner.Worker.csproj +++ b/src/Runner.Worker/Runner.Worker.csproj @@ -1,14 +1,13 @@ - netcoreapp3.1 + net6.0 Exe win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64 true NU1701;NU1603 $(Version) - true - true + true diff --git a/src/Sdk/Common/Common/Authentication/HttpRequestMessageWrapper.cs b/src/Sdk/Common/Common/Authentication/HttpRequestMessageWrapper.cs index ea0a25313..03e5bb4ea 100644 --- a/src/Sdk/Common/Common/Authentication/HttpRequestMessageWrapper.cs +++ b/src/Sdk/Common/Common/Authentication/HttpRequestMessageWrapper.cs @@ -28,14 +28,6 @@ namespace GitHub.Services.Common } } - public IDictionary Properties - { - get - { - return m_request.Properties; - } - } - IEnumerable IHttpHeaders.GetValues(String name) { IEnumerable values; diff --git a/src/Sdk/Common/Common/Authentication/IHttpRequest.cs b/src/Sdk/Common/Common/Authentication/IHttpRequest.cs index 802d7275d..b382845bb 100644 --- a/src/Sdk/Common/Common/Authentication/IHttpRequest.cs +++ b/src/Sdk/Common/Common/Authentication/IHttpRequest.cs @@ -14,10 +14,5 @@ namespace GitHub.Services.Common { get; } - - IDictionary Properties - { - get; - } } } diff --git a/src/Sdk/Common/Common/Diagnostics/HttpRequestMessageExtensions.cs b/src/Sdk/Common/Common/Diagnostics/HttpRequestMessageExtensions.cs index 30279a5c6..b228ab234 100644 --- a/src/Sdk/Common/Common/Diagnostics/HttpRequestMessageExtensions.cs +++ b/src/Sdk/Common/Common/Diagnostics/HttpRequestMessageExtensions.cs @@ -21,7 +21,7 @@ namespace GitHub.Services.Common.Diagnostics public static VssTraceActivity GetActivity(this HttpRequestMessage message) { Object traceActivity; - if (!message.Properties.TryGetValue(VssTraceActivity.PropertyName, out traceActivity)) + if (!message.Options.TryGetValue(VssTraceActivity.PropertyName, out traceActivity)) { return VssTraceActivity.Empty; } diff --git a/src/Sdk/Common/Common/VssHttpMessageHandler.cs b/src/Sdk/Common/Common/VssHttpMessageHandler.cs index e34ceee18..84ac561a1 100644 --- a/src/Sdk/Common/Common/VssHttpMessageHandler.cs +++ b/src/Sdk/Common/Common/VssHttpMessageHandler.cs @@ -169,7 +169,7 @@ namespace GitHub.Services.Common } // Add ourselves to the message so the underlying token issuers may use it if necessary - request.Properties[VssHttpMessageHandler.PropertyName] = this; + request.Options.Set(new HttpRequestOptionsKey(VssHttpMessageHandler.PropertyName), this); Boolean succeeded = false; Boolean lastResponseDemandedProxyAuth = false; @@ -409,7 +409,7 @@ namespace GitHub.Services.Common // Read the completion option provided by the caller. If we don't find the property then we // assume it is OK to buffer by default. HttpCompletionOption completionOption; - if (!request.Properties.TryGetValue(VssHttpRequestSettings.HttpCompletionOptionPropertyName, out completionOption)) + if (!request.Options.TryGetValue(VssHttpRequestSettings.HttpCompletionOptionPropertyName, out completionOption)) { completionOption = HttpCompletionOption.ResponseContentRead; } diff --git a/src/Sdk/Common/Common/VssHttpMessageHandlerTraceInfo.cs b/src/Sdk/Common/Common/VssHttpMessageHandlerTraceInfo.cs index 3b5d63af6..1129f9d81 100644 --- a/src/Sdk/Common/Common/VssHttpMessageHandlerTraceInfo.cs +++ b/src/Sdk/Common/Common/VssHttpMessageHandlerTraceInfo.cs @@ -77,9 +77,9 @@ namespace GitHub.Services.Common public static void SetTraceInfo(HttpRequestMessage message, VssHttpMessageHandlerTraceInfo traceInfo) { object existingTraceInfo; - if (!message.Properties.TryGetValue(TfsTraceInfoKey, out existingTraceInfo)) + if (!message.Options.TryGetValue(TfsTraceInfoKey, out existingTraceInfo)) { - message.Properties.Add(TfsTraceInfoKey, traceInfo); + message.Options.Set(new HttpRequestOptionsKey(TfsTraceInfoKey), traceInfo); } } @@ -92,7 +92,7 @@ namespace GitHub.Services.Common { VssHttpMessageHandlerTraceInfo traceInfo = null; - if (message.Properties.TryGetValue(TfsTraceInfoKey, out object traceInfoObject)) + if (message.Options.TryGetValue(TfsTraceInfoKey, out object traceInfoObject)) { traceInfo = traceInfoObject as VssHttpMessageHandlerTraceInfo; } diff --git a/src/Sdk/Common/Common/VssHttpRequestSettings.cs b/src/Sdk/Common/Common/VssHttpRequestSettings.cs index ac0dd9c3c..06c1554ce 100644 --- a/src/Sdk/Common/Common/VssHttpRequestSettings.cs +++ b/src/Sdk/Common/Common/VssHttpRequestSettings.cs @@ -9,6 +9,7 @@ using System.Text; using System.Threading; using System.Net.Security; using System.Security.Cryptography.X509Certificates; +using GitHub.Services.Common; namespace GitHub.Services.Common { @@ -291,12 +292,12 @@ namespace GitHub.Services.Common protected internal virtual Boolean ApplyTo(HttpRequestMessage request) { // Make sure we only apply the settings to the request once - if (request.Properties.ContainsKey(PropertyName)) + if (request.Options.TryGetValue(PropertyName, out _)) { return false; } - request.Properties.Add(PropertyName, this); + request.Options.Set(new HttpRequestOptionsKey(PropertyName), this); if (this.AcceptLanguages != null && this.AcceptLanguages.Count > 0) { diff --git a/src/Sdk/Common/Common/VssHttpRetryMessageHandler.cs b/src/Sdk/Common/Common/VssHttpRetryMessageHandler.cs index 69c6dacf2..237af57e1 100644 --- a/src/Sdk/Common/Common/VssHttpRetryMessageHandler.cs +++ b/src/Sdk/Common/Common/VssHttpRetryMessageHandler.cs @@ -36,7 +36,7 @@ namespace GitHub.Services.Common } public VssHttpRetryMessageHandler( - VssHttpRetryOptions options, + VssHttpRetryOptions options, HttpMessageHandler innerHandler) : base(innerHandler) { @@ -55,7 +55,7 @@ namespace GitHub.Services.Common // Allow overriding default retry options per request VssHttpRetryOptions retryOptions = m_retryOptions; object retryOptionsObject; - if (request.Properties.TryGetValue(HttpRetryOptionsKey, out retryOptionsObject)) // NETSTANDARD compliant, TryGetValue is not + if (request.Options.TryGetValue(HttpRetryOptionsKey, out retryOptionsObject)) // NETSTANDARD compliant, TryGetValue is not { // Fallback to default options if object of unexpected type was passed retryOptions = retryOptionsObject as VssHttpRetryOptions ?? m_retryOptions; @@ -66,7 +66,7 @@ namespace GitHub.Services.Common IVssHttpRetryInfo retryInfo = null; object retryInfoObject; - if (request.Properties.TryGetValue(HttpRetryInfoKey, out retryInfoObject)) // NETSTANDARD compliant, TryGetValue is not + if (request.Options.TryGetValue(HttpRetryInfoKey, out retryInfoObject)) // NETSTANDARD compliant, TryGetValue is not { retryInfo = retryInfoObject as IVssHttpRetryInfo; } @@ -183,7 +183,7 @@ namespace GitHub.Services.Common { // implement in Server so retries are recorded in ProductTrace } - + protected virtual void TraceHttpRequestFailed(VssTraceActivity activity, HttpRequestMessage request, HttpStatusCode statusCode, string afdRefInfo) { VssHttpEventSource.Log.HttpRequestFailed(activity, request, statusCode, afdRefInfo); @@ -212,7 +212,7 @@ namespace GitHub.Services.Common private static bool IsLowPriority(HttpRequestMessage request) { bool isLowPriority = false; - + IEnumerable headers; if (request.Headers.TryGetValues(HttpHeaders.VssRequestPriority, out headers) && headers != null) diff --git a/src/Sdk/Sdk.csproj b/src/Sdk/Sdk.csproj index 0641a3f3d..133f99a41 100644 --- a/src/Sdk/Sdk.csproj +++ b/src/Sdk/Sdk.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net6.0 Library win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64 true @@ -10,7 +10,6 @@ TRACE 7.3 true - true diff --git a/src/Sdk/WebApi/WebApi/VssHttpClientBase.cs b/src/Sdk/WebApi/WebApi/VssHttpClientBase.cs index b6c0f5e72..d5a9c8b11 100644 --- a/src/Sdk/WebApi/WebApi/VssHttpClientBase.cs +++ b/src/Sdk/WebApi/WebApi/VssHttpClientBase.cs @@ -833,20 +833,20 @@ namespace GitHub.Services.WebApi { if (userState != null) { - message.Properties[UserStatePropertyName] = userState; + message.Options.Set(new HttpRequestOptionsKey(UserStatePropertyName), userState); } - + if (!message.Headers.Contains(Common.Internal.HttpHeaders.VssE2EID)) { message.Headers.Add(Common.Internal.HttpHeaders.VssE2EID, Guid.NewGuid().ToString("D")); } VssHttpEventSource.Log.HttpRequestStart(traceActivity, message); message.Trace(); - message.Properties[VssTraceActivity.PropertyName] = traceActivity; + message.Options.Set(new HttpRequestOptionsKey(VssTraceActivity.PropertyName), traceActivity); // Send the completion option to the inner handler stack so we know when it's safe to buffer // and when we should avoid buffering. - message.Properties[VssHttpRequestSettings.HttpCompletionOptionPropertyName] = completionOption; + message.Options.Set(new HttpRequestOptionsKey(VssHttpRequestSettings.HttpCompletionOptionPropertyName), completionOption); //ConfigureAwait(false) enables the continuation to be run outside //any captured SyncronizationContext (such as ASP.NET's) which keeps things @@ -872,7 +872,7 @@ namespace GitHub.Services.WebApi } protected virtual async Task HandleResponseAsync( - HttpResponseMessage response, + HttpResponseMessage response, CancellationToken cancellationToken) { response.Trace(); @@ -1154,12 +1154,14 @@ namespace GitHub.Services.WebApi { if (BaseAddress != null) { +#pragma warning disable SYSLIB0014 ServicePoint servicePoint = ServicePointManager.FindServicePoint(BaseAddress); servicePoint.UseNagleAlgorithm = false; servicePoint.SetTcpKeepAlive( enabled: true, keepAliveTime: c_keepAliveTime, keepAliveInterval: c_keepAliveInterval); +#pragma warning restore SYSLIB0014 } } diff --git a/src/Sdk/WebApi/WebApi/VssHttpUriUtility.cs b/src/Sdk/WebApi/WebApi/VssHttpUriUtility.cs index e3d6f8580..0afad2751 100644 --- a/src/Sdk/WebApi/WebApi/VssHttpUriUtility.cs +++ b/src/Sdk/WebApi/WebApi/VssHttpUriUtility.cs @@ -138,7 +138,7 @@ namespace GitHub.Services.WebApi if (routeReplacementOptions.HasFlag(RouteReplacementOptions.EscapeUri)) { - sbResult = new StringBuilder(Uri.EscapeUriString(sbResult.ToString())); + sbResult = new StringBuilder(Uri.EscapeDataString(sbResult.ToString())); } if (routeReplacementOptions.HasFlag(RouteReplacementOptions.AppendUnusedAsQueryParams) && unusedValues.Count > 0) diff --git a/src/Sdk/WebApi/WebApi/VssRequestTimerTrace.cs b/src/Sdk/WebApi/WebApi/VssRequestTimerTrace.cs index 160f7af60..bcbf6f426 100644 --- a/src/Sdk/WebApi/WebApi/VssRequestTimerTrace.cs +++ b/src/Sdk/WebApi/WebApi/VssRequestTimerTrace.cs @@ -16,9 +16,8 @@ namespace GitHub.Services.WebApi internal static void Trace(this HttpRequestMessage request) { - Object tracerObj = null; - VssRequestTimerTrace tracer = null; - if (request.Properties.TryGetValue(tracerKey, out tracerObj)) + VssRequestTimerTrace tracer; + if (request.Options.TryGetValue(tracerKey, out object tracerObj)) { tracer = tracerObj as VssRequestTimerTrace; Debug.Assert(tracer != null, "Tracer object is the wrong type!"); @@ -26,7 +25,7 @@ namespace GitHub.Services.WebApi else { tracer = new VssRequestTimerTrace(); - request.Properties[tracerKey] = tracer; + request.Options.Set(new HttpRequestOptionsKey(tracerKey), tracer); } if (tracer != null) @@ -37,9 +36,8 @@ namespace GitHub.Services.WebApi internal static void Trace(this HttpResponseMessage response) { - Object tracerObj = null; VssRequestTimerTrace tracer = null; - if (response.RequestMessage.Properties.TryGetValue(tracerKey, out tracerObj)) + if (response.RequestMessage.Options.TryGetValue(tracerKey, out object tracerObj)) { tracer = tracerObj as VssRequestTimerTrace; Debug.Assert(tracer != null, "Tracer object is the wrong type!"); diff --git a/src/Test/L0/Listener/CommandSettingsL0.cs b/src/Test/L0/Listener/CommandSettingsL0.cs index b35729d49..9354e5508 100644 --- a/src/Test/L0/Listener/CommandSettingsL0.cs +++ b/src/Test/L0/Listener/CommandSettingsL0.cs @@ -547,6 +547,7 @@ namespace GitHub.Runner.Common.Tests } } +#if OS_WINDOWS [Fact] [Trait("Level", "L0")] [Trait("Category", nameof(CommandSettings))] @@ -603,7 +604,7 @@ namespace GitHub.Runner.Common.Tests Assert.Equal("some windows logon password", actual); } } - +#endif [Fact] [Trait("Level", "L0")] [Trait("Category", nameof(CommandSettings))] diff --git a/src/Test/L0/Listener/Configuration/NativeWindowsServiceHelperL0.cs b/src/Test/L0/Listener/Configuration/NativeWindowsServiceHelperL0.cs index 61fdcd1ce..8623a7872 100644 --- a/src/Test/L0/Listener/Configuration/NativeWindowsServiceHelperL0.cs +++ b/src/Test/L0/Listener/Configuration/NativeWindowsServiceHelperL0.cs @@ -15,6 +15,7 @@ namespace Test.L0.Listener.Configuration { #if OS_WINDOWS +#pragma warning disable CA1416 [Fact] [Trait("Level", "L0")] [Trait("Category", "ConfigurationManagement")] @@ -50,6 +51,7 @@ namespace Test.L0.Listener.Configuration Assert.True(defaultServiceAccount.ToString().Equals(@"NT AUTHORITY\SYSTEM"), "If agent is getting configured as deployment agent, default service accout should be 'NT AUTHORITY\\SYSTEM'"); } } +#pragma warning restore CA1416 #endif } } diff --git a/src/Test/Test.csproj b/src/Test/Test.csproj index ebeeaab97..432d48223 100644 --- a/src/Test/Test.csproj +++ b/src/Test/Test.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1 + net6.0 win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64 true NU1701;NU1603;NU1603;xUnit2013; @@ -15,7 +15,7 @@ - + diff --git a/src/dev.sh b/src/dev.sh index 15d396c2d..df71896e4 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -17,7 +17,7 @@ LAYOUT_DIR="$SCRIPT_DIR/../_layout" DOWNLOAD_DIR="$SCRIPT_DIR/../_downloads/netcore2x" PACKAGE_DIR="$SCRIPT_DIR/../_package" DOTNETSDK_ROOT="$SCRIPT_DIR/../_dotnetsdk" -DOTNETSDK_VERSION="3.1.302" +DOTNETSDK_VERSION="6.0.100" DOTNETSDK_INSTALLDIR="$DOTNETSDK_ROOT/$DOTNETSDK_VERSION" RUNNER_VERSION=$(cat runnerversion) diff --git a/src/global.json b/src/global.json index 2ae03c0b2..047020849 100644 --- a/src/global.json +++ b/src/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "3.1.302" + "version": "6.0.100" } }