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

whoami has 0 coverage on Windows #4614

Open
sylvestre opened this issue Mar 24, 2023 · 2 comments
Open

whoami has 0 coverage on Windows #4614

sylvestre opened this issue Mar 24, 2023 · 2 comments
Labels

Comments

@sylvestre
Copy link
Contributor

sylvestre commented Mar 24, 2023

Maybe the test isn't executed on Windows?

https://app.codecov.io/gh/uutils/coreutils/blob/main/src/uu/whoami/src/platform/windows.rs

@garydev10
Copy link
Contributor

It seems that CI bypasses the only common test covered in Windows.

#[test]
fn test_normal_compare_env() {
let whoami = whoami();
if whoami == "nobody" {
println!("test skipped:");
} else if !is_ci() {
new_ucmd!().succeeds().stdout_is(format!("{whoami}\n"));
} else {
println!("test skipped:");
}
}

Can I fix it by adding a dummy command test in Windows?

#[test]
#[cfg(windows)]
fn test_normal_windows() {
    new_ucmd!().succeeds().no_stderr();
}

@sylvestre
Copy link
Contributor Author

yeah, let's try that :)

garydev10 added a commit to garydev10/coreutils that referenced this issue May 26, 2023
garydev10 added a commit to garydev10/coreutils that referenced this issue May 26, 2023
cakebaker pushed a commit that referenced this issue May 29, 2023
* tests/whoami: add windows test for issue #4614

* tests/whoami issue #4614: add all platform test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants