diff --git a/.github/workflows/ci-instrumentation-libraries-md.yml b/.github/workflows/ci-instrumentation-libraries-md.yml
index b9d3845117d..b7fec06fe95 100644
--- a/.github/workflows/ci-instrumentation-libraries-md.yml
+++ b/.github/workflows/ci-instrumentation-libraries-md.yml
@@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
- version: [ net462, net6.0, net7.0 ]
+ version: [ net462, net6.0, net7.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
diff --git a/.github/workflows/ci-instrumentation-libraries.yml b/.github/workflows/ci-instrumentation-libraries.yml
index 9e28bda8963..546a0ae7447 100644
--- a/.github/workflows/ci-instrumentation-libraries.yml
+++ b/.github/workflows/ci-instrumentation-libraries.yml
@@ -16,7 +16,7 @@ jobs:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ windows-latest, ubuntu-latest ]
- version: [ net462, net6.0, net7.0 ]
+ version: [ net462, net6.0, net7.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
diff --git a/.github/workflows/ci-md.yml b/.github/workflows/ci-md.yml
index 1ecb0470c3f..579b3464e94 100644
--- a/.github/workflows/ci-md.yml
+++ b/.github/workflows/ci-md.yml
@@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
- version: [ net462, net6.0, net7.0 ]
+ version: [ net462, net6.0, net7.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
@@ -31,7 +31,7 @@ jobs:
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
- version: [ net462, net6.0, net7.0 ]
+ version: [ net462, net6.0, net7.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 13de0700eb4..3387af214c0 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -16,7 +16,7 @@ jobs:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ windows-latest, ubuntu-latest ]
- version: [ net462, net6.0, net7.0 ]
+ version: [ net462, net6.0, net7.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
@@ -44,7 +44,7 @@ jobs:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ windows-latest, ubuntu-latest ]
- version: [ net462, net6.0, net7.0 ]
+ version: [ net462, net6.0, net7.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
diff --git a/.github/workflows/integration-md.yml b/.github/workflows/integration-md.yml
index 516bcbb7f53..7304792eb68 100644
--- a/.github/workflows/integration-md.yml
+++ b/.github/workflows/integration-md.yml
@@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- version: [net6.0,net7.0]
+ version: [ net6.0, net7.0, net8.0 ]
steps:
- run: 'echo "No build required"'
@@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- version: [net6.0,net7.0]
+ version: [ net6.0, net7.0, net8.0 ]
steps:
- run: 'echo "No build required"'
@@ -34,6 +34,6 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- version: [net6.0,net7.0]
+ version: [ net6.0, net7.0 , net8.0 ]
steps:
- run: 'echo "No build required"'
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index 3c9b654694d..cf7f63d63d4 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- version: [net6.0,net7.0]
+ version: [ net6.0, net7.0 ]
steps:
- uses: actions/checkout@v4
@@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- version: [net6.0,net7.0]
+ version: [ net6.0, net7.0, net8.0 ]
steps:
- uses: actions/checkout@v4
diff --git a/build/Common.props b/build/Common.props
index dcf9c421d18..ab68021f5d5 100644
--- a/build/Common.props
+++ b/build/Common.props
@@ -23,13 +23,13 @@
net6.0
- net7.0;net6.0
+ net8.0;net7.0;net6.0
net8.0
net7.0;net6.0
$(TargetFrameworksForDocs);net481;net48;net472;net471;net47;net462
- net7.0;net6.0
+ net8.0;net7.0;net6.0
$(TargetFrameworksForTests);net462
diff --git a/build/docker-compose.net8.0.yml b/build/docker-compose.net8.0.yml
new file mode 100644
index 00000000000..a5ac999e43e
--- /dev/null
+++ b/build/docker-compose.net8.0.yml
@@ -0,0 +1,9 @@
+version: '3.7'
+
+services:
+ tests:
+ build:
+ args:
+ PUBLISH_FRAMEWORK: net8.0
+ TEST_SDK_VERSION: "8.0"
+ BUILD_SDK_VERSION: "8.0"
diff --git a/test/OpenTelemetry.Api.Tests/Trace/TracerTest.cs b/test/OpenTelemetry.Api.Tests/Trace/TracerTest.cs
index 115417efba8..22657b8f280 100644
--- a/test/OpenTelemetry.Api.Tests/Trace/TracerTest.cs
+++ b/test/OpenTelemetry.Api.Tests/Trace/TracerTest.cs
@@ -62,13 +62,13 @@ public void Tracer_StartRootSpan_BadArgs_NullSpanName()
.Build();
var span1 = this.tracer.StartRootSpan(null);
- Assert.Null(span1.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span1.Activity.DisplayName));
var span2 = this.tracer.StartRootSpan(null, SpanKind.Client);
- Assert.Null(span2.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span2.Activity.DisplayName));
var span3 = this.tracer.StartRootSpan(null, SpanKind.Client, default);
- Assert.Null(span3.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span3.Activity.DisplayName));
}
[Fact]
@@ -118,13 +118,13 @@ public void Tracer_StartSpan_BadArgs_NullSpanName()
.Build();
var span1 = this.tracer.StartSpan(null);
- Assert.Null(span1.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span1.Activity.DisplayName));
var span2 = this.tracer.StartSpan(null, SpanKind.Client);
- Assert.Null(span2.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span2.Activity.DisplayName));
var span3 = this.tracer.StartSpan(null, SpanKind.Client, null);
- Assert.Null(span3.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span3.Activity.DisplayName));
}
[Fact]
@@ -135,13 +135,13 @@ public void Tracer_StartActiveSpan_BadArgs_NullSpanName()
.Build();
var span1 = this.tracer.StartActiveSpan(null);
- Assert.Null(span1.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span1.Activity.DisplayName));
var span2 = this.tracer.StartActiveSpan(null, SpanKind.Client);
- Assert.Null(span2.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span2.Activity.DisplayName));
var span3 = this.tracer.StartActiveSpan(null, SpanKind.Client, null);
- Assert.Null(span3.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span3.Activity.DisplayName));
}
[Fact]
@@ -152,10 +152,10 @@ public void Tracer_StartSpan_FromParent_BadArgs_NullSpanName()
.Build();
var span1 = this.tracer.StartSpan(null, SpanKind.Client, TelemetrySpan.NoopInstance);
- Assert.Null(span1.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span1.Activity.DisplayName));
var span2 = this.tracer.StartSpan(null, SpanKind.Client, TelemetrySpan.NoopInstance, default);
- Assert.Null(span2.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span2.Activity.DisplayName));
}
[Fact]
@@ -168,10 +168,10 @@ public void Tracer_StartSpan_FromParentContext_BadArgs_NullSpanName()
var blankContext = default(SpanContext);
var span1 = this.tracer.StartSpan(null, SpanKind.Client, blankContext);
- Assert.Null(span1.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span1.Activity.DisplayName));
var span2 = this.tracer.StartSpan(null, SpanKind.Client, blankContext, default);
- Assert.Null(span2.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span2.Activity.DisplayName));
}
[Fact]
@@ -182,10 +182,10 @@ public void Tracer_StartActiveSpan_FromParent_BadArgs_NullSpanName()
.Build();
var span1 = this.tracer.StartActiveSpan(null, SpanKind.Client, TelemetrySpan.NoopInstance);
- Assert.Null(span1.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span1.Activity.DisplayName));
var span2 = this.tracer.StartActiveSpan(null, SpanKind.Client, TelemetrySpan.NoopInstance, default);
- Assert.Null(span2.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span2.Activity.DisplayName));
}
[Fact]
@@ -198,10 +198,10 @@ public void Tracer_StartActiveSpan_FromParentContext_BadArgs_NullSpanName()
var blankContext = default(SpanContext);
var span1 = this.tracer.StartActiveSpan(null, SpanKind.Client, blankContext);
- Assert.Null(span1.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span1.Activity.DisplayName));
var span2 = this.tracer.StartActiveSpan(null, SpanKind.Client, blankContext, default);
- Assert.Null(span2.Activity.DisplayName);
+ Assert.True(string.IsNullOrEmpty(span2.Activity.DisplayName));
}
[Fact]
diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest/Dockerfile b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest/Dockerfile
index aee92bf0ce4..691524a9d28 100644
--- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest/Dockerfile
+++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest/Dockerfile
@@ -2,12 +2,12 @@
# This should be run from the root of the repo:
# docker build --file test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest/Dockerfile
-ARG BUILD_SDK_VERSION=7.0
-ARG TEST_SDK_VERSION=7.0
+ARG BUILD_SDK_VERSION=8.0
+ARG TEST_SDK_VERSION=8.0
FROM mcr.microsoft.com/dotnet/sdk:${BUILD_SDK_VERSION} AS build
ARG PUBLISH_CONFIGURATION=Release
-ARG PUBLISH_FRAMEWORK=net7.0
+ARG PUBLISH_FRAMEWORK=net8.0
WORKDIR /repo
COPY . ./
WORKDIR "/repo/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests"
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 2bb2b27d8fd..e93beb327d5 100644
--- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj
+++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj
@@ -17,7 +17,7 @@
-
+
diff --git a/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests.csproj b/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests.csproj
index 964ad48d55d..e93f4d2e3ed 100644
--- a/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests.csproj
+++ b/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests.csproj
@@ -23,7 +23,7 @@
-
+
diff --git a/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/PrometheusExporterMiddlewareTests.cs b/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/PrometheusExporterMiddlewareTests.cs
index c863b08ed78..3de33a38cba 100644
--- a/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/PrometheusExporterMiddlewareTests.cs
+++ b/test/OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests/PrometheusExporterMiddlewareTests.cs
@@ -20,6 +20,7 @@
using System.Text.RegularExpressions;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@@ -112,7 +113,7 @@ public Task PrometheusExporterMiddlewareIntegration_MixedPredicateAndPath()
path: "/metrics_path",
configureBranchedPipeline: branch => branch.Use((context, next) =>
{
- context.Response.Headers.Add("X-MiddlewareExecuted", "true");
+ context.Response.Headers.Append("X-MiddlewareExecuted", "true");
return next();
}),
optionsName: null),
@@ -139,7 +140,7 @@ public Task PrometheusExporterMiddlewareIntegration_MixedPath()
path: "/metrics_path",
configureBranchedPipeline: branch => branch.Use((context, next) =>
{
- context.Response.Headers.Add("X-MiddlewareExecuted", "true");
+ context.Response.Headers.Append("X-MiddlewareExecuted", "true");
return next();
}),
optionsName: null),
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 266ad216f13..5a6e303401b 100644
--- a/test/OpenTelemetry.Extensions.Hosting.Tests/OpenTelemetry.Extensions.Hosting.Tests.csproj
+++ b/test/OpenTelemetry.Extensions.Hosting.Tests/OpenTelemetry.Extensions.Hosting.Tests.csproj
@@ -27,7 +27,7 @@
-
+
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/InProcServerTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/InProcServerTests.cs
index c3b16cf24af..f92a3ca20dd 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/InProcServerTests.cs
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/InProcServerTests.cs
@@ -14,7 +14,6 @@
// limitations under the License.
//
-#if NET6_0_OR_GREATER
using System.Diagnostics;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Logging;
@@ -85,4 +84,3 @@ public async void Dispose()
await this.app.DisposeAsync().ConfigureAwait(false);
}
}
-#endif
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 734d404a240..63b7ec9c6b3 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/OpenTelemetry.Instrumentation.AspNetCore.Tests.csproj
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/OpenTelemetry.Instrumentation.AspNetCore.Tests.csproj
@@ -27,7 +27,7 @@
-
+