Skip to content
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

Unit test failed on Windows #2592

Open
vidhyasasi opened this issue Jun 6, 2023 · 1 comment
Open

Unit test failed on Windows #2592

vidhyasasi opened this issue Jun 6, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@vidhyasasi
Copy link

Cargo test failed on Windows machine
What steps will reproduce the bug?

cargo test

What happens?

test result: FAILED. 101 passed; 9 failed; 2 ignored; 0 measured; 0 filtered out; finished in 3.65s

How did you install bat?

Build from source

bat version and environment
bat 0.23.0 (876f5d4)

Windows version

10.0.20348 Build 20348

The failure message looks like:

failures:

---- alias_pager_disable_long_overrides_short stdout ----
thread 'alias_pager_disable_long_overrides_short' panicked at 'Unexpected stdout, failed var == "pager-output\n"
├── var: "hello world\n"
└── var as str: hello world

command="C:\\Users\\Administrator\\Documents\\rust_artefacts\\packages\\bat\\target\\debug\\bat.exe" "--no-config" "-P" "--paging=always" "test.txt"
code=0
stdout="hello world\n"
stderr=""
', /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\ops\function.rs:250:5
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

---- config_read_arguments_from_file stdout ----
thread 'config_read_arguments_from_file' panicked at 'Unexpected stdout, failed var == "dummy-pager-from-config\n"
├── var: "hello world\n"
└── var as str: hello world

command="C:\\Users\\Administrator\\Documents\\rust_artefacts\\packages\\bat\\target\\debug\\bat.exe" "test.txt"
code=0
stdout="hello world\n"
stderr=""
', /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\ops\function.rs:250:5

---- pager_arg_override_env_noconfig stdout ----
thread 'pager_arg_override_env_noconfig' panicked at 'Unexpected stdout, failed var == "pager-output\n"
├── var: "hello world\n"
└── var as str: hello world

command="C:\\Users\\Administrator\\Documents\\rust_artefacts\\packages\\bat\\target\\debug\\bat.exe" "--no-config" "--pager=echo pager-output" "--paging=always" "test.txt"
code=0
stdout="hello world\n"
stderr=""
', /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\ops\function.rs:250:5

---- pager_arg_override_env_withconfig stdout ----
thread 'pager_arg_override_env_withconfig' panicked at 'Unexpected stdout, failed var == "pager-output\n"
├── var: "hello world\n"
└── var as str: hello world

command="C:\\Users\\Administrator\\Documents\\rust_artefacts\\packages\\bat\\target\\debug\\bat.exe" "--pager=echo pager-output" "--paging=always" "test.txt"
code=0
stdout="hello world\n"
stderr=""
', /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\ops\function.rs:250:5

---- pager_basic stdout ----
thread 'pager_basic' panicked at 'Unexpected stdout, failed var == "pager-output\n"
├── var: "hello world\n"
└── var as str: hello world

command="C:\\Users\\Administrator\\Documents\\rust_artefacts\\packages\\bat\\target\\debug\\bat.exe" "--no-config" "--paging=always" "test.txt"
code=0
stdout="hello world\n"
stderr=""
', /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\ops\function.rs:250:5

---- pager_basic_arg stdout ----
thread 'pager_basic_arg' panicked at 'Unexpected stdout, failed var == "pager-output\n"
├── var: "hello world\n"
└── var as str: hello world

command="C:\\Users\\Administrator\\Documents\\rust_artefacts\\packages\\bat\\target\\debug\\bat.exe" "--no-config" "--pager=echo pager-output" "--paging=always" "test.txt"
code=0
stdout="hello world\n"
stderr=""
', /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\ops\function.rs:250:5

---- pager_env_bat_pager_override_config stdout ----
thread 'pager_env_bat_pager_override_config' panicked at 'Unexpected stdout, failed var == "pager-output\n"
├── var: "hello world\n"
└── var as str: hello world

command="C:\\Users\\Administrator\\Documents\\rust_artefacts\\packages\\bat\\target\\debug\\bat.exe" "--paging=always" "test.txt"
code=0
stdout="hello world\n"
stderr=""
', /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\ops\function.rs:250:5

---- pager_env_pager_nooverride_config stdout ----
thread 'pager_env_pager_nooverride_config' panicked at 'Unexpected stdout, failed var == "dummy-pager-from-config\n"
├── var: "hello world\n"
└── var as str: hello world

command="C:\\Users\\Administrator\\Documents\\rust_artefacts\\packages\\bat\\target\\debug\\bat.exe" "--paging=always" "test.txt"
code=0
stdout="hello world\n"
stderr=""
', /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\ops\function.rs:250:5

---- pager_overwrite stdout ----
thread 'pager_overwrite' panicked at 'Unexpected stdout, failed var == "pager-output\n"
├── var: "hello world\n"
└── var as str: hello world

command="C:\\Users\\Administrator\\Documents\\rust_artefacts\\packages\\bat\\target\\debug\\bat.exe" "--no-config" "--paging=always" "test.txt"
code=0
stdout="hello world\n"
stderr=""
', /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\ops\function.rs:250:5

failures:
alias_pager_disable_long_overrides_short
config_read_arguments_from_file
pager_arg_override_env_noconfig
pager_arg_override_env_withconfig
pager_basic
pager_basic_arg
pager_env_bat_pager_override_config
pager_env_pager_nooverride_config
pager_overwrite

test result: FAILED. 101 passed; 9 failed; 2 ignored; 0 measured; 0 filtered out; finished in 3.65s

error: test failed, to rerun pass --test integration_tests

@vidhyasasi vidhyasasi added the bug Something isn't working label Jun 6, 2023
@boyvanduuren
Copy link
Contributor

boyvanduuren commented Jun 22, 2023

This is because of

let resolved_path = match grep_cli::resolve_binary(&pager.bin) {
not resolving for echo in powershell, as it's an alias for Write-Output, which is a shell built-in.

Enselic pushed a commit that referenced this issue Sep 8, 2023
Co-authored-by: Boy van Duuren <boy.van.duuren@rabobank.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants