Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgraded the build/CI to use net8.0 #4876

Merged
merged 25 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5c78f38
test
Yun-Ting Sep 22, 2023
1bff4e7
Merge branch 'main' into yunl/net8CI
Yun-Ting Sep 29, 2023
f8ec864
dummy fix for Run W3C Trace Context docker-compose.integration
Yun-Ting Sep 29, 2023
ebde412
add net8.0 to OpenTelemetry.Tests proj
Yun-Ting Sep 29, 2023
7bf3f82
add net8.0 to OpenTelemetry.Instrumentation*.Tests.dll (sql??)
Yun-Ting Sep 29, 2023
df153bd
remove 8 from aspnetcore test
Yun-Ting Sep 29, 2023
93f4e7c
update docker file SDK version
Yun-Ting Sep 29, 2023
5520d90
use Microsoft.AspNetCore.TestHost when targeting net8
Yun-Ting Sep 29, 2023
eb9a4d1
Microsoft.AspNetCore.Mvc.Testing
Yun-Ting Sep 29, 2023
a51d664
Merge branch 'main' into yunl/net8CI
Yun-Ting Sep 29, 2023
0bad326
Merge branch 'main' into yunl/net8CI
Yun-Ting Sep 29, 2023
f2103a4
use new infra
Yun-Ting Sep 29, 2023
dba3efe
Merge branch 'main' into yunl/net8CI
Yun-Ting Sep 29, 2023
adf1ba3
PUBLISH_FRAMEWORK=net8.0
Yun-Ting Sep 29, 2023
d703ea4
OTLP test docker publish framework to net8
Yun-Ting Sep 29, 2023
5c31a55
scope down
Yun-Ting Sep 29, 2023
ccf9384
should fix these test for ubuntu net8 properly in the follow-up prs
Yun-Ting Sep 29, 2023
3f2437e
preprocessors
Yun-Ting Sep 29, 2023
00f207f
merge main
Yun-Ting Oct 2, 2023
16516c6
enable net8 for AspNetCore tests
Yun-Ting Oct 2, 2023
9e90df3
os
Yun-Ting Oct 2, 2023
bbdcb43
when !OSX || !NET8_0
Yun-Ting Oct 2, 2023
e469816
add net8 to tests and update tracertests
Yun-Ting Oct 2, 2023
ce5872d
removed conditional compilation !OSX || !NET8_0 for AspNetCore tests
Yun-Ting Oct 2, 2023
7db50c3
Merge branch 'main' into yunl/net8CI
Yun-Ting Oct 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-instrumentation-libraries-md.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-instrumentation-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-md.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integration-md.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ 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"'

w3c-trace-context-test:
runs-on: ubuntu-latest
strategy:
matrix:
version: [net6.0,net7.0]
version: [ net6.0, net7.0, net8.0 ]
steps:
- run: 'echo "No build required"'

otlp-exporter-test:
runs-on: ubuntu-latest
strategy:
matrix:
version: [net6.0,net7.0]
version: [ net6.0, net7.0 , net8.0 ]
steps:
- run: 'echo "No build required"'
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
<TargetFrameworksForPrometheusAspNetCore>net6.0</TargetFrameworksForPrometheusAspNetCore>

<!-- non-production TFMs -->
<TargetFrameworksForAspNetCoreTests>net7.0;net6.0</TargetFrameworksForAspNetCoreTests>
<TargetFrameworksForAspNetCoreTests>net8.0;net7.0;net6.0</TargetFrameworksForAspNetCoreTests>
<TargetFrameworksForAotCompatibilityTests>net8.0</TargetFrameworksForAotCompatibilityTests>
<TargetFrameworksForDocs>net7.0;net6.0</TargetFrameworksForDocs>
<TargetFrameworksForDocs Condition="$(OS) == 'Windows_NT' And '$(UsingMicrosoftNETSdkWeb)' == 'False'">
$(TargetFrameworksForDocs);net481;net48;net472;net471;net47;net462
</TargetFrameworksForDocs>
<TargetFrameworksForTests>net7.0;net6.0</TargetFrameworksForTests>
<TargetFrameworksForTests>net8.0;net7.0;net6.0</TargetFrameworksForTests>
<TargetFrameworksForTests Condition="$(OS) == 'Windows_NT'">
$(TargetFrameworksForTests);net462
</TargetFrameworksForTests>
Expand Down
9 changes: 9 additions & 0 deletions build/docker-compose.net8.0.yml
Original file line number Diff line number Diff line change
@@ -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"
34 changes: 17 additions & 17 deletions test/OpenTelemetry.Api.Tests/Trace/TracerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Yun-Ting marked this conversation as resolved.
Show resolved Hide resolved

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]
Expand Down Expand Up @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageReference Include="Microsoft.Extensions.Http" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" />
<PackageReference Include="Grpc.AspNetCore.Server" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Prometheus.AspNetCore\OpenTelemetry.Exporter.Prometheus.AspNetCore.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net8.0'">
Yun-Ting marked this conversation as resolved.
Show resolved Hide resolved
<PackageReference Include="Microsoft.AspNetCore.TestHost" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// limitations under the License.
// </copyright>

#if NET6_0_OR_GREATER
using System.Diagnostics;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -85,4 +84,3 @@ public async void Dispose()
await this.app.DisposeAsync().ConfigureAwait(false);
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<Compile Include="$(RepoRoot)\test\OpenTelemetry.Tests\Shared\TestEventListener.cs" Link="Includes\TestEventListener.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net8.0'">
Yun-Ting marked this conversation as resolved.
Show resolved Hide resolved
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
</ItemGroup>

Expand Down