From 794365b340068aad8956b2a0bdb3942b8e5b1cb2 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Thu, 19 Sep 2019 08:04:30 -0700 Subject: [PATCH] Bring in more changes from 'release/3.1' - skip failing `OpenApiFileTests` methods - #14021 - use `TestTFM` - do not use `$(ExperimentalVersionPrefix)` --- .../GetDocumentInsider/src/GetDocumentInsider.csproj | 2 +- .../test/OpenApiAddFileTests.cs | 4 ++-- .../test/OpenApiAddProjectTests.cs | 8 ++++---- .../test/OpenApiRemoveTests.cs | 10 +++++----- .../Microsoft.dotnet-openapi/test/OpenApiTestBase.cs | 3 ++- .../dotnet-getdocument/src/dotnet-getdocument.csproj | 2 +- .../dotnet-user-secrets/src/Internal/InitCommand.cs | 2 +- src/Tools/dotnet-watch/src/Internal/ProcessRunner.cs | 2 +- src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj | 3 +-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Tools/GetDocumentInsider/src/GetDocumentInsider.csproj b/src/Tools/GetDocumentInsider/src/GetDocumentInsider.csproj index 579872f08a..ebaffde463 100644 --- a/src/Tools/GetDocumentInsider/src/GetDocumentInsider.csproj +++ b/src/Tools/GetDocumentInsider/src/GetDocumentInsider.csproj @@ -7,7 +7,7 @@ Exe Microsoft.Extensions.ApiDescription.Tool netcoreapp2.1;net461 - $(ExperimentalVersionPrefix) + false diff --git a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddFileTests.cs b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddFileTests.cs index 257a0fc82d..a75f78abe1 100644 --- a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddFileTests.cs +++ b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddFileTests.cs @@ -134,7 +134,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests Assert.Single(openApiRefs); } - [Fact] + [Fact (Skip = "https://github.com/aspnet/AspNetCore/pull/13571/#issuecomment-531466801")] public async Task OpenApi_Add_NSwagTypeScript() { var project = CreateBasicProject(withOpenApi: true); @@ -168,7 +168,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests Assert.False(runProc.HasExited, $"Run failed with: {runProc.Output}"); } - [Fact] + [Fact (Skip = "https://github.com/aspnet/AspNetCore/pull/13571/#issuecomment-531466801")] public async Task OpenApi_Add_FromJson() { var project = CreateBasicProject(withOpenApi: true); diff --git a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddProjectTests.cs b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddProjectTests.cs index 78aff2456a..2069b426c1 100644 --- a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddProjectTests.cs +++ b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddProjectTests.cs @@ -25,13 +25,13 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests { var project1 = refProj1.WithCSharpProject("refProj"); project1 - .WithTargetFrameworks("netcoreapp5.0") + .WithTargetFrameworks(TestTFM) .Dir() .Create(); var project2 = refProj2.WithCSharpProject("refProj2"); project2 - .WithTargetFrameworks("netcoreapp5.0") + .WithTargetFrameworks(TestTFM) .Dir() .Create(); @@ -64,7 +64,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests var refProjName = "refProj"; var csproj = refProj.WithCSharpProject(refProjName); csproj - .WithTargetFrameworks("netcoreapp5.0") + .WithTargetFrameworks(TestTFM) .Dir() .Create(); @@ -98,7 +98,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests var refProjName = "refProj"; refProj .WithCSharpProject(refProjName) - .WithTargetFrameworks("netcoreapp5.0") + .WithTargetFrameworks(TestTFM) .Dir() .Create(); diff --git a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiRemoveTests.cs b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiRemoveTests.cs index 404687ee43..71bd578324 100644 --- a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiRemoveTests.cs +++ b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiRemoveTests.cs @@ -20,7 +20,7 @@ namespace Microsoft.DotNet.OpenApi.Remove.Tests var nswagJsonFile = "openapi.json"; _tempDir .WithCSharpProject("testproj") - .WithTargetFrameworks("netcoreapp5.0") + .WithTargetFrameworks(TestTFM) .Dir() .WithContentFile(nswagJsonFile) .WithContentFile("Startup.cs") @@ -66,7 +66,7 @@ namespace Microsoft.DotNet.OpenApi.Remove.Tests { _tempDir .WithCSharpProject("testproj") - .WithTargetFrameworks("netcoreapp5.0") + .WithTargetFrameworks(TestTFM) .Dir() .WithContentFile("Startup.cs") .Create(); @@ -108,7 +108,7 @@ namespace Microsoft.DotNet.OpenApi.Remove.Tests { _tempDir .WithCSharpProject("testproj") - .WithTargetFrameworks("netcoreapp5.0") + .WithTargetFrameworks(TestTFM) .Dir() .WithContentFile("Startup.cs") .Create(); @@ -117,7 +117,7 @@ namespace Microsoft.DotNet.OpenApi.Remove.Tests var refProjName = "refProj"; refProj .WithCSharpProject(refProjName) - .WithTargetFrameworks("netcoreapp5.0") + .WithTargetFrameworks(TestTFM) .Dir() .Create(); @@ -160,7 +160,7 @@ namespace Microsoft.DotNet.OpenApi.Remove.Tests var swagFile2 = "swag2.json"; _tempDir .WithCSharpProject("testproj") - .WithTargetFrameworks("netcoreapp5.0") + .WithTargetFrameworks(TestTFM) .Dir() .WithContentFile(nswagJsonFile) .WithFile(swagFile2) diff --git a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiTestBase.cs b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiTestBase.cs index fff6a2e9a3..7e33386d27 100644 --- a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiTestBase.cs +++ b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiTestBase.cs @@ -21,6 +21,7 @@ namespace Microsoft.DotNet.OpenApi.Tests protected readonly TextWriter _output = new StringWriter(); protected readonly TextWriter _error = new StringWriter(); protected readonly ITestOutputHelper _outputHelper; + protected const string TestTFM = "netcoreapp5.0"; protected const string Content = @"{""x-generator"": ""NSwag""}"; protected const string ActualUrl = "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/api-with-examples.yaml"; @@ -61,7 +62,7 @@ namespace Microsoft.DotNet.OpenApi.Tests var nswagJsonFile = "openapi.json"; var project = _tempDir .WithCSharpProject("testproj", sdk: "Microsoft.NET.Sdk.Web") - .WithTargetFrameworks("netcoreapp5.0"); + .WithTargetFrameworks(TestTFM); var tmp = project.Dir(); if (withOpenApi) diff --git a/src/Tools/dotnet-getdocument/src/dotnet-getdocument.csproj b/src/Tools/dotnet-getdocument/src/dotnet-getdocument.csproj index c5494e3999..aa31d55d4e 100644 --- a/src/Tools/dotnet-getdocument/src/dotnet-getdocument.csproj +++ b/src/Tools/dotnet-getdocument/src/dotnet-getdocument.csproj @@ -8,7 +8,7 @@ Microsoft.Extensions.ApiDescription.Tool netcoreapp2.1 false - $(ExperimentalVersionPrefix) + false diff --git a/src/Tools/dotnet-user-secrets/src/Internal/InitCommand.cs b/src/Tools/dotnet-user-secrets/src/Internal/InitCommand.cs index 80d1ebbd4d..e54f04ff7c 100644 --- a/src/Tools/dotnet-user-secrets/src/Internal/InitCommand.cs +++ b/src/Tools/dotnet-user-secrets/src/Internal/InitCommand.cs @@ -91,7 +91,7 @@ namespace Microsoft.Extensions.SecretManager.Tools.Internal var existingUserSecretsId = projectDocument.XPathSelectElements("//UserSecretsId").FirstOrDefault(); // Check if a UserSecretsId is already set - if (existingUserSecretsId != null) + if (existingUserSecretsId is object) { // Only set the UserSecretsId if the user specified an explicit value if (string.IsNullOrWhiteSpace(OverrideId)) diff --git a/src/Tools/dotnet-watch/src/Internal/ProcessRunner.cs b/src/Tools/dotnet-watch/src/Internal/ProcessRunner.cs index 0852eabe65..7874d592b6 100644 --- a/src/Tools/dotnet-watch/src/Internal/ProcessRunner.cs +++ b/src/Tools/dotnet-watch/src/Internal/ProcessRunner.cs @@ -120,7 +120,7 @@ namespace Microsoft.DotNet.Watcher.Internal // this code used Process.Exited, which could result in us missing some output due to the ordering of // events. // - // See the remarks here: https://docs.microsoft.com/dotnet/api/system.diagnostics.process.waitforexit?view=netcore-2.2#System_Diagnostics_Process_WaitForExit_System_Int32_ + // See the remarks here: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.waitforexit#System_Diagnostics_Process_WaitForExit_System_Int32_ if (!_process.WaitForExit(Int32.MaxValue)) { throw new TimeoutException(); diff --git a/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj b/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj index a187a518a7..2bf2ed51d1 100644 --- a/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj +++ b/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj @@ -1,8 +1,7 @@  - - netcoreapp5.0 + $(DefaultNetCoreTargetFramework) Microsoft.DotNet.Watcher.Tools.Tests $(DefaultItemExcludes);TestProjects\**\* DotNetWatcherToolsTests