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

Use short options for ls command #819

Merged
merged 4 commits into from
Aug 10, 2021
Merged

Use short options for ls command #819

merged 4 commits into from
Aug 10, 2021

Conversation

tsoutsman
Copy link
Contributor

Closes #783

I don't think it's possible to create a regression test as that would require complex CI environments with different ls versions.

@tsoutsman tsoutsman force-pushed the master branch 2 times, most recently from 8b4ebb8 to b9275d5 Compare August 9, 2021 08:11
Copy link
Collaborator

@tmccombs tmccombs left a comment

Choose a reason for hiding this comment

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

Please add an entry to the CHANGELOG. Other than that I think this looks good.

@tsoutsman
Copy link
Contributor Author

@tmccombs done

@tsoutsman tsoutsman force-pushed the master branch 2 times, most recently from c56a5ea to 0f098a1 Compare August 9, 2021 08:29
@tsoutsman
Copy link
Contributor Author

I'm actually stupid. 5th time's the charm.

@tsoutsman
Copy link
Contributor Author

I just tried to run ls on an old MacBook I had lying around. It seems like it doesn't support the --color option which outputs ls: illegal option -- - the same error found in the logs. None of the changes I made should have affected the colour options, but I made a quick and dirty fix to check if that's the issue. The colour should be enabled later on with the -G option anyway.

@sharkdp
Copy link
Owner

sharkdp commented Aug 9, 2021

I just tried to run ls on an old MacBook I had lying around. It seems like it doesn't support the --color option

That's why we previously only passed the color arg if we have gls (GNU ls) available on macOS. I think it was working correctly.

Try to fix ls `--color` option on macos
@tsoutsman
Copy link
Contributor Author

Ight, sorry about that whole debacle, it should finally be good now.

@peternewman
Copy link
Contributor

peternewman commented Aug 9, 2021

I don't think it's possible to create a regression test as that would require complex CI environments with different ls versions.

Thanks @tsoutsman . As mentioned in the issue, this happened on GitHub Actions, so it should be pretty easy to test. Given it looks like there are test runs I'm a bit surprised they haven't caught this before.

I think this was where I had it broken and worked around it:
ssilverman/rdm-schema@3d61366

@tsoutsman
Copy link
Contributor Author

Thanks @tsoutsman . As mentioned in the issue, this happened on GitHub Actions, so it should be pretty easy to test. Given it > looks like there are test runs I'm a bit surprised they haven't caught this before.

Given how I handled changing 4 lines of code, I think I should avoid touching the CI with a ten-foot pole.

@peternewman
Copy link
Contributor

peternewman commented Aug 9, 2021

Interestingly there is a test:

fd/tests/tests.rs

Lines 1764 to 1770 in 224b7f2

#[test]
fn test_list_details() {
let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);
// Make sure we can execute 'fd --list-details' without any errors.
te.assert_success_and_get_output(".", &["--list-details"]);
}

I'm definitely no rust expert, but even when I add a 20.04 run (#820) (which ubuntu-latest was at the time I hit the issue), there's no mention of any of the tests in that file in the test log that I can see:
https://github.com/peternewman/fd/runs/3279423614?check_suite_focus=true

Which might be why it wasn't caught...

Indeed the docs seem to say it won't run as an integration test, but not how to run it instead:
https://doc.rust-lang.org/book/ch11-03-test-organization.html#integration-tests-for-binary-crates

@sharkdp
Copy link
Owner

sharkdp commented Aug 9, 2021

I'm definitely no rust expert, but even when I add a 20.04 run (#820) (which ubuntu-latest was at the time I hit the issue), there's no mention of any of the tests in that file in the test log that I can see:
https://github.com/peternewman/fd/runs/3279423614?check_suite_focus=true

Which might be why it wasn't caught...

These tests do not run on ARM platforms (see CARGO_TEST_OPTIONS in CI scripts). They run on all other platforms though (e.g. https://github.com/peternewman/fd/runs/3279423791?check_suite_focus=true)

@sharkdp
Copy link
Owner

sharkdp commented Aug 9, 2021

@tsoutsman Thank you very much.

Given how I handled changing 4 lines of code, I think I should avoid touching the CI with a ten-foot pole.

No worries! 😄 If you (still) think that the code is confusing, please let me know. There's certainly a way to improve it.

I think this PR is good to go. @peternewman ?

@peternewman
Copy link
Contributor

These tests do not run on ARM platforms (see CARGO_TEST_OPTIONS in CI scripts). They run on all other platforms though (e.g. https://github.com/peternewman/fd/runs/3279423791?check_suite_focus=true)

Yes of course, you can't run the binary when cross-compiling...

@peternewman
Copy link
Contributor

I think this PR is good to go. @peternewman ?

Yes, agreed. :shipit:

Looking back at my issue, it was within a Docker container I had the issue, which is probably far more of a faff to spin up CI wise...

@sharkdp sharkdp merged commit 6a18b36 into sharkdp:master Aug 10, 2021
@niklasmohrin niklasmohrin mentioned this pull request Aug 22, 2021
1 task
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.

fd -l/--list-details doesn't work in busybox
4 participants