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

mv: Show 'skipped' when a file isn't overwriten #4905

Merged
merged 1 commit into from May 30, 2023

Conversation

sylvestre
Copy link
Sponsor Contributor

Should fix tests/mv/mv-n.sh

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/mv/mv-n is no longer failing!

@sylvestre
Copy link
Sponsor Contributor Author

@cakebaker @tertsdiepraam
Any idea what is going on?

--- TRY 3 STDERR:        coreutils::tests test_mv::test_mv_arg_interactive_skipped_vin ---
thread 'test_mv::test_mv_arg_interactive_skipped_vin' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "failed to write to stdin of child: Broken pipe (os error 32)" }', tests/common/util.rs:2004:18
stack backtrace:
   0: rust_begin_unwind
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5
   1: core::panicking::panic_fmt
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14
   2: core::result::unwrap_failed
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/result.rs:1750:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/result.rs:1090:23
   4: tests::common::util::UChild::wait_with_output
             at ./tests/common/util.rs:2001:13
   5: tests::common::util::UChild::wait
             at ./tests/common/util.rs:1948:22
   6: tests::common::util::UCommand::run
             at ./tests/common/util.rs:1543:9
   7: tests::common::util::UCommand::fails
             at ./tests/common/util.rs:1567:26
   8: tests::test_mv::test_mv_arg_interactive_skipped_vin
             at ./tests/by-util/test_mv.rs:1263:5
   9: tests::test_mv::test_mv_arg_interactive_skipped_vin::{{closure}}
             at ./tests/by-util/test_mv.rs:1259:42
  10: core::ops::function::FnOnce::call_once
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ops/function.rs:250:5
  11: core::ops::function::FnOnce::call_once
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

works locally

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/mv/mv-n is no longer failing!
GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?

@cakebaker
Copy link
Contributor

Hm, the code looks fine and works locally, too. Maybe it's the unnecessary pipe_in call?

@sylvestre sylvestre force-pushed the mv-n branch 2 times, most recently from 9f3226e to 7bdfa5c Compare May 27, 2023 19:17
@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/mv/mv-n is no longer failing!

@sylvestre
Copy link
Sponsor Contributor Author

I used ignore_stdin_write_error to ignore the stdin

@tertsdiepraam
Copy link
Member

Any idea what is going on?

Not really, but I have some vague recollection of this happening due to nextest in some other PR?

at.touch("a");
at.touch("b");
ucmd.args(&["-vin", "a", "b"])
.pipe_in("y\n")
Copy link
Contributor

@cakebaker cakebaker May 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use pipe_in in this test case? It seems to be unnecessary as the test also works without it.

Suggested change
.pipe_in("y\n")

Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because you want to test the yes and no behavior, no ? :)

Copy link
Contributor

@cakebaker cakebaker May 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, of course :) However, in this specific case, there is no yes/no-behavior to test because there is no such behavior when using -vin. It doesn't matter what you pipe in, the output will always be the same.

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/mv/mv-n is no longer failing!

@sylvestre sylvestre requested a review from cakebaker May 29, 2023 21:29
@cakebaker cakebaker merged commit 191f238 into uutils:main May 30, 2023
44 checks passed
@sylvestre sylvestre deleted the mv-n branch May 30, 2023 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants