Remove EmptyApp tests as its covered eslewhere (#2025)

* Remove EmptyApp tests as its covered eslewhere

* cleanup
This commit is contained in:
Cijo Thomas 2020-09-03 15:30:40 -07:00 коммит произвёл GitHub
Родитель b136fb9cce
Коммит a993547775
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 2 добавлений и 331 удалений

Просмотреть файл

@ -137,8 +137,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTests.Utils", "NE
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTests.MVC.Tests", "NETCORE\test\FunctionalTests.MVC.Tests\FunctionalTests.MVC.Tests.csproj", "{43D6CB2E-6EE7-4B2B-A517-0D70298ACDBF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTests.EmptyApp.Tests", "NETCORE\test\FunctionalTests.EmptyApp.Tests\FunctionalTests.EmptyApp.Tests.csproj", "{00FC8932-554B-455F-9E02-E8A4B0DBFAA8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Perf.Tests", "WEB\Src\PerformanceCollector\Perf.Tests\Perf.Tests.csproj", "{27B8D7BE-8CB7-48BF-97DA-0F031103C03D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventCounterCollector.Tests", "WEB\Src\EventCounterCollector\EventCounterCollector.Tests\EventCounterCollector.Tests.csproj", "{A1891190-0E43-4E2E-BEFE-1AF0068A0D1E}"
@ -356,10 +354,6 @@ Global
{43D6CB2E-6EE7-4B2B-A517-0D70298ACDBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43D6CB2E-6EE7-4B2B-A517-0D70298ACDBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{43D6CB2E-6EE7-4B2B-A517-0D70298ACDBF}.Release|Any CPU.Build.0 = Release|Any CPU
{00FC8932-554B-455F-9E02-E8A4B0DBFAA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00FC8932-554B-455F-9E02-E8A4B0DBFAA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00FC8932-554B-455F-9E02-E8A4B0DBFAA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00FC8932-554B-455F-9E02-E8A4B0DBFAA8}.Release|Any CPU.Build.0 = Release|Any CPU
{27B8D7BE-8CB7-48BF-97DA-0F031103C03D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{27B8D7BE-8CB7-48BF-97DA-0F031103C03D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27B8D7BE-8CB7-48BF-97DA-0F031103C03D}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -421,7 +415,6 @@ Global
{BB89365D-FFAA-4515-A277-D478A678D4B3} = {E9AEB857-E8AA-4ED6-A020-DF4D8486CEB0}
{F677DF78-A630-464C-BEA9-3BBAEA97412F} = {E9AEB857-E8AA-4ED6-A020-DF4D8486CEB0}
{43D6CB2E-6EE7-4B2B-A517-0D70298ACDBF} = {E9AEB857-E8AA-4ED6-A020-DF4D8486CEB0}
{00FC8932-554B-455F-9E02-E8A4B0DBFAA8} = {E9AEB857-E8AA-4ED6-A020-DF4D8486CEB0}
{27B8D7BE-8CB7-48BF-97DA-0F031103C03D} = {3EDBC945-E531-4CEE-A038-A6AE1EF9AA96}
{A1891190-0E43-4E2E-BEFE-1AF0068A0D1E} = {DFCBB4ED-976C-4239-BCAF-8AA21E684E8C}
{6062A897-6E55-44C9-BA7A-E1C42946EE51} = {07076842-9CAA-4B4A-8AEF-88DE88CD37AC}

Просмотреть файл

@ -55,17 +55,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TelemetryChannel", "..\BASE
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ApplicationInsights", "..\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj", "{2C7CEEDD-BB15-48DF-B12A-B268E9D74859}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTests.EmptyApp.Tests", "test\FunctionalTests.EmptyApp.Tests\FunctionalTests.EmptyApp.Tests.csproj", "{C7A8D822-CA6C-497D-AA26-C36F25BA61FD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTests.Utils", "test\FunctionalTests.Utils\FunctionalTests.Utils.csproj", "{63F64005-CDC7-4062-8CBC-A40B049E342A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTests.MVC.Tests", "test\FunctionalTests.MVC.Tests\FunctionalTests.MVC.Tests.csproj", "{9693CC30-A3E6-48A7-A68E-6E0DD098D779}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTests.WebApi.Tests", "test\FunctionalTests.WebApi.Tests\FunctionalTests.WebApi.Tests.csproj", "{E78404EA-CBAA-4366-B659-C3A46BC9DF15}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.WebApp.3.1", "test\IntegrationTests.WebApp.3.1\IntegrationTests.WebApp.3.1.csproj", "{2EB6FF02-DB25-423A-A8FC-1E249BE4CEDB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.WebApp.3.1", "test\IntegrationTests.WebApp.3.1\IntegrationTests.WebApp.3.1.csproj", "{2EB6FF02-DB25-423A-A8FC-1E249BE4CEDB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.WebApp.2.1", "test\IntegrationTests.WebApp.2.1\IntegrationTests.WebApp.2.1.csproj", "{78A86267-EBB6-4720-8AC8-102B47D26D21}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.WebApp.2.1", "test\IntegrationTests.WebApp.2.1\IntegrationTests.WebApp.2.1.csproj", "{78A86267-EBB6-4720-8AC8-102B47D26D21}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
@ -138,10 +136,6 @@ Global
{2C7CEEDD-BB15-48DF-B12A-B268E9D74859}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2C7CEEDD-BB15-48DF-B12A-B268E9D74859}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2C7CEEDD-BB15-48DF-B12A-B268E9D74859}.Release|Any CPU.Build.0 = Release|Any CPU
{C7A8D822-CA6C-497D-AA26-C36F25BA61FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7A8D822-CA6C-497D-AA26-C36F25BA61FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7A8D822-CA6C-497D-AA26-C36F25BA61FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7A8D822-CA6C-497D-AA26-C36F25BA61FD}.Release|Any CPU.Build.0 = Release|Any CPU
{63F64005-CDC7-4062-8CBC-A40B049E342A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63F64005-CDC7-4062-8CBC-A40B049E342A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63F64005-CDC7-4062-8CBC-A40B049E342A}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -182,7 +176,6 @@ Global
{8D13F3C8-D938-44FD-A0D8-B5D1712C95DB} = {042C2916-4BB7-4CCB-BD61-A8BAAB0129B9}
{0C91D961-B21E-4760-A192-14193F10B831} = {042C2916-4BB7-4CCB-BD61-A8BAAB0129B9}
{2C7CEEDD-BB15-48DF-B12A-B268E9D74859} = {042C2916-4BB7-4CCB-BD61-A8BAAB0129B9}
{C7A8D822-CA6C-497D-AA26-C36F25BA61FD} = {8B5230E5-8138-44D6-839F-DF9248F195EE}
{63F64005-CDC7-4062-8CBC-A40B049E342A} = {8B5230E5-8138-44D6-839F-DF9248F195EE}
{9693CC30-A3E6-48A7-A68E-6E0DD098D779} = {8B5230E5-8138-44D6-839F-DF9248F195EE}
{E78404EA-CBAA-4366-B659-C3A46BC9DF15} = {8B5230E5-8138-44D6-839F-DF9248F195EE}

Просмотреть файл

@ -1,26 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FunctionalTests.EmptyApp.Tests {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")]
internal sealed partial class App : global::System.Configuration.ApplicationSettingsBase {
private static App defaultInstance = ((App)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new App())));
public static App Default {
get {
return defaultInstance;
}
}
}
}

Просмотреть файл

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
</assemblyBinding>
</runtime>
</configuration>

Просмотреть файл

@ -1,53 +0,0 @@
using System.Diagnostics;
using Xunit;
using Xunit.Abstractions;
[assembly: CollectionBehavior(DisableTestParallelization = true)]
namespace FunctionalTests.EmptyApp.Tests.FunctionalTest
{
using System;
using System.Reflection;
using FunctionalTests.Utils;
using Microsoft.ApplicationInsights.DataContracts;
public class ExceptionTelemetryEmptyAppTests : TelemetryTestsBase
{
private readonly string assemblyName;
public ExceptionTelemetryEmptyAppTests(ITestOutputHelper output) : base (output)
{
this.assemblyName = this.GetType().GetTypeInfo().Assembly.GetName().Name;
}
[Fact]
public void TestBasicRequestPropertiesAfterRequestingRequestThatThrows()
{
using (var server = new InProcessServer(assemblyName, this.output))
{
const string RequestPath = "/Exception";
var expectedRequestTelemetry = new RequestTelemetry();
expectedRequestTelemetry.Name = "GET /Exception";
expectedRequestTelemetry.ResponseCode = "500";
expectedRequestTelemetry.Success = false;
expectedRequestTelemetry.Url = new System.Uri(server.BaseHost + RequestPath);
// the is no response header because of https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/717
this.ValidateBasicRequest(server, "/Exception", expectedRequestTelemetry, false);
}
}
[Fact]
public void TestBasicExceptionPropertiesAfterRequestingRequestThatThrows()
{
using (var server = new InProcessServer(assemblyName, this.output))
{
var expectedExceptionTelemetry = new ExceptionTelemetry();
expectedExceptionTelemetry.Exception = new InvalidOperationException();
this.ValidateBasicException(server, "/Exception", expectedExceptionTelemetry);
}
}
}
}

Просмотреть файл

@ -1,51 +0,0 @@
namespace FunctionalTests.EmptyApp.Tests.FunctionalTest
{
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Reflection;
using AI;
using FunctionalTests.Utils;
using Microsoft.ApplicationInsights.DataContracts;
using Xunit;
using Xunit.Abstractions;
public class RequestTelemetryEmptyAppTests : TelemetryTestsBase
{
private readonly string assemblyName;
public RequestTelemetryEmptyAppTests(ITestOutputHelper output) : base (output)
{
this.assemblyName = this.GetType().GetTypeInfo().Assembly.GetName().Name;
}
[Fact]
public void TestMixedTelemetryItemsReceived()
{
using (var server = new InProcessServer(assemblyName, this.output))
{
this.ExecuteRequest(server.BaseHost + "/Mixed");
var telemetries = server.Listener.ReceiveItems(TestListenerTimeoutInMs);
this.DebugTelemetryItems(telemetries);
Assert.True(telemetries.Length >= 5);
Assert.Contains(telemetries.OfType<TelemetryItem<RemoteDependencyData>>(),
t => ((TelemetryItem<RemoteDependencyData>)t).data.baseData.name == "GET /Mixed");
Assert.Contains(telemetries.OfType<TelemetryItem<RequestData>>(),
t => ((TelemetryItem<RequestData>)t).data.baseData.name == "GET /Mixed");
Assert.Contains(telemetries.OfType<TelemetryItem<EventData>>(),
t => ((TelemetryItem<EventData>)t).data.baseData.name == "GetContact");
Assert.Contains(telemetries.OfType<TelemetryItem<MetricData>>(),
t => ((TelemetryItem<MetricData>)t).data.baseData.metrics[0].name == "ContactFile" && ((TelemetryItem<MetricData>)t).data.baseData.metrics[0].value == 1);
Assert.Contains(telemetries.OfType<TelemetryItem<MessageData>>(),
t => ((TelemetryItem<MessageData>)t).data.baseData.message == "Fetched contact details." && ((TelemetryItem<MessageData>)t).data.baseData.severityLevel == AI.SeverityLevel.Information);
}
}
}
}

Просмотреть файл

@ -1,41 +0,0 @@
namespace FunctionalTests.EmptyApp.Tests.FunctionalTest
{
using System.Reflection;
using FunctionalTests.Utils;
using Microsoft.ApplicationInsights.DataContracts;
using Xunit;
using Xunit.Abstractions;
public class TelemetryModuleWorkingEmptyAppTests : TelemetryTestsBase
{
private readonly string assemblyName;
public TelemetryModuleWorkingEmptyAppTests(ITestOutputHelper output) : base (output)
{
this.assemblyName = this.GetType().GetTypeInfo().Assembly.GetName().Name;
}
[Fact]
public void TestBasicDependencyPropertiesAfterRequestingBasicPage()
{
const string RequestPath = "/";
using (var server = new InProcessServer(assemblyName, this.output))
{
DependencyTelemetry expected = new DependencyTelemetry();
expected.ResultCode = "200";
expected.Success = true;
expected.Name = "GET /";
expected.Data = server.BaseHost + RequestPath;
this.ValidateBasicDependency(server, RequestPath, expected);
}
}
[Fact]
public void TestIfPerformanceCountersAreCollected()
{
ValidatePerformanceCountersAreCollected(assemblyName);
}
}
}

Просмотреть файл

@ -1,52 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<RuntimeIdentifier Condition=" '$(TargetFramework)' == 'net461' ">win7-x86</RuntimeIdentifier>
<AssemblyName>FunctionalTests.EmptyApp.Tests</AssemblyName>
<PackageId>FunctionalTests.EmptyApp.Tests</PackageId>
<DependsOnNETStandard Condition=" '$(TargetFramework)' == 'net461'">true</DependsOnNETStandard>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="xunit" Version="2.3.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'net461' ">
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FunctionalTests.Utils\FunctionalTests.Utils.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="App.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>App.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<ItemGroup>
<Compile Update="App.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>App.config</DependentUpon>
</Compile>
</ItemGroup>
</Project>

Просмотреть файл

@ -1,25 +0,0 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:4828/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNET_ENVIRONMENT": "Development"
}
},
"web": {
"commandName": "web",
"environmentVariables": {
"ASPNET_ENVIRONMENT": "Development"
}
}
}
}

Просмотреть файл

@ -1,60 +0,0 @@
namespace FunctionalTests.EmptyApp.Tests
{
using System;
using FunctionalTests.Utils;
using Microsoft.ApplicationInsights;
using Microsoft.ApplicationInsights.AspNetCore.Extensions;
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
public class Startup
{
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
var endpointAddress = new EndpointAddress();
services.AddSingleton<EndpointAddress>(endpointAddress);
var builder = new ConfigurationBuilder();
builder.AddApplicationInsightsSettings(instrumentationKey: InProcessServer.IKey, endpointAddress: endpointAddress.ConnectionString, developerMode: true);
services.AddSingleton(typeof(ITelemetryChannel), new InMemoryChannel());
services.AddApplicationInsightsTelemetry(builder.Build());
}
public void Configure(IApplicationBuilder app)
{
app.UseDeveloperExceptionPage();
app.Use(next =>
{
return async context =>
{
if (context.Request.GetUri().ToString().Contains("Exception"))
{
throw new InvalidOperationException();
}
else if (context.Request.GetUri().PathAndQuery == "/")
{
await context.Response.WriteAsync("Hello!");
}
else if (context.Request.GetUri().ToString().Contains("Mixed"))
{
TelemetryClient telemetryClient = (TelemetryClient)context.RequestServices.GetService(typeof(TelemetryClient));
telemetryClient.TrackEvent("GetContact");
telemetryClient.TrackMetric("ContactFile", 1);
telemetryClient.TrackTrace("Fetched contact details.", SeverityLevel.Information);
await context.Response.WriteAsync("Hello!");
}
else
{
await next(context);
}
};
});
}
}
}