You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
std::tests::test_dirs::test_dirs_command fails on MacOS #8528
according to the investigations of @fdncred in the comments of the PR
This is what's going on.
> assert ($base_path == $env.DIRS_LIST.0) "list is just pwd after initialization"
Error:
× list is just pwd after initialization
╭─[entry #76:1:1]
1 │ assert ($base_path == $env.DIRS_LIST.0) "list is just pwd after initialization"
· ────────────────┬───────────────
· ╰── It is not true.
╰────
Here are the latest results from MacOS as of this morning after landing #8552.
NU_LOG_LEVEL=DEBUG nu crates/nu-utils/standard_library/tests.nu
INFO Run tests in test_asserts
DEBUG Run test test_asserts test_assert
DEBUG Run test test_asserts test_assert_equal
DEBUG Run test test_asserts test_assert_error
DEBUG Run test test_asserts test_assert_greater
DEBUG Run test test_asserts test_assert_greater_or_equal
DEBUG Run test test_asserts test_assert_length
DEBUG Run test test_asserts test_assert_less
DEBUG Run test test_asserts test_assert_less_or_equal
DEBUG Run test test_asserts test_assert_not_equal
INFO Run tests in test_dirs
DEBUG Run test test_dirs test_dirs_command
Error:
× add changes PWD to first added dir
INFO Run tests in test_logger
DEBUG Run test test_logger test_critical
DEBUG Run test test_logger test_debug
DEBUG Run test test_logger test_error
DEBUG Run test test_logger test_info
DEBUG Run test test_logger test_warning
INFO Run tests in test_std
DEBUG Run test test_std test_match
DEBUG Run test test_std test_path_add
Here's the test results from Windows
NU_LOG_LEVEL=DEBUG nu crates/nu-utils/standard_library/tests.nu
INFO Run tests in test_asserts
DEBUG Run test test_asserts test_assert
DEBUG Run test test_asserts test_assert_equal
DEBUG Run test test_asserts test_assert_error
DEBUG Run test test_asserts test_assert_greater
DEBUG Run test test_asserts test_assert_greater_or_equal
DEBUG Run test test_asserts test_assert_length
DEBUG Run test test_asserts test_assert_less
DEBUG Run test test_asserts test_assert_less_or_equal
DEBUG Run test test_asserts test_assert_not_equal
INFO Run tests in test_dirs
DEBUG Run test test_dirs test_dirs_command
INFO Run tests in test_logger
DEBUG Run test test_logger test_critical
DEBUG Run test test_logger test_debug
DEBUG Run test test_logger test_error
DEBUG Run test test_logger test_info
DEBUG Run test test_logger test_warning
INFO Run tests in test_std
DEBUG Run test test_std test_match
DEBUG Run test test_std test_path_add
And from Ubuntu via WSL
NU_LOG_LEVEL=DEBUG nu crates/nu-utils/standard_library/tests.nu
INFO Run tests in test_asserts
DEBUG Run test test_asserts test_assert
DEBUG Run test test_asserts test_assert_equal
DEBUG Run test test_asserts test_assert_error
DEBUG Run test test_asserts test_assert_greater
DEBUG Run test test_asserts test_assert_greater_or_equal
DEBUG Run test test_asserts test_assert_length
DEBUG Run test test_asserts test_assert_less
DEBUG Run test test_asserts test_assert_less_or_equal
DEBUG Run test test_asserts test_assert_not_equal
INFO Run tests in test_dirs
DEBUG Run test test_dirs test_dirs_command
INFO Run tests in test_logger
DEBUG Run test test_logger test_critical
DEBUG Run test test_logger test_debug
DEBUG Run test test_logger test_error
DEBUG Run test test_logger test_info
DEBUG Run test test_logger test_warning
INFO Run tests in test_std
DEBUG Run test test_std test_match
DEBUG Run test test_std test_path_add
it must be something different. i haven't drilled in to see what is going on exactly with line-by-line debugging. but it runs further before puking.
yeah something different than the base_path addressed in #8552 👍
but still the issue in this issue is not addressed 😮 std::tests::test_dirs::test_dirs_command still fails on macOS, right?
worse, maybe we should revert the changes in #8552 if that's not the real problem 🤔
we need to investigate more on this 😉
this is why i think we should reopen this issue 😋
All this makes me glad that we plan to do ci testing cross-platform for std.nu.
there is no rush for this, #8525 can wait a bit more 😉
I do not agree. I think it would be better to remove dirs commands, until it is fixed, and wire in the CI without it, since it already breaks the philosophy of being fully cross-platform. (Also it will be easier to test the re-addition in a new PR, since MacOS test will run against it. Until CI is active we cannot be sure that a new command will also break in some platform or not.)
I do not agree. I think it would be better to remove dirs commands, until it is fixed, and wire in the CI without it, since it already breaks the philosophy of being fully cross-platform. (Also it will be easier to test the re-addition in a new PR, since MacOS test will run against it. Until CI is active we cannot be sure that a new command will also break in some platform or not.)
i'd rather disable the tests, e.g. by making theirs names invisible by the test runner, in order to speed up #8525
then i can solve the merge conflict in the runner and finally merge all this 💪
if everyone is ok with disabling the tests in test_dirs.nu, i can do that tomorrow right after work 👍
I do not want to hold it back. If the decision is to disable these tests, please do this way (of course, replace Windows with the proper name for MacOS. I do not know, what are the possible values here):
diff --git a/crates/nu-utils/standard_library/test_dirs.nu b/crates/nu-utils/standard_library/test_dirs.nu
index 1370c5e35..fe5ec61cf 100644
--- a/crates/nu-utils/standard_library/test_dirs.nu+++ b/crates/nu-utils/standard_library/test_dirs.nu@@ -1,5 +1,6 @@
use std.nu "assert length"
use std.nu "assert equal"
+use std.nu "log warning"
def clean [path: path] {
cd $path
@@ -8,6 +9,10 @@ def clean [path: path] {
}
export def test_dirs_command [] {
+ if (sys).host.name == "Windows" {+ log warning "Skip testing in MacOS, see https://github.com/nushell/nushell/issues/8528"+ return+ }
# need some directories to play with
let base_path = (($nu.temp-path) | path join $"test_dirs_(random uuid)" | path expand )
let path_a = ($base_path | path expand | path join "a")
It looks like $path_b isn't being expanded through the symlink.
To be more clear, if we want this to work, we'll have to path expand after the path join (i think) or we'll need to modify path join's rust code so that it does expand.
After talking about this in our meeting today, we do not want to disable any tests, but we want to fix the problems that we find because that just makes the language better. I think we need to fix path join so that it expands.
Activity
fdncred commentedon Mar 19, 2023
In this instance, this works
So, maybe we should make sure paths go through
path expandto ensure they're "right"?or better yet, it could probably be fixed with this:
versus
I kind of wonder if that
$nu.temp-path(and the other paths in $nu) should go through apath expandbefore storing them in nushell's $nu?amtoine commentedon Mar 20, 2023
that might help catch this kind of annoying bug! 😋
amtoine commentedon Mar 20, 2023
@fdncred i think i get the issue here, let me try to fix it 👌
amtoine commentedon Mar 20, 2023
mm wait
the
base_pathis alreadyexpanded 🤔https://github.com/nushell/nushell/blob/main/crates/nu-utils/standard_library/test_dirs.nu#L12
fdncred commentedon Mar 20, 2023
ya, i saw that, but it needs it again or it needs to be expanded in the rust code
amtoine commentedon Mar 21, 2023
i can try to add more
path expandand you tell me if that's any better? 🤔amtoine commentedon Mar 21, 2023
@fdncred
can you tell me if that's any better with #8552? 😋
FIX: expand all the `base_path`s in `std::test_dirs` (#8552)
fdncred commentedon Mar 22, 2023
Here are the latest results from MacOS as of this morning after landing #8552.
Here's the test results from Windows
And from Ubuntu via WSL
amtoine commentedon Mar 22, 2023
mm ok so it looks better but not perfect to me 🤔
amtoine commentedon Mar 22, 2023
with the first test output i'd say that this issue should not be closed by #8552
2 remaining items
amtoine commentedon Mar 22, 2023
yeah something different than the
base_pathaddressed in #8552 👍but still the issue in this issue is not addressed 😮
std::tests::test_dirs::test_dirs_commandstill fails on macOS, right?worse, maybe we should revert the changes in #8552 if that's not the real problem 🤔
we need to investigate more on this 😉
this is why i think we should reopen this issue 😋
oh yeah for sure 😌
amtoine commentedon Mar 22, 2023
thanks a lot 😋
there is no rush for this, #8525 can wait a bit more 😉
presidento commentedon Mar 22, 2023
@amtoine
No. I did not approve it, I reviewed your code changes and liked it. Sorry if I made confusion with that.
presidento commentedon Mar 22, 2023
I do not agree. I think it would be better to remove dirs commands, until it is fixed, and wire in the CI without it, since it already breaks the philosophy of being fully cross-platform. (Also it will be easier to test the re-addition in a new PR, since MacOS test will run against it. Until CI is active we cannot be sure that a new command will also break in some platform or not.)
amtoine commentedon Mar 22, 2023
yeah that's what i thought, do not worry 😉
not a big deal at all, things can be reverted and reopened 💪
amtoine commentedon Mar 22, 2023
i'd rather disable the tests, e.g. by making theirs names invisible by the test runner, in order to speed up #8525
then i can solve the merge conflict in the runner and finally merge all this 💪
if everyone is ok with disabling the tests in
test_dirs.nu, i can do that tomorrow right after work 👍presidento commentedon Mar 22, 2023
I do not want to hold it back. If the decision is to disable these tests, please do this way (of course, replace Windows with the proper name for MacOS. I do not know, what are the possible values here):
amtoine commentedon Mar 22, 2023
@presidento, kinda like the way you disable them 👍
fdncred commentedon Mar 22, 2023
The problem with
add changes PWD to first added diris because:It looks like
$path_bisn't being expanded through the symlink.To be more clear, if we want this to work, we'll have to
path expandafter thepath join(i think) or we'll need to modifypath join's rust code so that it does expand.So, maybe we can get by for now by changing this:
to this: (i need to test this first)
fdncred commentedon Mar 22, 2023
After talking about this in our meeting today, we do not want to disable any tests, but we want to fix the problems that we find because that just makes the language better. I think we need to fix
path joinso that it expands.make std.nu tests work on mac (#8576)
fdncred commentedon Mar 23, 2023
btw #8576 i think fixes the problems we were having. hopefully this will "unstick" us so we can keep moving forward.
amtoine commentedon Mar 23, 2023
i'll try to fix #8525 tonight 👍