Bring in more changes from 'release/3.1'
- skip failing `OpenApiFileTests` methods - #14021 - use `TestTFM` - do not use `$(ExperimentalVersionPrefix)`
This commit is contained in:
parent
693d39d495
commit
794365b340
|
|
@ -7,7 +7,7 @@
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<RootNamespace>Microsoft.Extensions.ApiDescription.Tool</RootNamespace>
|
<RootNamespace>Microsoft.Extensions.ApiDescription.Tool</RootNamespace>
|
||||||
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
|
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
|
||||||
<VersionPrefix>$(ExperimentalVersionPrefix)</VersionPrefix>
|
<IsShippingPackage>false</IsShippingPackage>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests
|
||||||
Assert.Single(openApiRefs);
|
Assert.Single(openApiRefs);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact (Skip = "https://github.com/aspnet/AspNetCore/pull/13571/#issuecomment-531466801")]
|
||||||
public async Task OpenApi_Add_NSwagTypeScript()
|
public async Task OpenApi_Add_NSwagTypeScript()
|
||||||
{
|
{
|
||||||
var project = CreateBasicProject(withOpenApi: true);
|
var project = CreateBasicProject(withOpenApi: true);
|
||||||
|
|
@ -168,7 +168,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests
|
||||||
Assert.False(runProc.HasExited, $"Run failed with: {runProc.Output}");
|
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()
|
public async Task OpenApi_Add_FromJson()
|
||||||
{
|
{
|
||||||
var project = CreateBasicProject(withOpenApi: true);
|
var project = CreateBasicProject(withOpenApi: true);
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,13 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests
|
||||||
{
|
{
|
||||||
var project1 = refProj1.WithCSharpProject("refProj");
|
var project1 = refProj1.WithCSharpProject("refProj");
|
||||||
project1
|
project1
|
||||||
.WithTargetFrameworks("netcoreapp5.0")
|
.WithTargetFrameworks(TestTFM)
|
||||||
.Dir()
|
.Dir()
|
||||||
.Create();
|
.Create();
|
||||||
|
|
||||||
var project2 = refProj2.WithCSharpProject("refProj2");
|
var project2 = refProj2.WithCSharpProject("refProj2");
|
||||||
project2
|
project2
|
||||||
.WithTargetFrameworks("netcoreapp5.0")
|
.WithTargetFrameworks(TestTFM)
|
||||||
.Dir()
|
.Dir()
|
||||||
.Create();
|
.Create();
|
||||||
|
|
||||||
|
|
@ -64,7 +64,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests
|
||||||
var refProjName = "refProj";
|
var refProjName = "refProj";
|
||||||
var csproj = refProj.WithCSharpProject(refProjName);
|
var csproj = refProj.WithCSharpProject(refProjName);
|
||||||
csproj
|
csproj
|
||||||
.WithTargetFrameworks("netcoreapp5.0")
|
.WithTargetFrameworks(TestTFM)
|
||||||
.Dir()
|
.Dir()
|
||||||
.Create();
|
.Create();
|
||||||
|
|
||||||
|
|
@ -98,7 +98,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests
|
||||||
var refProjName = "refProj";
|
var refProjName = "refProj";
|
||||||
refProj
|
refProj
|
||||||
.WithCSharpProject(refProjName)
|
.WithCSharpProject(refProjName)
|
||||||
.WithTargetFrameworks("netcoreapp5.0")
|
.WithTargetFrameworks(TestTFM)
|
||||||
.Dir()
|
.Dir()
|
||||||
.Create();
|
.Create();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace Microsoft.DotNet.OpenApi.Remove.Tests
|
||||||
var nswagJsonFile = "openapi.json";
|
var nswagJsonFile = "openapi.json";
|
||||||
_tempDir
|
_tempDir
|
||||||
.WithCSharpProject("testproj")
|
.WithCSharpProject("testproj")
|
||||||
.WithTargetFrameworks("netcoreapp5.0")
|
.WithTargetFrameworks(TestTFM)
|
||||||
.Dir()
|
.Dir()
|
||||||
.WithContentFile(nswagJsonFile)
|
.WithContentFile(nswagJsonFile)
|
||||||
.WithContentFile("Startup.cs")
|
.WithContentFile("Startup.cs")
|
||||||
|
|
@ -66,7 +66,7 @@ namespace Microsoft.DotNet.OpenApi.Remove.Tests
|
||||||
{
|
{
|
||||||
_tempDir
|
_tempDir
|
||||||
.WithCSharpProject("testproj")
|
.WithCSharpProject("testproj")
|
||||||
.WithTargetFrameworks("netcoreapp5.0")
|
.WithTargetFrameworks(TestTFM)
|
||||||
.Dir()
|
.Dir()
|
||||||
.WithContentFile("Startup.cs")
|
.WithContentFile("Startup.cs")
|
||||||
.Create();
|
.Create();
|
||||||
|
|
@ -108,7 +108,7 @@ namespace Microsoft.DotNet.OpenApi.Remove.Tests
|
||||||
{
|
{
|
||||||
_tempDir
|
_tempDir
|
||||||
.WithCSharpProject("testproj")
|
.WithCSharpProject("testproj")
|
||||||
.WithTargetFrameworks("netcoreapp5.0")
|
.WithTargetFrameworks(TestTFM)
|
||||||
.Dir()
|
.Dir()
|
||||||
.WithContentFile("Startup.cs")
|
.WithContentFile("Startup.cs")
|
||||||
.Create();
|
.Create();
|
||||||
|
|
@ -117,7 +117,7 @@ namespace Microsoft.DotNet.OpenApi.Remove.Tests
|
||||||
var refProjName = "refProj";
|
var refProjName = "refProj";
|
||||||
refProj
|
refProj
|
||||||
.WithCSharpProject(refProjName)
|
.WithCSharpProject(refProjName)
|
||||||
.WithTargetFrameworks("netcoreapp5.0")
|
.WithTargetFrameworks(TestTFM)
|
||||||
.Dir()
|
.Dir()
|
||||||
.Create();
|
.Create();
|
||||||
|
|
||||||
|
|
@ -160,7 +160,7 @@ namespace Microsoft.DotNet.OpenApi.Remove.Tests
|
||||||
var swagFile2 = "swag2.json";
|
var swagFile2 = "swag2.json";
|
||||||
_tempDir
|
_tempDir
|
||||||
.WithCSharpProject("testproj")
|
.WithCSharpProject("testproj")
|
||||||
.WithTargetFrameworks("netcoreapp5.0")
|
.WithTargetFrameworks(TestTFM)
|
||||||
.Dir()
|
.Dir()
|
||||||
.WithContentFile(nswagJsonFile)
|
.WithContentFile(nswagJsonFile)
|
||||||
.WithFile(swagFile2)
|
.WithFile(swagFile2)
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ namespace Microsoft.DotNet.OpenApi.Tests
|
||||||
protected readonly TextWriter _output = new StringWriter();
|
protected readonly TextWriter _output = new StringWriter();
|
||||||
protected readonly TextWriter _error = new StringWriter();
|
protected readonly TextWriter _error = new StringWriter();
|
||||||
protected readonly ITestOutputHelper _outputHelper;
|
protected readonly ITestOutputHelper _outputHelper;
|
||||||
|
protected const string TestTFM = "netcoreapp5.0";
|
||||||
|
|
||||||
protected const string Content = @"{""x-generator"": ""NSwag""}";
|
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";
|
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 nswagJsonFile = "openapi.json";
|
||||||
var project = _tempDir
|
var project = _tempDir
|
||||||
.WithCSharpProject("testproj", sdk: "Microsoft.NET.Sdk.Web")
|
.WithCSharpProject("testproj", sdk: "Microsoft.NET.Sdk.Web")
|
||||||
.WithTargetFrameworks("netcoreapp5.0");
|
.WithTargetFrameworks(TestTFM);
|
||||||
var tmp = project.Dir();
|
var tmp = project.Dir();
|
||||||
|
|
||||||
if (withOpenApi)
|
if (withOpenApi)
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
<RootNamespace>Microsoft.Extensions.ApiDescription.Tool</RootNamespace>
|
<RootNamespace>Microsoft.Extensions.ApiDescription.Tool</RootNamespace>
|
||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||||
<UseAppHost>false</UseAppHost>
|
<UseAppHost>false</UseAppHost>
|
||||||
<VersionPrefix>$(ExperimentalVersionPrefix)</VersionPrefix>
|
<IsShippingPackage>false</IsShippingPackage>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ namespace Microsoft.Extensions.SecretManager.Tools.Internal
|
||||||
var existingUserSecretsId = projectDocument.XPathSelectElements("//UserSecretsId").FirstOrDefault();
|
var existingUserSecretsId = projectDocument.XPathSelectElements("//UserSecretsId").FirstOrDefault();
|
||||||
|
|
||||||
// Check if a UserSecretsId is already set
|
// 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
|
// Only set the UserSecretsId if the user specified an explicit value
|
||||||
if (string.IsNullOrWhiteSpace(OverrideId))
|
if (string.IsNullOrWhiteSpace(OverrideId))
|
||||||
|
|
|
||||||
|
|
@ -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
|
// this code used Process.Exited, which could result in us missing some output due to the ordering of
|
||||||
// events.
|
// 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))
|
if (!_process.WaitForExit(Int32.MaxValue))
|
||||||
{
|
{
|
||||||
throw new TimeoutException();
|
throw new TimeoutException();
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<!-- This needs to be hard-coded, since these test projects choose not to import Directory.Build.Props from the root of the repo -->
|
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
|
||||||
<TargetFramework>netcoreapp5.0</TargetFramework>
|
|
||||||
<AssemblyName>Microsoft.DotNet.Watcher.Tools.Tests</AssemblyName>
|
<AssemblyName>Microsoft.DotNet.Watcher.Tools.Tests</AssemblyName>
|
||||||
<DefaultItemExcludes>$(DefaultItemExcludes);TestProjects\**\*</DefaultItemExcludes>
|
<DefaultItemExcludes>$(DefaultItemExcludes);TestProjects\**\*</DefaultItemExcludes>
|
||||||
<TestGroupName>DotNetWatcherToolsTests</TestGroupName>
|
<TestGroupName>DotNetWatcherToolsTests</TestGroupName>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue