Skip to content

[rust] Replace WMIC commands (deprecated) by PowerShell in Windows #15363

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

Open
wants to merge 9 commits into
base: trunk
Choose a base branch
from

Conversation

bonigarcia
Copy link
Member

@bonigarcia bonigarcia commented Mar 3, 2025

User description

Motivation and Context

Selenium Manager executes different commands in the shell to discover the browser version. For instance, for Chrome in Linux:

/usr/bin/google-chrome --version

This kind of command is unavailable in Windows; therefore, Selenium Manager uses WMIC  (Windows Management Instrumentation Command-line) to discover browser versions in Windows (wmic datafile where name=...). For instance:

> selenium-manager.exe --browser chrome --debug
[2025-03-03T14:03:19.673Z DEBUG] chromedriver not found in PATH
[2025-03-03T14:03:19.675Z DEBUG] chrome detected at C:\Program Files\Google\Chrome\Application\chrome.exe
[2025-03-03T14:03:19.676Z DEBUG] Running command: wmic datafile where name='C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe' get Version /value
[2025-03-03T14:03:19.807Z DEBUG] Output: "\r\r\n\r\r\nVersion=133.0.6943.142\r\r\n\r\r\n\r\r\n\r"
[2025-03-03T14:03:19.813Z DEBUG] Detected browser: chrome 133.0.6943.142
[2025-03-03T14:03:19.822Z DEBUG] Discovering versions from https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json
[2025-03-03T14:03:20.181Z DEBUG] Required driver: chromedriver 133.0.6943.141
[2025-03-03T14:03:20.184Z DEBUG] chromedriver 133.0.6943.141 already in the cache
[2025-03-03T14:03:20.185Z INFO ] Driver path: C:\Users\boni\.cache\selenium\chromedriver\win64\133.0.6943.141\chromedriver.exe
[2025-03-03T14:03:20.185Z INFO ] Browser path: C:\Program Files\Google\Chrome\Application\chrome.exe

WMIC has been deprecated as of Windows 10, version 21H1, and Windows Server 2022 (see info). Microsoft has announced that it will be removed in a future version of Windows, though no specific timeline has been provided for its complete removal. Microsoft recommends transitioning to alternative tools and methods, such as PowerShell, which offers more robust and modern management capabilities.

WMIC continues working in Windows 11 currently. However, we need to stop using it in Selenium Manager. This PR implements this change, as follows:

> selenium-manager.exe --browser chrome --debug
[2025-03-03T14:13:27.749Z DEBUG] chromedriver not found in PATH
[2025-03-03T14:13:27.750Z DEBUG] chrome detected at C:\Program Files\Google\Chrome\Application\chrome.exe
[2025-03-03T14:13:27.751Z DEBUG] Running command: (Get-Item "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe").VersionInfo.ProductVersion
[2025-03-03T14:13:28.434Z DEBUG] Output: "133.0.6943.142"
[2025-03-03T14:13:28.441Z DEBUG] Detected browser: chrome 133.0.6943.142
[2025-03-03T14:13:28.443Z DEBUG] Required driver: chromedriver 133.0.6943.141
[2025-03-03T14:13:28.444Z DEBUG] chromedriver 133.0.6943.141 already in the cache
[2025-03-03T14:13:28.444Z INFO ] Driver path: C:\Users\boni\.cache\selenium\chromedriver\win64\133.0.6943.141\chromedriver.exe
[2025-03-03T14:13:28.444Z INFO ] Browser path: C:\Program Files\Google\Chrome\Application\chrome.exe

I believe using PowerShell in Windows (instead of the regular cmd.exe) is pretty safe since PowerShell is pre-installed starting with Windows 7. However, I detected a problem with this approach: performance. Running PowerShell commands through Selenium Manager is slower than WMIC commands. For example, in the first snippet of this PR, Selenium Manager used 131ms to run the WMIC command (19.807-19.676=0.131s). For PowerShell, the command took 683ms (28.434-27.751=0.683s). I repeated this, and indeed, it seems that a PowerShell command took around ~700ms, while WMIC required ~100ms:

PowerShell:
28.434-27.751=0.683
15.239-14.563=0.676
38.777-38.106=0.671
13.743-13.064=0.679
11.833-11.080=0.753
20.733-20.051=0.682
53.445-52.742=0.703

WMIC:
19.807-19.676=0.131
53.781-53.652=0.129
25.457-25.345=0.112
28.647-28.536=0.111

This means that for any new Selenium session, SM would have an overhead of around 700ms. I suppose this figure can be superior in other Windows systems. In my opinion, this time is quite relevant, and we would need to improve it.

Luckily, I implemented a mechanism to cache the resolution (i.e., the discovered browser version using shell commands) using the old TTL for browsers. After discussing it, we decided to remove that feature, and since then, commands are always executed to discover browser versions. But with this new scenario (we need to move to PowerShell in Windows at some point), I propose to recover that feature and use TTL for commands. The value we used for this value was 3600s.

@diemol @titusfortner What do you think?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

Enhancement


Description

  • Replaced deprecated WMIC commands with PowerShell commands in Windows.

  • Updated command definitions for OS architecture and MSI installation.

  • Modified shell execution to use PowerShell for Windows.

  • Adjusted related logic and constants to align with PowerShell usage.


Changes walkthrough 📝

Relevant files
Enhancement
config.rs
Switch OS architecture detection to PowerShell                     

