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

Test failure for 0.7.0 on Arch Linux #140

Open
orhun opened this issue Sep 26, 2024 · 8 comments
Open

Test failure for 0.7.0 on Arch Linux #140

orhun opened this issue Sep 26, 2024 · 8 comments

Comments

@orhun
Copy link

orhun commented Sep 26, 2024

Hey, I'm getting the following test failure while building the latest version for Arch Linux (in a clean chroot):

failures:

---- test_ignore_target stdout ----
thread 'test_ignore_target' panicked at src/main.rs:310:5:
assertion failed: entries.unwrap().is_empty()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    test_ignore_target

test result: FAILED. 12 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.98s

error: test failed, to rerun pass `--bin cargo-machete`

Do I need any preparation before running the tests? Any ideas about it? 🤔

As a workaround I currently --skip this test in the package.

@bnjbvr
Copy link
Owner

bnjbvr commented Sep 29, 2024

Thanks for the report. That's weird, I can't repro on my (MacOS) machine; are you using the version from a github release, or installed from cargo, or building from a specific git hash?

@orhun
Copy link
Author

orhun commented Sep 29, 2024

I'm pulling the release from GitHub (0.7.0) and building in an isolated environment. See the PKGBUILD for build steps.

Let me know if there is any other information is needed!

@bnjbvr
Copy link
Owner

bnjbvr commented Sep 30, 2024

Thanks for the details; unfortunately I can't reproduce on my machine. If anyone can reproduce and track the test failure, that would be greatly appreciated 🙏

@orhun
Copy link
Author

orhun commented Oct 1, 2024

Maybe you can tell me what that test is doing, how is it being run and why it might fail. Then I can dig into it a bit :)

@bnjbvr
Copy link
Owner

bnjbvr commented Oct 1, 2024

The test checks collect_paths, which has options to ignore target directories (first assertion), or to ignore files mentioned in ignore files (second assertion, where there's /target in ./integration-tests/with-target/target/program/.gitignore), or that when none of these is enabled, we do find some entries.

If the .gitignore file is missing from the archive you're downloading, I could see that test failing. Otherwise it's not clear why it's not failing: is the .gitignore file found? is it then not ignored, or interpreting /target as a different path than ./integration-tests/with-target/target/?

@orhun
Copy link
Author

orhun commented Oct 6, 2024

Okay I found the culprit. The downloaded archive from GitHub is not a git repository (does not contain .git folder) so I'm guessing the underlying library does not take .gitignore into account in that case.

The test passes when I rename .gitignore to .ignore 🫠

@bnjbvr
Copy link
Owner

bnjbvr commented Oct 8, 2024

Thanks for the investigation! I think we could rename .gitignore to .ignore and not lose any testing coverage, since this is testing that any kind of ignore files is taken into account. Thoughts?

@orhun
Copy link
Author

orhun commented Oct 8, 2024

Yup, sounds good to me 👍🏼

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

No branches or pull requests

2 participants