-
Notifications
You must be signed in to change notification settings - Fork 144
[AppInsights v3] Improve Test Coverage #1429
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
[AppInsights v3] Improve Test Coverage #1429
Conversation
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 improves overall test coverage for shim components, adds extensive file system helper tests, and corrects a typo in the ETW writer class name.
- Expanded
TelemetryClienttests to exercise unsupported methods and error logging - Added comprehensive tests for
CorrelationContextManagercontext scenarios andfileSystemHelperoperations - Renamed
EtwWrittertoEtwWriterand updated its usage in the diagnostic logger
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/unitTests/shim/telemetryClient.tests.ts | Added tests for unsupported/deprecated APIs and error handling in trackMetric |
| test/unitTests/shim/correlationContextManger.tests.ts | Expanded tests for context conversion, binding, and error handling in various manager methods |
| test/unitTests/shared/util.tests.ts | Introduced tests for fileSystemHelper covering directory/file ops and promisified fs methods |
| src/agent/diagnostics/writers/etwWriter.ts | Corrected class name from EtwWritter to EtwWriter |
| src/agent/diagnostics/etwDiagnosticLogger.ts | Updated import and instantiation to reference the renamed EtwWriter |
Comments suppressed due to low confidence (2)
test/unitTests/shim/telemetryClient.tests.ts:181
- Tests for
trackExceptionandtrackTracemethods are missing; add cases to cover these code paths and ensure full coverage of the manual track APIs.
describe("#manual track APIs", () => {
src/agent/diagnostics/writers/etwWriter.ts:9
- [nitpick] Consider adding unit tests for
EtwWriter(and its integration viaEtwDiagnosticLogger) to verify that logging methods invoke the underlying ETW module correctly and handle errors as expected.
export class EtwWriter implements IAgentLogger {
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Expanded test coverage for the AppInsights v3 library.