From 476e9de74e0e572af6e18c46b7f58f1bb563fbfc Mon Sep 17 00:00:00 2001 From: Cijo Thomas Date: Mon, 19 Jul 2021 16:57:41 -0700 Subject: [PATCH] Remove .NET Core 2.1 from tests and CI (#2160) --- .github/workflows/integration.yml | 8 +-- .github/workflows/linux-ci.yml | 2 +- .github/workflows/windows-ci.yml | 2 +- OpenTelemetry.sln | 7 -- .../{net46 => net461}/PublicAPI.Shipped.txt | 0 .../{net46 => net461}/PublicAPI.Unshipped.txt | 0 .../CHANGELOG.md | 3 + .../OpenTelemetry.Exporter.Jaeger.csproj | 8 ++- test/Benchmarks/Benchmarks.csproj | 7 +- ...OpenTelemetry.Exporter.Jaeger.Tests.csproj | 2 +- ...xporter.OpenTelemetryProtocol.Tests.csproj | 2 +- ...OpenTelemetry.Exporter.ZPages.Tests.csproj | 2 +- ...OpenTelemetry.Exporter.Zipkin.Tests.csproj | 2 +- ...nTelemetry.Extensions.Hosting.Tests.csproj | 2 +- ...ry.Instrumentation.AspNetCore.Tests.csproj | 11 +-- ...elemetry.Instrumentation.Http.Tests.csproj | 2 +- ...try.Instrumentation.SqlClient.Tests.csproj | 2 +- ...umentation.StackExchangeRedis.Tests.csproj | 2 +- ...strumentation.W3cTraceContext.Tests.csproj | 9 +-- ...enTelemetry.Shims.OpenTracing.Tests.csproj | 2 +- .../OpenTelemetry.Tests.csproj | 11 +-- test/TestApp.AspNetCore.2.1/AssemblyInfo.cs | 24 ------- .../CallbackMiddleware.cs | 48 ------------- .../Controllers/ChildActivityController.cs | 46 ------------ .../Controllers/ForwardController.cs | 71 ------------------- .../Controllers/ValuesController.cs | 56 --------------- test/TestApp.AspNetCore.2.1/Program.cs | 33 --------- test/TestApp.AspNetCore.2.1/Startup.cs | 57 --------------- .../TestApp.AspNetCore.2.1.csproj | 26 ------- 29 files changed, 31 insertions(+), 416 deletions(-) rename src/OpenTelemetry.Exporter.Jaeger/.publicApi/{net46 => net461}/PublicAPI.Shipped.txt (100%) rename src/OpenTelemetry.Exporter.Jaeger/.publicApi/{net46 => net461}/PublicAPI.Unshipped.txt (100%) delete mode 100644 test/TestApp.AspNetCore.2.1/AssemblyInfo.cs delete mode 100644 test/TestApp.AspNetCore.2.1/CallbackMiddleware.cs delete mode 100644 test/TestApp.AspNetCore.2.1/Controllers/ChildActivityController.cs delete mode 100644 test/TestApp.AspNetCore.2.1/Controllers/ForwardController.cs delete mode 100644 test/TestApp.AspNetCore.2.1/Controllers/ValuesController.cs delete mode 100644 test/TestApp.AspNetCore.2.1/Program.cs delete mode 100644 test/TestApp.AspNetCore.2.1/Startup.cs delete mode 100644 test/TestApp.AspNetCore.2.1/TestApp.AspNetCore.2.1.csproj diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 7a451a01f..b752f10ae 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - version: [netcoreapp2.1,netcoreapp3.1,net5.0] + version: [netcoreapp3.1,net5.0] steps: - uses: actions/checkout@v2 - name: Run redis docker-compose.integration @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - version: [netcoreapp2.1,netcoreapp3.1,net5.0] + version: [netcoreapp3.1,net5.0] steps: - uses: actions/checkout@v2 - name: Run sql docker-compose.integration @@ -38,7 +38,7 @@ jobs: strategy: fail-fast: false matrix: - version: [netcoreapp2.1,netcoreapp3.1,net5.0] + version: [netcoreapp3.1,net5.0] steps: - uses: actions/checkout@v2 - name: Run W3C Trace Context docker-compose.integration @@ -49,7 +49,7 @@ jobs: strategy: fail-fast: false matrix: - version: [netcoreapp2.1,netcoreapp3.1,net5.0] + version: [netcoreapp3.1,net5.0] steps: - uses: actions/checkout@v2 - name: Run OTLP Exporter docker-compose.integration diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index 17a9ce418..f66fb6dd9 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - version: [netcoreapp2.1,netcoreapp3.1,net5.0] + version: [netcoreapp3.1,net5.0] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 779e3eac1..de5cdc95c 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - version: [net461,netcoreapp2.1,netcoreapp3.1,net5.0] + version: [net461,netcoreapp3.1,net5.0] steps: - uses: actions/checkout@v2 diff --git a/OpenTelemetry.sln b/OpenTelemetry.sln index 8656ae859..0a82a6cdf 100644 --- a/OpenTelemetry.sln +++ b/OpenTelemetry.sln @@ -128,8 +128,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{D2E73927-5 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentation.Grpc.Tests", "test\OpenTelemetry.Instrumentation.Grpc.Tests\OpenTelemetry.Instrumentation.Grpc.Tests.csproj", "{305E9DFD-E73B-4A28-8769-795C25551020}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestApp.AspNetCore.2.1", "test\TestApp.AspNetCore.2.1\TestApp.AspNetCore.2.1.csproj", "{7CDA3F85-EA6F-45C4-B432-2559303355D4}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.ZPages.Tests", "test\OpenTelemetry.Exporter.ZPages.Tests\OpenTelemetry.Exporter.ZPages.Tests.csproj", "{98F9556B-116F-49B5-9211-BB1D418446FF}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Examples.AspNet", "examples\AspNet\Examples.AspNet.csproj", "{9A4E3A68-904B-4835-A3C8-F664B73098DB}" @@ -301,10 +299,6 @@ Global {305E9DFD-E73B-4A28-8769-795C25551020}.Debug|Any CPU.Build.0 = Debug|Any CPU {305E9DFD-E73B-4A28-8769-795C25551020}.Release|Any CPU.ActiveCfg = Release|Any CPU {305E9DFD-E73B-4A28-8769-795C25551020}.Release|Any CPU.Build.0 = Release|Any CPU - {7CDA3F85-EA6F-45C4-B432-2559303355D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7CDA3F85-EA6F-45C4-B432-2559303355D4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7CDA3F85-EA6F-45C4-B432-2559303355D4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7CDA3F85-EA6F-45C4-B432-2559303355D4}.Release|Any CPU.Build.0 = Release|Any CPU {98F9556B-116F-49B5-9211-BB1D418446FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {98F9556B-116F-49B5-9211-BB1D418446FF}.Debug|Any CPU.Build.0 = Debug|Any CPU {98F9556B-116F-49B5-9211-BB1D418446FF}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -411,7 +405,6 @@ Global {E69578EB-B456-4062-A645-877CD964528B} = {F1D0972B-38CF-49C2-9F4B-4C5DE02FB71D} {C1542297-8763-4DF4-957C-489ED771C21D} = {7CB2F02E-03FA-4FFF-89A5-C51F107623FD} {D2E73927-5966-445C-94E9-EFE6F269C8D5} = {7CB2F02E-03FA-4FFF-89A5-C51F107623FD} - {7CDA3F85-EA6F-45C4-B432-2559303355D4} = {77C7929A-2EED-4AA6-8705-B5C443C8AA0F} {9A4E3A68-904B-4835-A3C8-F664B73098DB} = {E359BB2B-9AEC-497D-B321-7DF2450C3B8E} {FF3E6E08-E8E4-4523-B526-847CD989279F} = {E359BB2B-9AEC-497D-B321-7DF2450C3B8E} {0935622B-9377-4056-8343-AE6ECDC274CF} = {E359BB2B-9AEC-497D-B321-7DF2450C3B8E} diff --git a/src/OpenTelemetry.Exporter.Jaeger/.publicApi/net46/PublicAPI.Shipped.txt b/src/OpenTelemetry.Exporter.Jaeger/.publicApi/net461/PublicAPI.Shipped.txt similarity index 100% rename from src/OpenTelemetry.Exporter.Jaeger/.publicApi/net46/PublicAPI.Shipped.txt rename to src/OpenTelemetry.Exporter.Jaeger/.publicApi/net461/PublicAPI.Shipped.txt diff --git a/src/OpenTelemetry.Exporter.Jaeger/.publicApi/net46/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.Jaeger/.publicApi/net461/PublicAPI.Unshipped.txt similarity index 100% rename from src/OpenTelemetry.Exporter.Jaeger/.publicApi/net46/PublicAPI.Unshipped.txt rename to src/OpenTelemetry.Exporter.Jaeger/.publicApi/net461/PublicAPI.Unshipped.txt diff --git a/src/OpenTelemetry.Exporter.Jaeger/CHANGELOG.md b/src/OpenTelemetry.Exporter.Jaeger/CHANGELOG.md index 4083e8eb3..1552babe1 100644 --- a/src/OpenTelemetry.Exporter.Jaeger/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Jaeger/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +* Removes .NET Framework 4.6 support. The minimum .NET Framework + version supported is .NET 4.6.1. ([#2138](https://github.com/open-telemetry/opentelemetry-dotnet/issues/2138)) + * The `JaegerExporterOptions` defaults can be overridden using `OTEL_EXPORTER_JAEGER_AGENT_HOST` and `OTEL_EXPORTER_JAEGER_AGENT_PORT` envionmental variables as defined in the diff --git a/src/OpenTelemetry.Exporter.Jaeger/OpenTelemetry.Exporter.Jaeger.csproj b/src/OpenTelemetry.Exporter.Jaeger/OpenTelemetry.Exporter.Jaeger.csproj index b065a2d50..77427f094 100644 --- a/src/OpenTelemetry.Exporter.Jaeger/OpenTelemetry.Exporter.Jaeger.csproj +++ b/src/OpenTelemetry.Exporter.Jaeger/OpenTelemetry.Exporter.Jaeger.csproj @@ -1,12 +1,18 @@  - netstandard2.0;netstandard2.1;net46 + netstandard2.0;netstandard2.1;net461 Jaeger exporter for OpenTelemetry .NET $(PackageTags);Jaeger;distributed-tracing core- + + + false + + $(NoWarn),1591 diff --git a/test/Benchmarks/Benchmarks.csproj b/test/Benchmarks/Benchmarks.csproj index a171e006a..d92339811 100644 --- a/test/Benchmarks/Benchmarks.csproj +++ b/test/Benchmarks/Benchmarks.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1;netcoreapp3.1;net5.0;net462 + netcoreapp3.1;net5.0;net462 false @@ -30,9 +30,4 @@ - - - - - diff --git a/test/OpenTelemetry.Exporter.Jaeger.Tests/OpenTelemetry.Exporter.Jaeger.Tests.csproj b/test/OpenTelemetry.Exporter.Jaeger.Tests/OpenTelemetry.Exporter.Jaeger.Tests.csproj index 93bf80529..6933dd765 100644 --- a/test/OpenTelemetry.Exporter.Jaeger.Tests/OpenTelemetry.Exporter.Jaeger.Tests.csproj +++ b/test/OpenTelemetry.Exporter.Jaeger.Tests/OpenTelemetry.Exporter.Jaeger.Tests.csproj @@ -2,7 +2,7 @@ Unit test project for Jaeger Exporter for OpenTelemetry netcoreapp2.1;netcoreapp3.1;net5.0 - $(TargetFrameworks);net46 + $(TargetFrameworks);net461 false diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj index 1f8bb0fcf..76516e01b 100644 --- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj +++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1;netcoreapp3.1;net5.0 + netcoreapp3.1;net5.0 $(TargetFrameworks);net461 $(TARGET_FRAMEWORK) false diff --git a/test/OpenTelemetry.Exporter.ZPages.Tests/OpenTelemetry.Exporter.ZPages.Tests.csproj b/test/OpenTelemetry.Exporter.ZPages.Tests/OpenTelemetry.Exporter.ZPages.Tests.csproj index 1601ff3f3..6e274222f 100644 --- a/test/OpenTelemetry.Exporter.ZPages.Tests/OpenTelemetry.Exporter.ZPages.Tests.csproj +++ b/test/OpenTelemetry.Exporter.ZPages.Tests/OpenTelemetry.Exporter.ZPages.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1;netcoreapp3.1;net5.0 + netcoreapp3.1;net5.0 $(TargetFrameworks);net461 false diff --git a/test/OpenTelemetry.Exporter.Zipkin.Tests/OpenTelemetry.Exporter.Zipkin.Tests.csproj b/test/OpenTelemetry.Exporter.Zipkin.Tests/OpenTelemetry.Exporter.Zipkin.Tests.csproj index 4ee3be53e..e80211513 100644 --- a/test/OpenTelemetry.Exporter.Zipkin.Tests/OpenTelemetry.Exporter.Zipkin.Tests.csproj +++ b/test/OpenTelemetry.Exporter.Zipkin.Tests/OpenTelemetry.Exporter.Zipkin.Tests.csproj @@ -1,7 +1,7 @@  Unit test project for Zipkin Exporter for OpenTelemetry - netcoreapp2.1;netcoreapp3.1;net5.0 + netcoreapp3.1;net5.0 $(TargetFrameworks);net461 false diff --git a/test/OpenTelemetry.Extensions.Hosting.Tests/OpenTelemetry.Extensions.Hosting.Tests.csproj b/test/OpenTelemetry.Extensions.Hosting.Tests/OpenTelemetry.Extensions.Hosting.Tests.csproj index 06e5ae590..8244def8a 100644 --- a/test/OpenTelemetry.Extensions.Hosting.Tests/OpenTelemetry.Extensions.Hosting.Tests.csproj +++ b/test/OpenTelemetry.Extensions.Hosting.Tests/OpenTelemetry.Extensions.Hosting.Tests.csproj @@ -1,7 +1,7 @@  Unit test project for OpenTelemetry .NET Core hosting library - netcoreapp2.1;netcoreapp3.1;net5.0 + netcoreapp3.1;net5.0 $(TargetFrameworks);net461 diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/OpenTelemetry.Instrumentation.AspNetCore.Tests.csproj b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/OpenTelemetry.Instrumentation.AspNetCore.Tests.csproj index d054ac6dc..4b9534836 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/OpenTelemetry.Instrumentation.AspNetCore.Tests.csproj +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/OpenTelemetry.Instrumentation.AspNetCore.Tests.csproj @@ -1,7 +1,7 @@  Unit test project for OpenTelemetry ASP.NET Core instrumentation - netcoreapp2.1;netcoreapp3.1;net5.0 + netcoreapp3.1;net5.0 @@ -32,13 +32,4 @@ - - - - - - - - - diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/OpenTelemetry.Instrumentation.Http.Tests.csproj b/test/OpenTelemetry.Instrumentation.Http.Tests/OpenTelemetry.Instrumentation.Http.Tests.csproj index 63550d79b..56726c1fb 100644 --- a/test/OpenTelemetry.Instrumentation.Http.Tests/OpenTelemetry.Instrumentation.Http.Tests.csproj +++ b/test/OpenTelemetry.Instrumentation.Http.Tests/OpenTelemetry.Instrumentation.Http.Tests.csproj @@ -1,7 +1,7 @@  Unit test project for OpenTelemetry HTTP instrumentations - netcoreapp2.1;netcoreapp3.1;net5.0 + netcoreapp3.1;net5.0 $(TargetFrameworks);net461 diff --git a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/OpenTelemetry.Instrumentation.SqlClient.Tests.csproj b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/OpenTelemetry.Instrumentation.SqlClient.Tests.csproj index 923754418..dcb9b2d8c 100644 --- a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/OpenTelemetry.Instrumentation.SqlClient.Tests.csproj +++ b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/OpenTelemetry.Instrumentation.SqlClient.Tests.csproj @@ -1,7 +1,7 @@  Unit test project for OpenTelemetry SqlClient instrumentations - netcoreapp2.1;netcoreapp3.1;net5.0 + netcoreapp3.1;net5.0 $(TargetFrameworks);net461 $(TARGET_FRAMEWORK) diff --git a/test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests.csproj b/test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests.csproj index 537d719b9..4fac60d2c 100644 --- a/test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests.csproj +++ b/test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests.csproj @@ -1,7 +1,7 @@  Unit test project for OpenTelemetry StackExchangeRedis instrumentation - netcoreapp2.1;netcoreapp3.1;net5.0 + netcoreapp3.1;net5.0 $(TargetFrameworks);net461 $(TARGET_FRAMEWORK) diff --git a/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/OpenTelemetry.Instrumentation.W3cTraceContext.Tests.csproj b/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/OpenTelemetry.Instrumentation.W3cTraceContext.Tests.csproj index fe94d2309..edd45e8eb 100644 --- a/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/OpenTelemetry.Instrumentation.W3cTraceContext.Tests.csproj +++ b/test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/OpenTelemetry.Instrumentation.W3cTraceContext.Tests.csproj @@ -2,7 +2,7 @@ Unit test project for OpenTelemetry ASP.NET Core instrumentation for W3C Trace Context Trace - netcoreapp2.1;netcoreapp3.1;net5.0 + netcoreapp3.1;net5.0 $(TARGET_FRAMEWORK) @@ -36,13 +36,6 @@ - - - true - - - - diff --git a/test/OpenTelemetry.Shims.OpenTracing.Tests/OpenTelemetry.Shims.OpenTracing.Tests.csproj b/test/OpenTelemetry.Shims.OpenTracing.Tests/OpenTelemetry.Shims.OpenTracing.Tests.csproj index 45c4ffc99..ba27221aa 100644 --- a/test/OpenTelemetry.Shims.OpenTracing.Tests/OpenTelemetry.Shims.OpenTracing.Tests.csproj +++ b/test/OpenTelemetry.Shims.OpenTracing.Tests/OpenTelemetry.Shims.OpenTracing.Tests.csproj @@ -1,7 +1,7 @@  Unit test project for OpenTelemetry.Shims.OpenTracing - netcoreapp2.1;netcoreapp3.1;net5.0 + netcoreapp3.1;net5.0 diff --git a/test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj b/test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj index 7a790bf34..b61e43c04 100644 --- a/test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj +++ b/test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj @@ -1,7 +1,7 @@  Unit test project for OpenTelemetry - netcoreapp2.1;netcoreapp3.1;net5.0 + netcoreapp3.1;net5.0 $(TargetFrameworks);net461 $(NoWarn),CS0618 @@ -11,13 +11,8 @@ - - - - - - - + + diff --git a/test/TestApp.AspNetCore.2.1/AssemblyInfo.cs b/test/TestApp.AspNetCore.2.1/AssemblyInfo.cs deleted file mode 100644 index 915791020..000000000 --- a/test/TestApp.AspNetCore.2.1/AssemblyInfo.cs +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage( - "StyleCop.CSharp.NamingRules", - "SA1300", - Justification = "Reviewed.", - Scope = "namespaceanddescendants", - Target = "TestApp.AspNetCore._2._1")] diff --git a/test/TestApp.AspNetCore.2.1/CallbackMiddleware.cs b/test/TestApp.AspNetCore.2.1/CallbackMiddleware.cs deleted file mode 100644 index fce28d8e1..000000000 --- a/test/TestApp.AspNetCore.2.1/CallbackMiddleware.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; - -namespace TestApp.AspNetCore._2._1 -{ - public class CallbackMiddleware - { - private readonly CallbackMiddlewareImpl impl; - private readonly RequestDelegate next; - - public CallbackMiddleware(RequestDelegate next, CallbackMiddlewareImpl impl) - { - this.next = next; - this.impl = impl; - } - - public async Task InvokeAsync(HttpContext context) - { - if (this.impl == null || await this.impl.ProcessAsync(context)) - { - await this.next(context); - } - } - - public class CallbackMiddlewareImpl - { - public virtual async Task ProcessAsync(HttpContext context) - { - return await Task.FromResult(true); - } - } - } -} diff --git a/test/TestApp.AspNetCore.2.1/Controllers/ChildActivityController.cs b/test/TestApp.AspNetCore.2.1/Controllers/ChildActivityController.cs deleted file mode 100644 index dab0b28f6..000000000 --- a/test/TestApp.AspNetCore.2.1/Controllers/ChildActivityController.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -using System.Collections.Generic; -using System.Diagnostics; -using Microsoft.AspNetCore.Mvc; -using OpenTelemetry; - -namespace TestApp.AspNetCore._2._1.Controllers -{ - public class ChildActivityController : Controller - { - [Route("api/GetChildActivityTraceContext")] - public Dictionary GetChildActivityTraceContext() - { - var result = new Dictionary(); - var activity = new Activity("ActivityInsideHttpRequest"); - activity.Start(); - result["TraceId"] = activity.Context.TraceId.ToString(); - result["ParentSpanId"] = activity.ParentSpanId.ToString(); - result["TraceState"] = activity.Context.TraceState; - activity.Stop(); - return result; - } - - [Route("api/GetChildActivityBaggageContext")] - public IReadOnlyDictionary GetChildActivityBaggageContext() - { - var result = Baggage.Current.GetBaggage(); - return result; - } - } -} diff --git a/test/TestApp.AspNetCore.2.1/Controllers/ForwardController.cs b/test/TestApp.AspNetCore.2.1/Controllers/ForwardController.cs deleted file mode 100644 index 776992ffb..000000000 --- a/test/TestApp.AspNetCore.2.1/Controllers/ForwardController.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Newtonsoft.Json; - -namespace TestApp.AspNetCore._2._1.Controllers -{ - [Route("api/[controller]")] - public class ForwardController : Controller - { - private readonly HttpClient httpClient; - - public ForwardController(HttpClient httpClient) - { - this.httpClient = httpClient; - } - - // POST api/test - [HttpPost] - public async Task Post([FromBody] Data[] data) - { - var result = string.Empty; - - if (data != null) - { - foreach (var argument in data) - { - var request = new HttpRequestMessage(HttpMethod.Post, argument.Url) - { - Content = new StringContent( - JsonConvert.SerializeObject(argument.Arguments), - Encoding.UTF8, - "application/json"), - }; - await this.httpClient.SendAsync(request); - } - } - else - { - result = "done"; - } - - return result; - } - - public class Data - { - [JsonProperty("url")] - public string Url { get; set; } - - [JsonProperty("arguments")] - public Data[] Arguments { get; set; } - } - } -} diff --git a/test/TestApp.AspNetCore.2.1/Controllers/ValuesController.cs b/test/TestApp.AspNetCore.2.1/Controllers/ValuesController.cs deleted file mode 100644 index 41d595682..000000000 --- a/test/TestApp.AspNetCore.2.1/Controllers/ValuesController.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -using System.Collections.Generic; -using Microsoft.AspNetCore.Mvc; - -namespace TestApp.AspNetCore._2._1.Controllers -{ - [Route("api/[controller]")] - public class ValuesController : Controller - { - // GET api/values - [HttpGet] - public IEnumerable Get() - { - return new string[] { "value1", "value2" }; - } - - // GET api/values/5 - [HttpGet("{id}")] - public string Get(int id) - { - return "value"; - } - - // POST api/values - [HttpPost] - public void Post([FromBody] string value) - { - } - - // PUT api/values/5 - [HttpPut("{id}")] - public void Put(int id, [FromBody] string value) - { - } - - // DELETE api/values/5 - [HttpDelete("{id}")] - public void Delete(int id) - { - } - } -} diff --git a/test/TestApp.AspNetCore.2.1/Program.cs b/test/TestApp.AspNetCore.2.1/Program.cs deleted file mode 100644 index 933ee3b13..000000000 --- a/test/TestApp.AspNetCore.2.1/Program.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; - -namespace TestApp.AspNetCore._2._1 -{ - public class Program - { - public static void Main(string[] args) - { - CreateWebHostBuilder(args).Build().Run(); - } - - public static IWebHostBuilder CreateWebHostBuilder(string[] args) => - WebHost.CreateDefaultBuilder(args) - .UseStartup(); - } -} diff --git a/test/TestApp.AspNetCore.2.1/Startup.cs b/test/TestApp.AspNetCore.2.1/Startup.cs deleted file mode 100644 index 351dcd689..000000000 --- a/test/TestApp.AspNetCore.2.1/Startup.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -using System.Net.Http; - -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; - -namespace TestApp.AspNetCore._2._1 -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - this.Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); - services.AddSingleton(); - services.AddSingleton( - new CallbackMiddleware.CallbackMiddlewareImpl()); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseMiddleware(); - app.UseMvc(); - } - } -} diff --git a/test/TestApp.AspNetCore.2.1/TestApp.AspNetCore.2.1.csproj b/test/TestApp.AspNetCore.2.1/TestApp.AspNetCore.2.1.csproj deleted file mode 100644 index 64853506a..000000000 --- a/test/TestApp.AspNetCore.2.1/TestApp.AspNetCore.2.1.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - netcoreapp2.1 - - - - - - - - - - - - - - - - - - - - - -