From 50bff241719e644b7c0f131048ef06cd60ff7fa2 Mon Sep 17 00:00:00 2001 From: Sean Li Date: Fri, 6 Dec 2024 17:34:58 -0800 Subject: [PATCH 1/7] Add back tests which were failing on Linux after adding .NET 9 SDK. I'm not able to reproduce the failures locally. Not sure why they were failing before. --- .../UnixUserEventsDataTransportTests.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/OpenTelemetry.Exporter.Geneva.Tests/UnixUserEventsDataTransportTests.cs b/test/OpenTelemetry.Exporter.Geneva.Tests/UnixUserEventsDataTransportTests.cs index c2b3eb1c80..ee887b3abc 100644 --- a/test/OpenTelemetry.Exporter.Geneva.Tests/UnixUserEventsDataTransportTests.cs +++ b/test/OpenTelemetry.Exporter.Geneva.Tests/UnixUserEventsDataTransportTests.cs @@ -7,6 +7,7 @@ using System.Globalization; using System.Text.RegularExpressions; using Microsoft.LinuxTracepoints.Provider; +using OpenTelemetry.Tests; using Xunit; using Xunit.Abstractions; @@ -49,7 +50,7 @@ public UnixUserEventsDataTransportTests(ITestOutputHelper testOutputHelper) this.testOutputHelper = testOutputHelper; } - [Fact(Skip = "This would fail on Ubuntu. Skipping for now.")] + [SkipUnlessPlatformMatchesFact(TestPlatform.Linux, requireElevatedProcess: true)] public void UserEvents_Enabled_Success_Linux() { EnsureUserEventsEnabled(); @@ -113,7 +114,7 @@ public void UserEvents_Enabled_Success_Linux() } } - [Fact(Skip = "This would fail on Ubuntu. Skipping for now.")] + [SkipUnlessPlatformMatchesFact(TestPlatform.Linux, requireElevatedProcess: true)] public void UserEvents_Disabled_Success_Linux() { EnsureUserEventsEnabled(); From 7ee4269ffc6d54ae2cb29920dc9a899482512459 Mon Sep 17 00:00:00 2001 From: Sean Li Date: Fri, 6 Dec 2024 17:57:36 -0800 Subject: [PATCH 2/7] Set custom os version --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1557da70f4..1fb60cadac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,6 +104,8 @@ jobs: with: project-name: Component[OpenTelemetry.Exporter.Geneva] code-cov-name: Exporter.Geneva + os-list: '[ "ubuntu-24.04" ]' # Note: This may be switched to latest once ubuntu-latest has a kernel version >= 6.8.0-1014-azure + tfm-list: '[ "net8.0", "net9.0" ]' # Note: Should be able to remove this once the above is using ubuntu-latest test-case-filter: CategoryName=Geneva:user_events:metrics test-require-elevated: true pack: false From 302eddad270146f2f759a9ad575151d6398693ed Mon Sep 17 00:00:00 2001 From: Sean Li Date: Mon, 9 Dec 2024 15:08:28 -0800 Subject: [PATCH 3/7] attempt to fix error during dotnet test step for Geneva Integration test: Requested SDK version: 9.0.100 global.json file: /home/runner/work/opentelemetry-dotnet-contrib/opentelemetry-dotnet-contrib/global.json Installed SDKs: Install the [9.0.100] .NET SDK or update [/home/runner/work/opentelemetry-dotnet-contrib/opentelemetry-dotnet-contrib/global.json] to match an installed SDK. --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 6a79b98070..df28660f8e 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { "rollForward": "latestFeature", - "version": "9.0.100" + "version": "9.0.101" } } From 7e4ac85bce45f63203286ba8ba2a42e9010727b6 Mon Sep 17 00:00:00 2001 From: Sean Li Date: Tue, 10 Dec 2024 10:54:39 -0800 Subject: [PATCH 4/7] attempt to fix error during dotnet test step for Geneva Integration test by removing sudo --- .github/workflows/Component.BuildTest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Component.BuildTest.yml b/.github/workflows/Component.BuildTest.yml index dc571bb118..84a0e8d602 100644 --- a/.github/workflows/Component.BuildTest.yml +++ b/.github/workflows/Component.BuildTest.yml @@ -100,7 +100,7 @@ jobs: - name: dotnet test ${{ steps.resolve-project.outputs.title }} if: ${{ inputs.run-tests }} run: > - ${{ inputs.test-require-elevated && matrix.os != 'windows-latest' && 'sudo -E' || '' }} + ${{ inputs.test-require-elevated && matrix.os != 'windows-latest' && 'dotnet --info && ' || '' }} dotnet test ${{ steps.resolve-project.outputs.project }} --collect:"Code Coverage" --results-directory:TestResults From e21483f9f71db940d94722377d431e2c4acd91b5 Mon Sep 17 00:00:00 2001 From: Sean Li Date: Tue, 10 Dec 2024 11:01:08 -0800 Subject: [PATCH 5/7] show PATH before running dotnet test --- .github/workflows/Component.BuildTest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Component.BuildTest.yml b/.github/workflows/Component.BuildTest.yml index 84a0e8d602..af103e8888 100644 --- a/.github/workflows/Component.BuildTest.yml +++ b/.github/workflows/Component.BuildTest.yml @@ -100,7 +100,7 @@ jobs: - name: dotnet test ${{ steps.resolve-project.outputs.title }} if: ${{ inputs.run-tests }} run: > - ${{ inputs.test-require-elevated && matrix.os != 'windows-latest' && 'dotnet --info && ' || '' }} + ${{ inputs.test-require-elevated && matrix.os != 'windows-latest' && 'dotnet --info && echo $PATH && sudo -E' || '' }} dotnet test ${{ steps.resolve-project.outputs.project }} --collect:"Code Coverage" --results-directory:TestResults From dd7570b25f2b63aae474a0eeb52fcfda5d041879 Mon Sep 17 00:00:00 2001 From: Sean Li Date: Tue, 10 Dec 2024 11:08:30 -0800 Subject: [PATCH 6/7] Run echo $PATH with sudo -E as well --- .github/workflows/Component.BuildTest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Component.BuildTest.yml b/.github/workflows/Component.BuildTest.yml index af103e8888..712442940d 100644 --- a/.github/workflows/Component.BuildTest.yml +++ b/.github/workflows/Component.BuildTest.yml @@ -100,7 +100,7 @@ jobs: - name: dotnet test ${{ steps.resolve-project.outputs.title }} if: ${{ inputs.run-tests }} run: > - ${{ inputs.test-require-elevated && matrix.os != 'windows-latest' && 'dotnet --info && echo $PATH && sudo -E' || '' }} + ${{ inputs.test-require-elevated && matrix.os != 'windows-latest' && 'dotnet --info && echo $PATH && sudo -E echo $PATH && sudo -E' || '' }} dotnet test ${{ steps.resolve-project.outputs.project }} --collect:"Code Coverage" --results-directory:TestResults From f085619ac7422ac5618ccea83a07880641847a18 Mon Sep 17 00:00:00 2001 From: Sean Li Date: Tue, 10 Dec 2024 13:44:53 -0800 Subject: [PATCH 7/7] add `/usr/share/dotnet` to the start of PATH --- .github/workflows/Component.BuildTest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Component.BuildTest.yml b/.github/workflows/Component.BuildTest.yml index 712442940d..4486bb6033 100644 --- a/.github/workflows/Component.BuildTest.yml +++ b/.github/workflows/Component.BuildTest.yml @@ -100,7 +100,7 @@ jobs: - name: dotnet test ${{ steps.resolve-project.outputs.title }} if: ${{ inputs.run-tests }} run: > - ${{ inputs.test-require-elevated && matrix.os != 'windows-latest' && 'dotnet --info && echo $PATH && sudo -E echo $PATH && sudo -E' || '' }} + ${{ inputs.test-require-elevated && matrix.os != 'windows-latest' && 'dotnet --info && echo $PATH && sudo echo $PATH && sudo -E echo $PATH && export PATH=/usr/share/dotnet:$PATH && echo $PATH && sudo -E' || '' }} dotnet test ${{ steps.resolve-project.outputs.project }} --collect:"Code Coverage" --results-directory:TestResults