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

[repo] Use project files for tests in dedicated CI flows #1390

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

CodeBlanch
Copy link
Member

Follow-up to #1386 (comment)

Changes

#1386 combined Instrumentation.AspNet + Instrumentation.AspNet.TelemetryHttpModule into the same CI & release workflows but only the tests for Instrumentation.AspNet were being run. This PR changes the workflows to use the project files which now have targets for testing.

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Merging #1390 (96c6092) into main (71655ce) will increase coverage by 0.16%.
Report is 22 commits behind head on main.
The diff coverage is 76.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1390      +/-   ##
==========================================
+ Coverage   73.91%   74.07%   +0.16%     
==========================================
  Files         267      258       -9     
  Lines        9615     9551      -64     
==========================================
- Hits         7107     7075      -32     
+ Misses       2508     2476      -32     
Flag Coverage Δ
unittests-Exporter.Geneva 58.09% <47.05%> (?)
unittests-Exporter.OneCollector 89.71% <ø> (?)
unittests-Instrumentation.AspNet 70.90% <ø> (?)
unittests-Instrumentation.Owin 85.71% <100.00%> (?)
unittests-Instrumentation.Process 100.00% <ø> (?)
unittests-Instrumentation.StackExchangeRedis 75.88% <ø> (?)
unittests-Instrumentation.Wcf 79.01% <82.27%> (?)
unittests-Solution 80.67% <41.17%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...orter.Geneva/MsgPackExporter/MsgPackLogExporter.cs 95.10% <100.00%> (+1.76%) ⬆️
...searchClient/ElasticsearchClientInstrumentation.cs 100.00% <100.00%> (ø)
...ityFrameworkCore/EntityFrameworkInstrumentation.cs 100.00% <100.00%> (ø)
...ation/EntityFrameworkInstrumentationEventSource.cs 12.00% <100.00%> (ø)
...ation.Owin/Implementation/DiagnosticsMiddleware.cs 89.42% <100.00%> (-2.44%) ⬇️
....Owin/Implementation/OwinInstrumentationMetrics.cs 100.00% <100.00%> (ø)
...inInstrumentationMeterProviderBuilderExtensions.cs 100.00% <100.00%> (ø)
...Instrumentation.Quartz/QuartzJobInstrumentation.cs 83.33% <100.00%> (+1.51%) ⬆️
...entation.Wcf/Implementation/InstrumentedChannel.cs 100.00% <100.00%> (ø)
...f/Implementation/InstrumentedChannelFactoryBase.cs 100.00% <100.00%> (ø)
... and 16 more

... and 33 files with indirect coverage changes

@Kielek Kielek added the infra Infra work - CI/CD, code coverage, linters label Oct 11, 2023
Copy link
Contributor

