[dotnet] [bidi] Testing infra for custom module#17306
[dotnet] [bidi] Testing infra for custom module#17306nvborisenko merged 2 commits intoSeleniumHQ:trunkfrom
Conversation
Review Summary by QodoExpose logging and BiDi APIs for custom module extensibility
WalkthroughsDescription• Expose logging APIs and BiDi command classes to public API • Remove internal visibility restrictions from test assembly • Add tests for custom module extensibility pattern • Demonstrate custom module implementation with sample code File Changes1. dotnet/src/webdriver/BiDi/Command.cs
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewⓘ The new review experience is currently in Beta. Learn more |
There was a problem hiding this comment.
Pull request overview
This PR expands the .NET WebDriver/BiDi public API surface to support extensibility (custom BiDi modules) and adapts the test suite accordingly after removing internal test access.
Changes:
- Exposes previously-internal logging APIs (
ILogger,ILogContextmembers, andLogaccessors) aspublic. - Makes core BiDi command primitives (
Command<TParameters, TResult>,Parameters) public to enable external/custom module implementations. - Removes
InternalsVisibleToand adds BiDi tests demonstrating custom module caching and command execution.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/test/webdriver/Internal/Logging/LogTests.cs | Adjusts logging tests after visibility changes; updates test handler initialization. |
| dotnet/test/webdriver/BiDi/Session/SessionTests.cs | Adds tests and sample types to validate custom module extensibility. |
| dotnet/src/webdriver/Selenium.WebDriver.csproj | Removes InternalsVisibleTo to stop exposing internals to the test assembly. |
| dotnet/src/webdriver/Internal/Logging/Log.cs | Makes CurrentContext and GetLogger APIs public. |
| dotnet/src/webdriver/Internal/Logging/ILogger.cs | Makes ILogger public. |
| dotnet/src/webdriver/Internal/Logging/ILogContext.cs | Makes logger retrieval methods publicly accessible on ILogContext. |
| dotnet/src/webdriver/BUILD.bazel | Removes Bazel internals_visible_to configuration for tests. |
| dotnet/src/webdriver/BiDi/Command.cs | Makes BiDi command base types public for external extension. |
Ability to declare custom bidi modules. Negotiated how to test internal logging via making some functionality publicly available. It is OK if we consider to expose it as separate package.
💥 What does this PR do?
This pull request makes several significant changes to the WebDriver .NET codebase, primarily focused on increasing the visibility of key APIs and types, removing internal access restrictions, and adding new tests for module extensibility. These updates improve the public API surface, facilitate external usage and testing, and introduce a pattern for custom modules.
Public API and Visibility Changes:
internaltopublic, includingILogger,ILogContext, and logging methods inLog, making them accessible outside the assembly. (dotnet/src/webdriver/Internal/Logging/ILogger.cs,dotnet/src/webdriver/Internal/Logging/ILogContext.cs,dotnet/src/webdriver/Internal/Logging/Log.cs) [1] [2] [3] [4] [5]Command<TParameters, TResult>and related classes in the BiDi namespace frominternaltopublicto allow external extension and usage. (dotnet/src/webdriver/BiDi/Command.cs)Removal of Internal Access Restrictions:
InternalsVisibleTosettings from bothBUILD.bazeland.csprojfiles, meaning internal types are no longer exposed to the test assembly and tests must now use only public APIs. (dotnet/src/webdriver/BUILD.bazel,dotnet/src/webdriver/Selenium.WebDriver.csproj) [1] [2] [3] [4]Testing and Extensibility Improvements:
CustomModule, command, and result types, demonstrating that modules can be extended and commands executed using the new public API. (dotnet/test/webdriver/BiDi/Session/SessionTests.cs) [1] [2]Minor Test Code Updates:
dotnet/test/webdriver/Internal/Logging/LogTests.cs) [1] [2]🔄 Types of changes