rust/src/config.rs

  • Replaced WMIC commands with PowerShell commands for OS architecture
    detection.
  • Updated variable names and logic to reflect PowerShell usage.
  • +5/-5     
    files.rs
    Use PowerShell for MSI installation commands                         

    rust/src/files.rs

  • Replaced MSI installation command with PowerShell equivalent.
  • Updated logging and command execution logic for MSI installation.
  • +2/-2     
    lib.rs
    Replace WMIC commands with PowerShell in constants and logic

    rust/src/lib.rs

  • Replaced WMIC commands with PowerShell equivalents for version
    detection.
  • Added new constants for PowerShell commands.
  • Removed deprecated WMIC command constants.
  • +6/-6     
    shell.rs
    Use PowerShell as default shell for Windows                           

    rust/src/shell.rs

  • Updated shell execution logic to use PowerShell for Windows.
  • Adjusted shell and flag parameters for Windows compatibility.
  • +1/-1     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @bonigarcia bonigarcia added the C-rust Rust code is mostly Selenium Manager label Mar 3, 2025
    @bonigarcia bonigarcia moved this to In Progress in Selenium Manager Mar 3, 2025
    Copy link
    Contributor

    qodo-merge-pro bot commented Mar 3, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🧪 No relevant tests
    🔒 Security concerns

    Command Injection:
    The PowerShell commands in PS_GET_VERSION_COMMAND and PS_MSIEXEC_INSTALL_COMMAND use string formatting with user-provided paths. While the paths are escaped, additional validation and sanitization should be considered to prevent potential command injection attacks.

    ⚡ Recommended focus areas for review

    Error Handling

    The PowerShell MSI installation command uses Start-Process but doesn't check for installation errors or validate the exit code. Failed installations may go undetected.

    let command = Command::new_single(format_one_arg(PS_MSIEXEC_INSTALL_COMMAND, msi_file));
    log.trace(format!("Running command: {}", command.display()));
    run_shell_command_by_os(os, command)?;
    Parsing Issue

    The PowerShell OS architecture detection relies on string contains checks which may be fragile. Consider using more robust parsing of the OSArchitecture property.

    if ps_output.contains("32") {
        ARCH_X86.to_string()
    } else if ps_output.contains("ARM") {
        ARCH_ARM64.to_string()
    } else {
        ARCH_AMD64.to_string()

    Copy link
    Contributor

    qodo-merge-pro bot commented Mar 3, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Add robust error handling
    Suggestion Impact:The commit addresses error handling by using env var first and falling back to PowerShell command, though implemented differently than suggested

    code diff:

    +            let mut cpu_arch = env::var(ENV_CPU_ARCHITECTURE).unwrap_or_default();
    +            if cpu_arch.is_empty() {
    +                let get_os_command = Command::new_single(PS_GET_OS_COMMAND.to_string());
    +                cpu_arch = run_powershell_command(get_os_command).unwrap_or_default();
    +            }

    Add error handling for the PowerShell command execution to handle cases where
    the command fails or returns unexpected output format.

    rust/src/config.rs [72-80]

     let get_os_command = Command::new_single(PS_GET_OS_COMMAND.to_string());
    -let ps_output = run_shell_command_by_os(self_os, get_os_command).unwrap_or_default();
    +let ps_output = run_shell_command_by_os(self_os, get_os_command)
    +    .map_err(|e| anyhow!("Failed to detect OS architecture: {}", e))?;
    +if ps_output.trim().is_empty() {
    +    return Err(anyhow!("Empty response from OS architecture detection"));
    +}
     if ps_output.contains("32") {
         ARCH_X86.to_string()
     } else if ps_output.contains("ARM") {
         ARCH_ARM64.to_string()
     } else {
         ARCH_AMD64.to_string()
     }

    [Suggestion has been applied]

    Suggestion importance[1-10]: 8

    __

    Why: The suggestion adds critical error handling for OS architecture detection, replacing unwrap_or_default() with proper error propagation and empty output validation, which could prevent silent failures and improve system reliability.

    Medium
    Validate MSI installation result

    Add error checking for the MSI installation process by validating the exit code
    from Start-Process

    rust/src/files.rs [312-314]

     let command = Command::new_single(format_one_arg(PS_MSIEXEC_INSTALL_COMMAND, msi_file));
     log.trace(format!("Running command: {}", command.display()));
    -run_shell_command_by_os(os, command)?;
    +let output = run_shell_command_by_os(os, command)?;
    +if output.contains("error") || output.contains("failed") {
    +    return Err(anyhow!("MSI installation failed: {}", output));
    +}
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    __

    Why: The suggestion adds important error validation for MSI installation by checking the command output for error indicators, which helps prevent silent failures in the installation process.

    Medium
    • Update

    Copy link
    Contributor

    qodo-merge-pro bot commented Mar 3, 2025

    CI Feedback 🧐

    (Feedback updated until commit 802da7a)

    A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

    Action: Rust / Tests (windows) / Tests (windows)

    Failed stage: Run Bazel [❌]

    Failed test name: exec_driver_test::case_4

    Failure summary:

    The action failed because the integration test exec_driver_test::case_4 failed consistently across 3
    attempts. The test failed with an assertion error at line 43 in rust/tests/exec_driver_tests.rs,
    specifically:

  • The assertion output.contains(&driver_name) failed, indicating that the expected driver name was not
    found in the output
  • The test was running with Internet Explorer driver (IEDriverServer.exe) on Windows Server 2022
  • Out of 4 test cases in this suite, 3 passed but this one case consistently failed

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Microsoft Windows Server 2022
    ...
    
    626:  �[31m�[1mFAIL: �[0m//rust/tests:integration_exec_driver_tests (see D:/_bazel/execroot/_main/bazel-out/x64_windows-fastbuild/testlogs/rust/tests/integration_exec_driver_tests/test_attempts/attempt_1.log)
    627:  �[32m[650 / 652]�[0m 32 / 34 tests;�[0m Testing //rust/tests:integration_browser_download_tests; 287s local, disk-cache ... (2 actions running)
    628:  �[32m[650 / 652]�[0m 32 / 34 tests;�[0m Testing //rust/tests:integration_browser_download_tests; 296s local, disk-cache ... (2 actions running)
    629:  �[32m[650 / 652]�[0m 32 / 34 tests;�[0m Testing //rust/tests:integration_browser_download_tests; 298s local, disk-cache ... (2 actions running)
    630:  �[31m�[1mFAIL: �[0m//rust/tests:integration_exec_driver_tests (see D:/_bazel/execroot/_main/bazel-out/x64_windows-fastbuild/testlogs/rust/tests/integration_exec_driver_tests/test_attempts/attempt_2.log)
    631:  �[32m[651 / 652]�[0m 33 / 34 tests;�[0m Testing //rust/tests:integration_exec_driver_tests; 41s local, disk-cache
    632:  �[32m[651 / 652]�[0m 33 / 34 tests;�[0m Testing //rust/tests:integration_exec_driver_tests; 50s local, disk-cache
    633:  �[31m�[1mFAIL: �[0m//rust/tests:integration_exec_driver_tests (see D:/_bazel/execroot/_main/bazel-out/x64_windows-fastbuild/testlogs/rust/tests/integration_exec_driver_tests/test.log)
    634:  �[31m�[1mFAILED: �[0m//rust/tests:integration_exec_driver_tests (Summary)
    ...
    
    657:  "code": 0,
    658:  "message": "",
    659:  "driver_path": "C:\\Users\\runneradmin\\.cache\\selenium\\IEDriverServer\\win32\\4.14.0\\IEDriverServer.exe",
    660:  "browser_path": "C:\\Program Files\\Internet Explorer\\iexplore.exe"
    661:  }
    662:  }
    663:  **** EXEC DRIVER: 
    664:  thread 'exec_driver_test::case_4' panicked at rust/tests/exec_driver_tests.rs:43:9:
    665:  assertion failed: output.contains(&driver_name)
    ...
    
    683:  15:     0x7ff6b7ab57c2 - <unknown>
    684:  16:     0x7ff6b7b02ce0 - <unknown>
    685:  17:     0x7ff6b7b02074 - <unknown>
    686:  18:     0x7ff6b7abd77b - <unknown>
    687:  19:     0x7ff6b7ac1bc5 - <unknown>
    688:  20:     0x7ff6b7bb474d - <unknown>
    689:  21:     0x7ff9e20b4cb0 - BaseThreadInitThunk
    690:  22:     0x7ff9e2ededcb - RtlUserThreadStart
    691:  test exec_driver_test::case_4 ... FAILED
    692:  failures:
    693:  failures:
    694:  exec_driver_test::case_4
    695:  test result: FAILED. 3 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 27.49s
    ...
    
    716:  "code": 0,
    717:  "message": "",
    718:  "driver_path": "C:\\Users\\runneradmin\\.cache\\selenium\\IEDriverServer\\win32\\4.14.0\\IEDriverServer.exe",
    719:  "browser_path": "C:\\Program Files\\Internet Explorer\\iexplore.exe"
    720:  }
    721:  }
    722:  **** EXEC DRIVER: 
    723:  thread 'exec_driver_test::case_4' panicked at rust/tests/exec_driver_tests.rs:43:9:
    724:  assertion failed: output.contains(&driver_name)
    ...
    
    741:  15:     0x7ff6b7ab57c2 - <unknown>
    742:  16:     0x7ff6b7b02ce0 - <unknown>
    743:  17:     0x7ff6b7b02074 - <unknown>
    744:  18:     0x7ff6b7abd77b - <unknown>
    745:  19:     0x7ff6b7ac1bc5 - <unknown>
    746:  20:     0x7ff6b7bb474d - <unknown>
    747:  21:     0x7ff9e20b4cb0 - BaseThreadInitThunk
    748:  22:     0x7ff9e2ededcb - RtlUserThreadStart
    749:  test exec_driver_test::case_4 ... FAILED
    750:  failures:
    751:  failures:
    752:  exec_driver_test::case_4
    753:  test result: FAILED. 3 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 12.47s
    ...
    
    774:  "code": 0,
    775:  "message": "",
    776:  "driver_path": "C:\\Users\\runneradmin\\.cache\\selenium\\IEDriverServer\\win32\\4.14.0\\IEDriverServer.exe",
    777:  "browser_path": "C:\\Program Files\\Internet Explorer\\iexplore.exe"
    778:  }
    779:  }
    780:  **** EXEC DRIVER: 
    781:  thread 'exec_driver_test::case_4' panicked at rust/tests/exec_driver_tests.rs:43:9:
    782:  assertion failed: output.contains(&driver_name)
    ...
    
    799:  15:     0x7ff6b7ab57c2 - <unknown>
    800:  16:     0x7ff6b7b02ce0 - <unknown>
    801:  17:     0x7ff6b7b02074 - <unknown>
    802:  18:     0x7ff6b7abd77b - <unknown>
    803:  19:     0x7ff6b7ac1bc5 - <unknown>
    804:  20:     0x7ff6b7bb474d - <unknown>
    805:  21:     0x7ff9e20b4cb0 - BaseThreadInitThunk
    806:  22:     0x7ff9e2ededcb - RtlUserThreadStart
    807:  test exec_driver_test::case_4 ... FAILED
    808:  failures:
    809:  failures:
    810:  exec_driver_test::case_4
    811:  test result: FAILED. 3 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 9.75s
    812:  ================================================================================
    813:  �[32mINFO: �[0mFound 6 targets and 34 test targets...
    814:  �[32mINFO: �[0mElapsed time: 465.141s, Critical Path: 337.40s
    815:  �[32mINFO: �[0m652 processes: 310 disk cache hit, 204 internal, 138 local.
    816:  �[32mINFO: �[0mBuild completed, 1 test FAILED, 652 total actions
    ...
    
    842:  //rust/tests:integration_safari_tests                                    �[0m�[32mPASSED�[0m in 2.5s
    843:  //rust/tests:integration_safari_tests-fmt                                �[0m�[32mPASSED�[0m in 0.1s
    844:  //rust/tests:integration_stable_browser_tests                            �[0m�[32mPASSED�[0m in 50.8s
    845:  //rust/tests:integration_stable_browser_tests-fmt                        �[0m�[32mPASSED�[0m in 0.2s
    846:  //rust/tests:integration_timeout_tests                                   �[0m�[32mPASSED�[0m in 0.5s
    847:  //rust/tests:integration_timeout_tests-fmt                               �[0m�[32mPASSED�[0m in 0.2s
    848:  //rust/tests:integration_webview_tests                                   �[0m�[32mPASSED�[0m in 163.2s
    849:  //rust/tests:integration_webview_tests-fmt                               �[0m�[32mPASSED�[0m in 0.1s
    850:  //rust/tests:integration_exec_driver_tests                               �[0m�[31m�[1mFAILED�[0m in 3 out of 3 in 27.9s
    851:  Stats over 3 runs: max = 27.9s, min = 9.8s, avg = 16.8s, dev = 8.0s
    852:  D:/_bazel/execroot/_main/bazel-out/x64_windows-fastbuild/testlogs/rust/tests/integration_exec_driver_tests/test.log
    853:  D:/_bazel/execroot/_main/bazel-out/x64_windows-fastbuild/testlogs/rust/tests/integration_exec_driver_tests/test_attempts/attempt_1.log
    854:  D:/_bazel/execroot/_main/bazel-out/x64_windows-fastbuild/testlogs/rust/tests/integration_exec_driver_tests/test_attempts/attempt_2.log
    855:  Executed 34 out of 34 tests: 33 tests pass and �[0m�[31m�[1m1 fails locally�[0m.
    856:  There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.
    857:  �[0m
    858:  ##[error]Process completed with exit code 1.
    

    @bonigarcia bonigarcia force-pushed the sm_powershell branch 5 times, most recently from 72b34a5 to dba3035 Compare March 3, 2025 23:42
    @bonigarcia
    Copy link
    Member Author

    It seems that the performance decline with this PR is real in Windows. In the following workflow, we can see the times that tests last in Windows:

    //rust:selenium-manager-fmt                                              PASSED in 0.1s
    //rust:selenium_manager-fmt                                              PASSED in 0.3s
    //rust:unit                                                              PASSED in 0.1s
    //rust:unit-fmt                                                          PASSED in 0.4s
    //rust/tests:integration_browser_download_tests                          PASSED in 84.0s
    //rust/tests:integration_browser_download_tests-fmt                      PASSED in 0.1s
    //rust/tests:integration_browser_tests                                   PASSED in 410.4s
    //rust/tests:integration_browser_tests-fmt                               PASSED in 0.1s
    //rust/tests:integration_cache_tests                                     PASSED in 9.2s
    //rust/tests:integration_cache_tests-fmt                                 PASSED in 0.1s
    //rust/tests:integration_config_tests                                    PASSED in 395.3s
    //rust/tests:integration_config_tests-fmt                                PASSED in 0.1s
    //rust/tests:integration_exec_driver_tests                               PASSED in 104.2s
    //rust/tests:integration_exec_driver_tests-fmt                           PASSED in 0.1s
    //rust/tests:integration_grid_tests                                      PASSED in 1.9s
    //rust/tests:integration_grid_tests-fmt                                  PASSED in 0.1s
    //rust/tests:integration_iexplorer_tests                                 PASSED in 230
    //rust/tests:integration_iexplorer_tests-fmt                             PASSED in 0.1s
    //rust/tests:integration_mirror_tests                                    PASSED in 156.4s
    //rust/tests:integration_mirror_tests-fmt                                PASSED in 0.1s
    //rust/tests:integration_offline_tests                                   PASSED in 2.8s
    //rust/tests:integration_offline_tests-fmt                               PASSED in 0.2s
    //rust/tests:integration_output_tests                                    PASSED in 10.5s
    //rust/tests:integration_output_tests-fmt                                PASSED in 0.1s
    //rust/tests:integration_proxy_tests                                     PASSED in 2.9s
    //rust/tests:integration_proxy_tests-fmt                                 PASSED in 0.2s
    //rust/tests:integration_safari_tests                                    PASSED in 1.1s
    //rust/tests:integration_safari_tests-fmt                                PASSED in 0.1s
    //rust/tests:integration_stable_browser_tests                            PASSED in 3.7s
    //rust/tests:integration_stable_browser_tests-fmt                        PASSED in 0.1s
    //rust/tests:integration_timeout_tests                                   PASSED in 0.5s
    //rust/tests:integration_timeout_tests-fmt                               PASSED in 0.1s
    //rust/tests:integration_webview_tests                                   PASSED in 286.9s
    //rust/tests:integration_webview_tests-fmt                               PASSED in 0.3s
    

    The same tests in Linux:

    //rust:selenium-manager-fmt                                              PASSED in 0.0s
    //rust:selenium_manager-fmt                                              PASSED in 0.3s
    //rust:unit                                                              PASSED in 0.0s
    //rust:unit-fmt                                                          PASSED in 0.3s
    //rust/tests:integration_browser_download_tests                          PASSED in 64.5s
    //rust/tests:integration_browser_download_tests-fmt                      PASSED in 0.1s
    //rust/tests:integration_browser_tests                                   PASSED in 4.5s
    //rust/tests:integration_browser_tests-fmt                               PASSED in 0.0s
    //rust/tests:integration_cache_tests                                     PASSED in 2.2s
    //rust/tests:integration_cache_tests-fmt                                 PASSED in 0.2s
    //rust/tests:integration_config_tests                                    PASSED in 2.1s
    //rust/tests:integration_config_tests-fmt                                PASSED in 0.1s
    //rust/tests:integration_exec_driver_tests                               PASSED in 1.3s
    //rust/tests:integration_exec_driver_tests-fmt                           PASSED in 0.1s
    //rust/tests:integration_grid_tests                                      PASSED in 2.2s
    //rust/tests:integration_grid_tests-fmt                                  PASSED in 0.1s
    //rust/tests:integration_iexplorer_tests                                 PASSED in 1.6s
    //rust/tests:integration_iexplorer_tests-fmt                             PASSED in 0.1s
    //rust/tests:integration_mirror_tests                                    PASSED in 5.4s
    //rust/tests:integration_mirror_tests-fmt                                PASSED in 0.1s
    //rust/tests:integration_offline_tests                                   PASSED in 0.8s
    //rust/tests:integration_offline_tests-fmt                               PASSED in 0.1s
    //rust/tests:integration_output_tests                                    PASSED in 0.8s
    //rust/tests:integration_output_tests-fmt                                PASSED in 0.2s
    //rust/tests:integration_proxy_tests                                     PASSED in 0.5s
    //rust/tests:integration_proxy_tests-fmt                                 PASSED in 0.1s
    //rust/tests:integration_safari_tests                                    PASSED in 0.1s
    //rust/tests:integration_safari_tests-fmt                                PASSED in 0.0s
    //rust/tests:integration_stable_browser_tests                            PASSED in 2.1s
    //rust/tests:integration_stable_browser_tests-fmt                        PASSED in 0.0s
    //rust/tests:integration_timeout_tests                                   PASSED in 0.1s
    //rust/tests:integration_timeout_tests-fmt                               PASSED in 0.1s
    //rust/tests:integration_webview_tests                                   PASSED in 0.4s
    //rust/tests:integration_webview_tests-fmt                               PASSED in 0.1s
    

    And in macOS:

    //rust:selenium-manager-fmt                                              PASSED in 0.1s
    //rust:selenium_manager-fmt                                              PASSED in 0.2s
    //rust:unit                                                              PASSED in 0.1s
    //rust:unit-fmt                                                          PASSED in 0.2s
    //rust/tests:integration_browser_download_tests                          PASSED in 51.0s
    //rust/tests:integration_browser_download_tests-fmt                      PASSED in 0.1s
    //rust/tests:integration_browser_tests                                   PASSED in 19.2s
    //rust/tests:integration_browser_tests-fmt                               PASSED in 0.1s
    //rust/tests:integration_cache_tests                                     PASSED in 1.7s
    //rust/tests:integration_cache_tests-fmt                                 PASSED in 0.1s
    //rust/tests:integration_config_tests                                    PASSED in 20.3s
    //rust/tests:integration_config_tests-fmt                                PASSED in 0.1s
    //rust/tests:integration_exec_driver_tests                               PASSED in 17.2s
    //rust/tests:integration_exec_driver_tests-fmt                           PASSED in 0.1s
    //rust/tests:integration_grid_tests                                      PASSED in 5.7s
    //rust/tests:integration_grid_tests-fmt                                  PASSED in 0.1s
    //rust/tests:integration_iexplorer_tests                                 PASSED in 1.6s
    //rust/tests:integration_iexplorer_tests-fmt                             PASSED in 0.1s
    //rust/tests:integration_mirror_tests                                    PASSED in 16.7s
    //rust/tests:integration_mirror_tests-fmt                                PASSED in 0.1s
    //rust/tests:integration_offline_tests                                   PASSED in 0.4s
    //rust/tests:integration_offline_tests-fmt                               PASSED in 0.1s
    //rust/tests:integration_output_tests                                    PASSED in 3.3s
    //rust/tests:integration_output_tests-fmt                                PASSED in 0.1s
    //rust/tests:integration_proxy_tests                                     PASSED in 1.0s
    //rust/tests:integration_proxy_tests-fmt                                 PASSED in 0.1s
    //rust/tests:integration_safari_tests                                    PASSED in 0.2s
    //rust/tests:integration_safari_tests-fmt                                PASSED in 0.1s
    //rust/tests:integration_stable_browser_tests                            PASSED in 1.5s
    //rust/tests:integration_stable_browser_tests-fmt                        PASSED in 0.1s
    //rust/tests:integration_timeout_tests                                   PASSED in 0.1s
    //rust/tests:integration_timeout_tests-fmt                               PASSED in 0.1s
    //rust/tests:integration_webview_tests                                   PASSED in 1.8s
    //rust/tests:integration_webview_tests-fmt                               PASSED in 0.1s
    

    And the same tests, in Windows, but just before the PR:

    //rust:selenium-manager-fmt                                              PASSED in 0.2s
    //rust:selenium_manager-fmt                                              PASSED in 0.2s
    //rust:unit                                                              PASSED in 0.2s
    //rust:unit-fmt                                                          PASSED in 0.3s
    //rust/tests:integration_browser_download_tests                          PASSED in 88.7s
    //rust/tests:integration_browser_download_tests-fmt                      PASSED in 0.1s
    //rust/tests:integration_browser_tests                                   PASSED in 15.5s
    //rust/tests:integration_browser_tests-fmt                               PASSED in 0.1s
    //rust/tests:integration_cache_tests                                     PASSED in 4.0s
    //rust/tests:integration_cache_tests-fmt                                 PASSED in 0.1s
    //rust/tests:integration_config_tests                                    PASSED in 10.6s
    //rust/tests:integration_config_tests-fmt                                PASSED in 0.1s
    //rust/tests:integration_exec_driver_tests                               PASSED in 7.0s
    //rust/tests:integration_exec_driver_tests-fmt                           PASSED in 0.1s
    //rust/tests:integration_grid_tests                                      PASSED in 3.3s
    //rust/tests:integration_grid_tests-fmt                                  PASSED in 0.1s
    //rust/tests:integration_iexplorer_tests                                 PASSED in 5.4s
    //rust/tests:integration_iexplorer_tests-fmt                             PASSED in 0.1s
    //rust/tests:integration_mirror_tests                                    PASSED in 8.2s
    //rust/tests:integration_mirror_tests-fmt                                PASSED in 0.1s
    //rust/tests:integration_offline_tests                                   PASSED in 4.9s
    //rust/tests:integration_offline_tests-fmt                               PASSED in 0.1s
    //rust/tests:integration_output_tests                                    PASSED in 2.8s
    //rust/tests:integration_output_tests-fmt                                PASSED in 0.1s
    //rust/tests:integration_proxy_tests                                     PASSED in 1.4s
    //rust/tests:integration_proxy_tests-fmt                                 PASSED in 0.1s
    //rust/tests:integration_safari_tests                                    PASSED in 1.5s
    //rust/tests:integration_safari_tests-fmt                                PASSED in 0.1s
    //rust/tests:integration_stable_browser_tests                            PASSED in 3.1s
    //rust/tests:integration_stable_browser_tests-fmt                        PASSED in 0.1s
    //rust/tests:integration_timeout_tests                                   PASSED in 0.5s
    //rust/tests:integration_timeout_tests-fmt                               PASSED in 0.1s
    //rust/tests:integration_webview_tests                                   PASSED in 3.9s
    //rust/tests:integration_webview_tests-fmt                               PASSED in 0.2s
    

    @nvborisenko
    Copy link
    Member

    WMIC is a wrapper, PowerShell is a wrapper. Why not to use WinAPI directly to get the version of file?

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    C-rust Rust code is mostly Selenium Manager Review effort 3/5
    Projects
    Status: In Progress
    Development

    Successfully merging this pull request may close these issues.

    2 participants