@Kielek Kielek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
D:\a\opentelemetry-dotnet-contrib\opentelemetry-dotnet-contrib\test\OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests\bin\Release\net462\OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests.dll
[xUnit.net 00:00:00.02] xUnit.net VSTest Adapter v2.5.0.1+5ebf84cd75 (64-bit .NET Framework 4.8.9186.0)
[xUnit.net 00:00:01.01]   Discovering: OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests
[xUnit.net 00:00:01.25]   Discovered:  OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests
[xUnit.net 00:00:01.26]   Starting:    OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigWithLocationTagTransformTest.VerifyInstallationWhenGlobalAndNonGlobalLocationTagExists [279 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigWithLocationTagTransformTest.VerifyInstallationToLocationTagWithEmptyPathWithNoModules [3 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigWithLocationTagTransformTest.VerifyInstallationWhenNonGlobalLocationTagExists [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigWithLocationTagTransformTest.VerifyInstallationToLocationTagWithDotPathWithGlobalModules [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigWithLocationTagTransformTest.VerifyInstallationToLocationTagWithDotPathWithNoModules [8 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigWithLocationTagTransformTest.VerifyInstallationToLocationTagWithEmptyPathAndExistingModules [2 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigWithLocationTagTransformTest.VerifyInstallationToLocationTagWithDotPathAndExistingModules [4 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigWithLocationTagTransformTest.VerifyInstallationToLocationTagWithEmptyPathWithGlobalModules [9 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigTransformTest.VerifyUpdateWithIntegratedModeWebConfig [295 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigTransformTest.VerifyUninstallationWithBasicWebConfig [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigTransformTest.VerifyUninstallationWithUserModules [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigTransformTest.VerifyInstallationToWebConfigWithoutModules [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigTransformTest.VerifyInstallationToBasicWebConfig [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigTransformTest.VerifyInstallationToEmptyWebConfig [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigTransformTest.VerifyUpdateWithTypeRenamingWebConfig [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigTransformTest.VerifyInstallationToWebConfigWithUserModules [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigTransformTest.VerifyUpdateNewerVersionWebConfig [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.WebConfigTransformTest.VerifyUninstallWithIntegratedPrecondition [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Has_Started_Returns_Correctly [239 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Can_Stop_Lost_Activity [128 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Do_Not_Restore_Activity_When_There_Is_No_Activity_In_Context [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Can_Stop_Activity_With_AspNetListener_Enabled [[11](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/actions/runs/6478157578/job/17589520561?pr=1390#step:6:12)1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Can_Create_RootActivity_From_W3C_Traceparent [47 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Can_Create_RootActivity_And_Start_Activity [2 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Should_Not_Create_RootActivity_If_AspNetListener_Not_Enabled [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Can_Stop_Root_While_Child_Is_Current [2 ms]
[xUnit.net 00:00:02.40]     OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Can_Restore_Baggage [SKIP]
[xUnit.net 00:00:02.40]       Temporarily disable until stable.
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Can_Stop_Root_Activity_With_All_Children [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Stop_Root_Activity_With_[12](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/actions/runs/6478157578/job/17589520561?pr=1390#step:6:13)9_Nesting_Depth [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Can_Restore_Activity [8 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Can_Create_RootActivity_From_W3C_Traceparent_With_Baggage [10 ms]
  Skipped OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Can_Restore_Baggage [1 ms]
  Error Message:
   Temporarily disable until stable.

  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Can_Stop_Root_Activity_If_It_Is_Broken [7 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Can_Stop_Activity_Without_AspNetListener_Enabled [1[13](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/actions/runs/6478157578/job/17589520561?pr=1390#step:6:14) ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Can_Create_RootActivity_And_Saved_In_HttContext [2 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Fire_Exception_Events [2 ms]
[xUnit.net 00:00:02.57]   Finished:    OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Can_Create_RootActivityWithTraceState_From_W3C_TraceContext [38 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Do_Not_Restore_Activity_When_It_Is_Not_Lost [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.ActivityHelperTest.Should_Not_Create_RootActivity_If_AspNetActivity_Not_Enabled [1 ms]

Test Run Successful.
Total tests: 38
     Passed: 37
    Skipped: 1
 Total time: 7.0490 Seconds
Test run for D:\a\opentelemetry-dotnet-contrib\opentelemetry-dotnet-contrib\test\OpenTelemetry.Instrumentation.AspNet.Tests\bin\Release\net462\OpenTelemetry.Instrumentation.AspNet.Tests.dll (.NETFramework,Version=v4.6.2)
Microsoft (R) Test Execution Command Line Tool Version [17](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/actions/runs/6478157578/job/17589520561?pr=1390#step:6:18).7.1 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
D:\a\opentelemetry-dotnet-contrib\opentelemetry-dotnet-contrib\test\OpenTelemetry.Instrumentation.AspNet.Tests\bin\Release\net462\OpenTelemetry.Instrumentation.AspNet.Tests.dll
[xUnit.net 00:00:00.01] xUnit.net VSTest Adapter v2.5.0.1+5ebf84cd75 (64-bit .NET Framework 4.8.9[18](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/actions/runs/6478157578/job/17589520561?pr=1390#step:6:19)6.0)
[xUnit.net 00:00:00.59]   Discovering: OpenTelemetry.Instrumentation.AspNet.Tests
[xUnit.net 00:00:00.85]   Discovered:  OpenTelemetry.Instrumentation.AspNet.Tests
[xUnit.net 00:00:00.86]   Starting:    OpenTelemetry.Instrumentation.AspNet.Tests
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.EventSourceTest.EventSourceTest_AspNetInstrumentationEventSource [45 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInMetricsListenerTests.HttpDurationMetricIsEmitted [1 s]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.AspNetRequestsAreCollectedSuccessfully(expectedUrl: "https://localhost/", url: "***localhost/", routeType: 0, routeTemplate: null, setStatusToErrorInEnrich: False, filter: null, recordException: False) [405 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.AspNetRequestsAreCollectedSuccessfully(expectedUrl: "https://localhost/", url: "https://localhost/", routeType: 0, routeTemplate: null, setStatusToErrorInEnrich: False, filter: null, recordException: False) [2 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.AspNetRequestsAreCollectedSuccessfully(expectedUrl: "http://localhost/", url: "http://localhost/", routeType: 0, routeTemplate: null, setStatusToErrorInEnrich: True, filter: null, recordException: False) [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.AspNetRequestsAreCollectedSuccessfully(expectedUrl: "http://localhost/api/value", url: "http://localhost/api/value", routeType: 0, routeTemplate: null, setStatusToErrorInEnrich: False, filter: "{ThrowException}", recordException: False) [5 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.AspNetRequestsAreCollectedSuccessfully(expectedUrl: "http://localhost/", url: "http://localhost/", routeType: 0, routeTemplate: null, setStatusToErrorInEnrich: False, filter: null, recordException: False) [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.AspNetRequestsAreCollectedSuccessfully(expectedUrl: "https://localhost:1843/subroute/10", url: "https://localhost:1843/subroute/10", routeType: 4, routeTemplate: "subroute/{customerId}", setStatusToErrorInEnrich: False, filter: null, recordException: False) [13 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.AspNetRequestsAreCollectedSuccessfully(expectedUrl: "http://localhost:443/", url: "http://localhost:443/", routeType: 0, routeTemplate: null, setStatusToErrorInEnrich: False, filter: null, recordException: False) [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.AspNetRequestsAreCollectedSuccessfully(expectedUrl: "http://localhost/api/value", url: "http://localhost/api/value", routeType: 0, routeTemplate: null, setStatusToErrorInEnrich: False, filter: "/api/value", recordException: False) [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.AspNetRequestsAreCollectedSuccessfully(expectedUrl: "http://localhost/", url: "http://localhost/", routeType: 0, routeTemplate: null, setStatusToErrorInEnrich: False, filter: null, recordException: True) [12 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.AspNetRequestsAreCollectedSuccessfully(expectedUrl: "https://localhost:443/about_attr_route/10", url: "https://localhost:443/about_attr_route/10", routeType: 2, routeTemplate: "about_attr_route/{customerId}", setStatusToErrorInEnrich: False, filter: null, recordException: False) [[20](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/actions/runs/6478157578/job/17589520561?pr=1390#step:6:21) ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.AspNetRequestsAreCollectedSuccessfully(expectedUrl: "https://localhost:80/Home/Index.htm?q1=v1&q2=v2#Fr"···, url: "***localhost:80/Home/Index.htm?"···, routeType: 0, routeTemplate: null, setStatusToErrorInEnrich: False, filter: null, recordException: False) [3 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.AspNetRequestsAreCollectedSuccessfully(expectedUrl: "http://localhost:1880/api/weatherforecast", url: "http://localhost:1880/api/weatherforecast", routeType: 3, routeTemplate: "api/{controller}/{id}", setStatusToErrorInEnrich: False, filter: null, recordException: False) [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.AspNetRequestsAreCollectedSuccessfully(expectedUrl: "http://localhost:80/Index", url: "http://localhost:80/Index", routeType: 1, routeTemplate: "{controller}/{action}/{id}", setStatusToErrorInEnrich: False, filter: null, recordException: False) [6 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.AspNetRequestsAreCollectedSuccessfully(expectedUrl: "https://localhost:80/", url: "https://localhost:80/", routeType: 0, routeTemplate: null, setStatusToErrorInEnrich: False, filter: null, recordException: False) [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.AspNetRequestsAreCollectedSuccessfully(expectedUrl: "https://localhost:80/Home/Index.htm?q1=v1&q2=v2#Fr"···, url: "https://localhost:80/Home/Index.htm?q1=v1&q2=v2#Fr"···, routeType: 0, routeTemplate: null, setStatusToErrorInEnrich: False, filter: null, recordException: False) [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.ExtractContextIrrespectiveOfSamplingDecision(samplingDecision: Drop) [84 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.ExtractContextIrrespectiveOfSamplingDecision(samplingDecision: RecordAndSample) [2 ms]
[xUnit.net 00:00:02.69]   Finished:    OpenTelemetry.Instrumentation.AspNet.Tests
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.ExtractContextIrrespectiveOfSamplingDecision(samplingDecision: RecordOnly) [1 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.HttpInListenerTests.ExtractContextIrrespectiveOfTheFilterApplied [5 ms]
  Passed OpenTelemetry.Instrumentation.AspNet.Tests.BasicTests.AddAspNetInstrumentation_BadArgs [2 ms]

Test Run Successful.
Total tests: [22](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/actions/runs/6478157578/job/17589520561?pr=1390#step:6:23)
     Passed: 22
 Total time: 6.67[60](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/actions/runs/6478157578/job/17589520561?pr=1390#step:6:61) Seconds

@CodeBlanch CodeBlanch merged commit 66c74ac into open-telemetry:main Oct 11, 2023
42 of 43 checks passed
@CodeBlanch CodeBlanch deleted the ci-test-targets branch October 11, 2023 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra Infra work - CI/CD, code coverage, linters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants