-
Notifications
You must be signed in to change notification settings - Fork 332
[WCF] Skip ServiceHost tests if non-elevated #2824
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
base: main
Are you sure you want to change the base?
[WCF] Skip ServiceHost tests if non-elevated #2824
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #2824 +/- ##
==========================================
+ Coverage 73.91% 78.75% +4.83%
==========================================
Files 267 29 -238
Lines 9615 706 -8909
==========================================
- Hits 7107 556 -6551
+ Misses 2508 150 -2358
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the WCF instrumentation tests to skip TelemetryContextPropagatesTest
when running without admin rights and defers ServiceHost initialization until after the skip check by extracting it into a per-test context.
- Introduces
RunAsAdminTheoryAttribute
to conditionally skip tests based on admin privileges. - Removes inline ServiceHost setup in the test class and adds a new
ServiceHostContext
helper. - Updates
TelemetryPropagationTests
to useServiceHostContext
for URIs.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
test/OpenTelemetry.Instrumentation.Wcf.Tests/TelemetryPropagationTests.netfx.cs | Replaced [Theory] with [RunAsAdminTheory] , removed constructor/dispose host setup, added ServiceHostContext . |
test/OpenTelemetry.Instrumentation.Wcf.Tests/RunAsAdminTheoryAttribute.cs | Added a new theory attribute to skip tests when not running as an administrator. |
Comments suppressed due to low confidence (2)
test/OpenTelemetry.Instrumentation.Wcf.Tests/RunAsAdminTheoryAttribute.cs:10
- [nitpick] The summary refers to this as a “fact” but it inherits from
TheoryAttribute
. Update the XML comment to mention it’s a theory-based test attribute for clarity.
/// Attribute that is applied to a method to indicate that it is a fact that should be run by the test runner
test/OpenTelemetry.Instrumentation.Wcf.Tests/TelemetryPropagationTests.netfx.cs:154
- [nitpick] The
ServiceHost
property onServiceHostContext
isn’t used by the tests—consider removing it to reduce the public API surface.
public ServiceHost ServiceHost => this.serviceHost;
test/OpenTelemetry.Instrumentation.Wcf.Tests/RunAsAdminTheoryAttribute.cs
Show resolved
Hide resolved
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
71da70c
to
8c38d56
Compare
- Skip `TelemetryContextPropagatesTest` if the tests are run as a non-elevated user. - Move ServiceHost setup to its own class and use per-test so that the operation is deferred until after the skip check has determined that the test should run.
8c38d56
to
85b44e8
Compare
Changes
TelemetryContextPropagatesTest
if the tests are run as a non-elevated user.ServiceHost
setup to its own class and use per-test so that the operation is deferred until after the skip check has determined that the test should run.Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes