[rb] [test] Log level trace in test environment#17401
[rb] [test] Log level trace in test environment#17401nvborisenko wants to merge 1 commit intoSeleniumHQ:trunkfrom
Conversation
Review Summary by QodoUpdate Firefox WebDriver debug logging flag to -vv
WalkthroughsDescription• Update Firefox WebDriver debug logging flag from --log trace to -vv • Improves compatibility with geckodriver's verbose output flag • Maintains consistent debug logging behavior across test environment File Changes1. rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb
|
Code Review by Qodo
1. SE_DEBUG adds extra -vv
|
There was a problem hiding this comment.
Pull request overview
This PR adjusts Firefox/geckodriver debug logging configuration in the Ruby integration test environment by changing the argument used to enable verbose output.
Changes:
- Update
firefox_driverservice arguments to use-vvwhen debug logging is enabled (replacing--log trace).
| def firefox_driver(service: nil, **) | ||
| service ||= WebDriver::Service.firefox | ||
| service.args.push('--log', 'trace') if WebDriver.logger.debug? | ||
| service.args << '-vv' if WebDriver.logger.debug? |
There was a problem hiding this comment.
WebDriver.logger.debug? becomes true when SE_DEBUG is set (rb/lib/selenium/webdriver.rb:98). In that case this line adds -vv, but Firefox::Service also appends -v under SE_DEBUG (rb/lib/selenium/webdriver/firefox/service.rb:36-39) and only strips --log... args. Result: with SE_DEBUG you now pass both -vv and -v (and you no longer trigger the intended “overriding user-specified driver logging settings” warning).
Consider keying this off ENV['DEBUG'] instead of WebDriver.logger.debug?, or skip adding -vv when ENV['SE_DEBUG'] is set / when a -v* arg is already present.
| service.args << '-vv' if WebDriver.logger.debug? | |
| verbose_arg_present = service.args.any? { |arg| arg.match?(/\A-v+\z/) } | |
| service.args << '-vv' if WebDriver.logger.debug? && !ENV['SE_DEBUG'] && !verbose_arg_present |
Try to "fix" CI.
💥 What does this PR do?
This pull request makes a small adjustment to the Firefox WebDriver setup for debugging. The change updates the argument passed to the Firefox driver when debug logging is enabled, switching from the
--log traceflag to the-vvflag.test_environment.rb: Updated the debug logging argument for the Firefox WebDriver from--log traceto-vvfor improved compatibility or verbosity.🔧 Implementation Notes
🤖 AI assistance
🔄 Types of changes